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
@dagnir dagnir changed the title Merge eature/master/checksum-reuse Merge feature/master/checksum-reuse Sep 29, 2025
This doesn't correspond to a flexible checksum value, so this is not
required.
@dagnir dagnir added the api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team label Sep 30, 2025
Copy link
Contributor

@millems millems left a comment

Choose a reason for hiding this comment

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

Commits already reviewed individually by others.

@dagnir dagnir enabled auto-merge September 30, 2025 20:26
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@dagnir dagnir added this pull request to the merge queue Sep 30, 2025
Merged via the queue into master with commit fd6b4a2 Sep 30, 2025
37 of 38 checks passed
Copy link

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants