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

Implement s3 integration #141

Merged
merged 9 commits into from
Feb 20, 2024
Merged

Implement s3 integration #141

merged 9 commits into from
Feb 20, 2024

Conversation

jotjern
Copy link
Member

@jotjern jotjern commented Feb 19, 2024

No description provided.

Copy link

vercel bot commented Feb 19, 2024

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

Name Status Preview Comments Updated (UTC)
receipt-form ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 20, 2024 8:33pm

@jotjern jotjern marked this pull request as ready for review February 19, 2024 21:43
Copy link
Member

@junlarsen junlarsen left a comment

Choose a reason for hiding this comment

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

We should use createPresignedPost https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#createPresignedPost-property with a content-length-range limit

const M = 40 // max 40 mb or something
const args = {
  Bucket: ...,
  ...,
  Conditions: [
    ["content-length-range", 0, 1024 * 1024 * M]
  ]
}

This way an attacker can't upload arbitrarily large files to our s3 bucket that we pay for

src/form/validation.ts Outdated Show resolved Hide resolved
Copy link
Member

@junlarsen junlarsen left a comment

Choose a reason for hiding this comment

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

sick lgtm

@jotjern jotjern merged commit 7026f39 into master Feb 20, 2024
2 of 3 checks passed
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