Skip to content

Conversation

dagnir
Copy link
Contributor

@dagnir dagnir commented Sep 27, 2025

Motivation and Context

This update enables reusing the initially computed payload checksum of a request across all request attempts. This ensures that even if the content is changed from one attempt to the next, the checksum included in the request will remain the same and the request will be rejected by the service.

This PR merges the feature branch which contains previously reviewed commits:

Modifications

Testing

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

dagnir and others added 3 commits September 19, 2025 11:07
* Reuse computed checksums across retries

This commit adds the ability to reuse previously computed checksums for
a request across retries.

This ensures that if a request data stream is modified between attempts
that the server will reject the request.

As part of this change, the `http-auth-spi` package has been updated to
expose a new interface: `PayloadChecksumStore`. This is a simple storage
interface that allows signers to store and retrieve computed checksums.
Additionally, a new `SignerProperty` is introduced,
`SdkInternalHttpSignerProperty.CHECKSUM_CACHE` so that signers and
their callers can access this cache.

Note that both the interface and associated signer property are
`@SdkProtectedApi` and not intended to be used by non-SDK consumers of
`http-auth-spi`.

Finally, this adds a dependency on `checksums-spi` for `http-auth-spi`.

* Update core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/SigningStage.java

Co-authored-by: David Ho <[email protected]>

* Review comments

---------

Co-authored-by: David Ho <[email protected]>
* Reuse computed checkums for async payloads

This is a continuation of #6413 that adds support for checksum reuse on
async payloads.

Additionally, this commit renames references to "ChecksumCache" to
"ChecksumStore".

* Fix cross module issue
* Reuse checksums in legacy signing codepath

This commit adds support for reusing calculated payload checksums over
retries in the legacy (i.e. non-SRA) signing codepaths.

* S3 testing with non-SRA
@dagnir dagnir requested a review from a team as a code owner September 27, 2025 00:01
@dagnir dagnir force-pushed the feature/master/checksum-reuse branch from a152fbb to 4cb9210 Compare September 27, 2025 00:07
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
65.0% Coverage on New Code (required ≥ 80%)
3.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

1 participant