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

feat: support private S3 buckets #9697

Merged
merged 3 commits into from May 1, 2024
Merged

feat: support private S3 buckets #9697

merged 3 commits into from May 1, 2024

Conversation

mattkrick
Copy link
Member

@mattkrick mattkrick commented May 1, 2024

Description

Fix #9684

This adds support for partially private buckets.
This only applies if an instance uses S3 and has the env var IS_ENTERPRISE=true
It also removes AWS_S3_BUCKET since that info is derived from CDN_BASE_URL.
The S3 Client version must be pinned to exactly this version! Older versions have no support for bucketEndpoints. Any newer & there's a bug for presigned URLs: aws/aws-sdk-js-v3#6045.

How it works:

  • fileStore URLs remain unchanged in the DB
  • At the GraphQL layer, between the DB and the client, the URL is transformed into a presigned temporary URL
  • The client receives this presigned URL & fetches it without any extra headers

Demo

Testing scenarios

  • create an account, the avatar loads everywhere!
  • run predeploy & assets get pushed to the file store
  • change your org & user avatars & it works

Signed-off-by: Matt Krick <matt.krick@gmail.com>
Signed-off-by: Matt Krick <matt.krick@gmail.com>
Signed-off-by: Matt Krick <matt.krick@gmail.com>
@mattkrick mattkrick merged commit db17c9d into master May 1, 2024
5 checks passed
@mattkrick mattkrick deleted the feat/s3-auth-store branch May 1, 2024 22:15
@github-actions github-actions bot mentioned this pull request May 1, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support authenticated S3 access for user assets
1 participant