-
Notifications
You must be signed in to change notification settings - Fork 962
Do not send Md5 checksum header if ChecksumMode is enabled #4731
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zoewangg
reviewed
Dec 1, 2023
.../s3/src/it/java/software/amazon/awssdk/services/s3/checksum/HttpChecksumIntegrationTest.java
Outdated
Show resolved
Hide resolved
...s3/src/main/java/software/amazon/awssdk/services/s3/checksums/ChecksumsEnabledValidator.java
Outdated
Show resolved
Hide resolved
.../main/java/software/amazon/awssdk/services/s3/checksums/S3ChecksumValidatingInputStream.java
Show resolved
Hide resolved
...rc/main/java/software/amazon/awssdk/services/s3/checksums/S3ChecksumValidatingPublisher.java
Show resolved
Hide resolved
.../s3/src/it/java/software/amazon/awssdk/services/s3/checksum/HttpChecksumIntegrationTest.java
Show resolved
Hide resolved
...s3/src/main/java/software/amazon/awssdk/services/s3/checksums/ChecksumsEnabledValidator.java
Outdated
Show resolved
Hide resolved
zoewangg
approved these changes
Dec 1, 2023
Contributor
zoewangg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure integ tests are passing before merging.
services/s3/src/main/java/software/amazon/awssdk/services/s3/S3Configuration.java
Outdated
Show resolved
Hide resolved
...rc/it/java/software/amazon/awssdk/services/s3/checksum/AsyncHttpChecksumIntegrationTest.java
Show resolved
Hide resolved
|
SonarCloud Quality Gate failed.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.










Motivation and Context
Currently, if checksum validation is enabled (default) and regular S3 is used,
EnableTrailingChecksumInterceptoraddsx-amz-te:append-md5to aGetObjectRequest. The server adds the Md5 checksum to the response and the SDK validates it, wrapping withS3ChecksumValidatingInputStream(sync) orS3ChecksumValidatingPublisher(aync).This is done even if
ChecksumModeis enabled on theGetObjectRequest. If aChecksumAlgorithmwas specified on thePutObjectRequest, theHttpChecksumValidationInterceptorwill validate the flexible checksum, wrapping withChecksumValidatingInputStreamorChecksumValidatingPublisher. Validation is performed twice, both for Md5 and flexible checksums.#4694
Modifications
If
ChecksumModeis enabled, do not addx-amz-te:append-md5to aGetObjectRequest.If
ChecksumModeis enabled and an algorithm was specified when the object was put, only the flexible checksum will be validated.If
ChecksumModeis enabled and no algorithm was specified when the object was put, no validation will be performed. (previously it would fallback to Md5 validation)Testing
Added unit and integ tests
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License