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

Specify content-MD5 when generating presigned URL for uploading object #1161

Open
hardikSinghBehl opened this issue Jun 6, 2024 · 2 comments
Labels
component: s3 S3 integration related issue type: enhancement Smaller enhancement in existing integration

Comments

@hardikSinghBehl
Copy link
Contributor

hardikSinghBehl commented Jun 6, 2024

Type: Feature

Is your feature request related to a problem? Please describe.
When generating a presigned URL for uploading an object, two headers of contentMD5 and contentLength are recommended to be added to avoid phishing attacks and improve overall security.

The ObjectMetadata class allows me to specify the contentLength, but not contentMD5.

Describe the solution you'd like
The ability to configure the contentMD5 hash when generating a PUT presigned URL, like below:

final var metadata = ObjectMetadata.builder().contentLength(length).contentMD5(contentMD5).build();
return s3Template.createSignedPutURL(bucketName, objectKey, urlValidity, metadata, null);

Describe alternatives you've considered

Currently, I used the S3Client class directly instead of S3Template.

Additional context
Can raise a PR for this!

@maciejwalkowiak maciejwalkowiak added component: s3 S3 integration related issue type: enhancement Smaller enhancement in existing integration labels Sep 19, 2024
@maciejwalkowiak
Copy link
Contributor

@hardikSinghBehl sounds good! If you're still interested, please submit a PR!

@hardikSinghBehl
Copy link
Contributor Author

I've raised a PR for this issue @maciejwalkowiak. It's ready to be reviewed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: s3 S3 integration related issue type: enhancement Smaller enhancement in existing integration
Projects
None yet
Development

No branches or pull requests

2 participants