-
Notifications
You must be signed in to change notification settings - Fork 869
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
Do not send Md5 checksum header if ChecksumMode is enabled #4731
Merged
Conversation
This file contains 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
Outdated
Show resolved
Hide resolved
...rc/main/java/software/amazon/awssdk/services/s3/checksums/S3ChecksumValidatingPublisher.java
Outdated
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
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. 0 Bugs 79.9% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
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,
EnableTrailingChecksumInterceptor
addsx-amz-te:append-md5
to 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
ChecksumMode
is enabled on theGetObjectRequest
. If aChecksumAlgorithm
was specified on thePutObjectRequest
, theHttpChecksumValidationInterceptor
will validate the flexible checksum, wrapping withChecksumValidatingInputStream
orChecksumValidatingPublisher
. Validation is performed twice, both for Md5 and flexible checksums.#4694
Modifications
If
ChecksumMode
is enabled, do not addx-amz-te:append-md5
to aGetObjectRequest
.If
ChecksumMode
is enabled and an algorithm was specified when the object was put, only the flexible checksum will be validated.If
ChecksumMode
is 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 install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License