-
Notifications
You must be signed in to change notification settings - Fork 976
Disable payload signing for https requests #6691
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
Open
RanVaknin
wants to merge
5
commits into
master
Choose a base branch
from
rvaknin/disable-payload-signing-for-https-requests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2d34fd3
Disable payload signing for HTTPS requests
RanVaknin 04ba7d4
Update Javadoc
RanVaknin 8e59fcd
Add changelog
RanVaknin 5501942
Fix tests with new default behavior
RanVaknin e92f447
Fix tangential fixture tests, fix javadoc, fix ChecksumUtil logic
RanVaknin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "type": "feature", | ||
| "category": "AWS SDK for Java v2", | ||
| "contributor": "", | ||
| "description": "HTTPS requests now skip payload signing by default for improved performance. HTTP and signing-dependent features are unaffected." | ||
| } |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,7 +140,7 @@ void sign_withBasicRequest_shouldSignWithHeaders() { | |
| assertThat(signedRequest.request().firstMatchingHeader("X-Amz-Date")).hasValue("20200803T174823Z"); | ||
| assertThat(signedRequest.request().firstMatchingHeader("X-Amz-Region-Set")).hasValue("aws-global"); | ||
| assertThat(signedRequest.request().firstMatchingHeader("Authorization")).isPresent(); | ||
| assertThat(signedRequest.request().firstMatchingHeader("x-amz-content-sha256")).contains(PAYLOAD_SHA256_HEX); | ||
| assertThat(signedRequest.request().firstMatchingHeader("x-amz-content-sha256")).hasValue("UNSIGNED-PAYLOAD"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing default behavior |
||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -172,7 +172,7 @@ void signAsync_withBasicRequest_shouldSignWithHeaders() { | |
| assertThat(signedRequest.request().firstMatchingHeader("X-Amz-Date")).hasValue("20200803T174823Z"); | ||
| assertThat(signedRequest.request().firstMatchingHeader("X-Amz-Region-Set")).hasValue("aws-global"); | ||
| assertThat(signedRequest.request().firstMatchingHeader("Authorization")).isPresent(); | ||
| assertThat(signedRequest.request().firstMatchingHeader("x-amz-content-sha256")).contains(PAYLOAD_SHA256_HEX); | ||
| assertThat(signedRequest.request().firstMatchingHeader("x-amz-content-sha256")).hasValue("UNSIGNED-PAYLOAD"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing default behavior |
||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -564,6 +564,7 @@ void sign_WithChunkEncodingTrue_DelegatesToAwsChunkedPayloadSigner() { | |
| .putHeader(Header.CONTENT_LENGTH, "20"), | ||
| signRequest -> signRequest | ||
| .putProperty(CHUNK_ENCODING_ENABLED, true) | ||
| .putProperty(PAYLOAD_SIGNING_ENABLED, true) | ||
| ); | ||
|
|
||
| SignedRequest signedRequest = signer.sign(request); | ||
|
|
@@ -587,6 +588,7 @@ void signAsync_WithChunkEncodingTrue_DelegatesToAwsChunkedPayloadSigner() { | |
| .putHeader(Header.CONTENT_LENGTH, contentLength), | ||
| signRequest -> signRequest | ||
| .putProperty(CHUNK_ENCODING_ENABLED, true) | ||
| .putProperty(PAYLOAD_SIGNING_ENABLED, true) | ||
| ); | ||
|
|
||
| AsyncSignedRequest signedRequest = signer.signAsync(request).join(); | ||
|
|
@@ -610,6 +612,7 @@ void sign_WithChunkEncodingTrueAndChecksumAlgorithm_DelegatesToAwsChunkedPayload | |
| signRequest -> signRequest | ||
| .putProperty(CHUNK_ENCODING_ENABLED, true) | ||
| .putProperty(CHECKSUM_ALGORITHM, CRC32) | ||
| .putProperty(PAYLOAD_SIGNING_ENABLED, true) | ||
| ); | ||
|
|
||
| SignedRequest signedRequest = signer.sign(request); | ||
|
|
@@ -636,6 +639,7 @@ void signAsync_WithChunkEncodingTrueAndChecksumAlgorithm_DelegatesToAwsChunkedPa | |
| signRequest -> signRequest | ||
| .putProperty(CHUNK_ENCODING_ENABLED, true) | ||
| .putProperty(CHECKSUM_ALGORITHM, CRC32) | ||
| .putProperty(PAYLOAD_SIGNING_ENABLED, true) | ||
| ); | ||
|
|
||
| AsyncSignedRequest signedRequest = signer.signAsync(request).join(); | ||
|
|
||
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
If payloadSigningEnabled is not null, i.e., configured by the user or set on the service model, should we always enable payload signing regardless of isEncrypted?