Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-7811 - refactor getSignedUrl to use storageProviderId and bucket #5174

Merged
merged 8 commits into from
Aug 13, 2024

Conversation

bergatco
Copy link
Contributor

@bergatco bergatco commented Aug 8, 2024

Description

When trying to access files, the used storageProvider is chosen based on the school ID of the creator. If the creator is assigned to another school, after having created the file, the file can no longer be accessed, as the storage of the newly assigned school is used.

Links to Tickets or other pull requests

JIRA :
https://ticketsystem.dbildungscloud.de/browse/BC-7811
https://ticketsystem.dbildungscloud.de/browse/SVS-376
https://ticketsystem.dbildungscloud.de/browse/JHD-47434

Deployments :
https://bc-7811-request-to-files-calls-for-wrong-s3.dbc.dbildungscloud.dev/
https://bc-7811-request-to-files-calls-for-wrong-s3.brb.dbildungscloud.dev/
https://bc-7811-request-to-files-calls-for-wrong-s3.nbc.dbildungscloud.dev/

Changes

Datasecurity

Deployment

New Repos, NPM pakages or vendor scripts

Approval for review

  • DEV: If api was changed - generate-client:server was executed in vue frontend and changes were tested and put in a PR with the same branch name.
  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.

@bergatco bergatco added the WIP This feature branch is in progress, do not merge into master. label Aug 8, 2024
src/services/fileStorage/strategies/awsS3.js Dismissed Show dismissed Hide dismissed
@bergatco bergatco changed the title BC-7811 - refactor getSignedUrl to use storageProviderId and `buc… BC-7811 - refactor getSignedUrl to use storageProviderId and bucket Aug 9, 2024
@bergatco bergatco requested a review from uidp August 9, 2024 06:47
@bergatco bergatco added waiting for review and removed WIP This feature branch is in progress, do not merge into master. labels Aug 9, 2024
Copy link
Contributor

@uidp uidp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'm still wondering though why prepareSecurityCheck doesn't have to be awaited in fileStorageService.create(). Or is the order of execution not important?

prepareSecurityCheck(file, creatorId, strategy).catch(asyncErrorHandler);

src/services/fileStorage/proxy-service.js Show resolved Hide resolved
@bergatco
Copy link
Contributor Author

Looks good. I'm still wondering though why prepareSecurityCheck doesn't have to be awaited in fileStorageService.create(). Or is the order of execution not important?

prepareSecurityCheck(file, creatorId, strategy).catch(asyncErrorHandler);

I think any issues with prepareThumbnailGeneration as well as prepareSecurityCheck should be catched / handled by asyncErrorHandler function. Therefore it is not necessary to await both functions.

I just took prepareSecurityCheck as a template while refactoring prepareThumbnailGeneration and aligned both implementations.

Copy link

@bergatco bergatco merged commit 631578e into main Aug 13, 2024
55 of 56 checks passed
@bergatco bergatco deleted the BC-7811-request-to-files-calls-for-wrong-s3 branch August 13, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants