-
Notifications
You must be signed in to change notification settings - Fork 943
Reuse computed checksums across retries #6413
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
Reuse computed checksums across retries #6413
Conversation
731a921
to
344a525
Compare
344a525
to
1754544
Compare
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`.
1754544
to
2412e29
Compare
...software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSignerTest.java
Outdated
Show resolved
Hide resolved
...software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSignerTest.java
Outdated
Show resolved
Hide resolved
...software/amazon/awssdk/http/auth/aws/crt/internal/signer/DefaultAwsCrtV4aHttpSignerTest.java
Outdated
Show resolved
Hide resolved
...re/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/SigningStage.java
Outdated
Show resolved
Hide resolved
…al/http/pipeline/stages/SigningStage.java Co-authored-by: David Ho <[email protected]>
*/ | ||
@SdkInternalApi | ||
@SuppressWarnings("deprecation") | ||
public class LegacyPayloadChecksumCache { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add cache for legacy path, i.e., customers using legacy custom signers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good callout. Actually nothing is using this class for now. I will follow up with another PR for legacy.
|
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. |
Motivation and Context
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 newSignerProperty
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 ofhttp-auth-spi
.Finally, this adds a dependency on
checksums-spi
forhttp-auth-spi
.Note: this PR only adds support in the sync codepath. Will follow up with async (merging to a feature branch).
Modifications
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License