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: set up S3 connector to get presigned PUT URL #439

Merged
merged 7 commits into from
Aug 7, 2024

Conversation

dcshzj
Copy link
Contributor

@dcshzj dcshzj commented Aug 6, 2024

Problem

We don't have a proper S3 connector to handle asset uploading.

Solution

Breaking Changes

  • Yes - this PR contains breaking changes
  • No - this PR is backwards compatible

Features:

  • Add basic S3 connector to handle uploading of assets. For now it only performs getting a pre-signed PUT URL.
  • The filename key is in the format ${siteId}/${UUID}/${fileName}.

@dcshzj dcshzj requested a review from a team as a code owner August 6, 2024 08:33
Copy link

vercel bot commented Aug 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
isomer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 7:45am

// NOTE: We're using a random folder name to prevent collisions
const folderName = randomUUID()

return `${siteId}/${folderName}/${fileName}`
Copy link
Contributor

Choose a reason for hiding this comment

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

hwy not just use the resource id since it's guaranteed to be unique

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm this is the asset itself and it's possible to have multiple images within the same page resource, so will need a more globally unique ID.

@dcshzj dcshzj merged commit 76f8f40 into main Aug 7, 2024
16 checks passed
@dcshzj dcshzj deleted the feat/get-presigned-put branch August 7, 2024 07:45
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.

2 participants