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

fix: x-amz-content-sha256 header is expected for unsigned payload and event stream operations #934

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

aajtodd
Copy link
Contributor

@aajtodd aajtodd commented Aug 23, 2023

Issue #

fixes awslabs/aws-sdk-kotlin#1029

Description of changes

  • Adds a new middleware when sigv4 is present that conditionally enables setting the SignedBodyHeader execution context attribute when the operation has the unsigned payload trait or is an event stream input. When set the signer will add the x-amz-content-sha256 header to the canonical request and set the header.
  • Adds the shouldSignHeader predicate to the AwsHttpSigner.Config. This was missing and allows auth scheme overrides to augment the set of signed headers. This allowed me to narrow down the issue since we include a few more headers than AWS CLI did. This should have been possible previously and I was surprised it wasn't.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aajtodd aajtodd requested a review from a team as a code owner August 23, 2023 14:29
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@aajtodd aajtodd merged commit 1e555c3 into main Aug 23, 2023
@aajtodd aajtodd deleted the fix-signature branch August 23, 2023 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lexv2 client RecognizeUtterance signature problem
3 participants