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

Handling Anonymous, chunking decisions, and existing checksums #4517

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

haydenbaker
Copy link
Contributor

@haydenbaker haydenbaker commented Sep 30, 2023

Motivation and Context

  • If a request has an anonymous identity, we should not sign it, but we should still optionally encode it and add flexible checksum information to it
  • If a request is chunk-encoding enabled, we still must do some checks before we decide to chunk-encode the payload (i.e. if checksum is in headers and it's unsigned, we should NOT chunk-encode)
  • If a checksum is already provided in the request headers, we should not re-compute it or override it

Testing

  • Run s3 integration tests
  • Run unit tests

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@haydenbaker haydenbaker marked this pull request as ready for review September 30, 2023 00:34
@haydenbaker haydenbaker requested a review from a team as a code owner September 30, 2023 00:34
Base automatically changed from haydenbaker/sra-ia-checksums-and-encoding-fixes to feature/master/sra-identity-auth October 2, 2023 18:16
@haydenbaker haydenbaker force-pushed the haydenbaker/sra-ia-fixes branch 3 times, most recently from 872cd5e to a096afd Compare October 2, 2023 18:33
@@ -157,7 +182,7 @@ private static V4PayloadSigner v4PayloadSigner(
throw new UnsupportedOperationException("Unsigned payload is not supported with event-streaming.");
}

if (isChunkEncoding) {
if ((isChunkEncoding && isPayloadSigning) || (isChunkEncoding && (isTrailing || isFlexible))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggesting extracting it to a separate method and add javadoc to make it more clear


private boolean useChunkedEncoding(BaseSignRequest<?, ? extends AwsCredentialsIdentity> request) 

@sonarcloud
Copy link

sonarcloud bot commented Oct 2, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 9 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 500 Code Smells

85.1% 85.1% Coverage
4.4% 4.4% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@zoewangg zoewangg merged commit 54d5420 into feature/master/sra-identity-auth Oct 2, 2023
6 of 7 checks passed
@zoewangg zoewangg deleted the haydenbaker/sra-ia-fixes branch October 2, 2023 20:17
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.

2 participants