Update getCanonicalizedHeaderString to follow SigV4 spec#2502
Closed
skrueger wants to merge 1 commit intoaws:masterfrom
skrueger:krusimon/sigv4-headers
Closed
Update getCanonicalizedHeaderString to follow SigV4 spec#2502skrueger wants to merge 1 commit intoaws:masterfrom skrueger:krusimon/sigv4-headers
skrueger wants to merge 1 commit intoaws:masterfrom
skrueger:krusimon/sigv4-headers
Conversation
- Update to handle leading and trailing whitespace in header values - Update to handle multiple header values See Step 4 of https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html Without this change a request to S3 with multiple header values or a header value with leading and trailing spaces (e.g., ``` Header1: Cat\n Header1: Dog\n Header2: "a b c" \n ``` ) that is signed by the AwsS3V4Signer will receive a 403 Forbidden response with an Error Code of SignatureDoesNotMatch from S3.
|
Kudos, SonarCloud Quality Gate passed! |
Codecov Report
@@ Coverage Diff @@
## master #2502 +/- ##
============================================
+ Coverage 77.74% 77.75% +0.01%
Complexity 365 365
============================================
Files 1248 1248
Lines 39533 39540 +7
Branches 3094 3097 +3
============================================
+ Hits 30733 30745 +12
+ Misses 7314 7305 -9
- Partials 1486 1490 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
13 tasks
Member
Contributor
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
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.
See Step 4 of https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
Without this change a request to S3 with multiple header values or
a header value with leading and trailing spaces
(e.g.,
)
that is signed by the
AwsS3V4Signerwill receive a 403 Forbiddenresponse with an Error Code of SignatureDoesNotMatch from S3.
Description
Currently my HTTP requests that contain multiple values for a specific header are receiving an 403 Forbidden response from S3 with an Error Code of
SignatureDoesNotMatch. The S3's response would also return code would return the expected<CanonicalRequest>, which lead me to solving the issue.Motivation and Context
My requests to S3 are failing because the library does not correctly follow the SigV4 spec.
Testing
Screenshots
N/A
Types of changes
Checklist
mvn installsucceedsLicense