-
Notifications
You must be signed in to change notification settings - Fork 926
Support async V4 payload signing #6314
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
base: master
Are you sure you want to change the base?
Conversation
4085d5e
to
8a30699
Compare
f80adb0
to
9fa0bad
Compare
"4000" + CRLF + contentString.substring(0, 16 * KB) + CRLF | ||
+ "4000" + CRLF + contentString.substring(16 * KB, 32 * KB) + CRLF | ||
+ "1400" + CRLF + contentString.substring(32 * KB) + CRLF |
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.
FYI this is because we use the default chunk size in DefaultAwsV4HttpSigner
now, which is 128 KiB, so the 37KiB payload fits in a single chunk:
Line 53 in 43f262c
private static final int DEFAULT_CHUNK_SIZE_IN_BYTES = 128 * 1024; |
if (protocol == Protocol.HTTP && clientType == ClientType.SYNC) { | ||
void verifyPutObjectHeaders(Protocol protocol, ChecksumAlgorithm checksumAlgorithm) { | ||
String streamingSha256; | ||
if (protocol == Protocol.HTTP) { |
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.
Fallback to body content signing now works for async requests
9fa0bad
to
395a9cb
Compare
This commit adds support for SigV4 signing of async request payloads. In addition this commit moves the support for trailing checksums from HttpChecksumStage to the V4 signer implementation; this puts it in line with how sync chunked bodies are already handled.
395a9cb
to
7c7941c
Compare
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.
Is there a performance regression risk for customers that have been using http to avoid tls overhead?
...c/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/DefaultAwsV4HttpSigner.java
Show resolved
Hide resolved
...tware/amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPayload.java
Show resolved
Hide resolved
...ain/java/software/amazon/awssdk/http/auth/aws/internal/signer/AwsChunkedV4PayloadSigner.java
Outdated
Show resolved
Hide resolved
...ain/java/software/amazon/awssdk/http/auth/aws/internal/signer/AwsChunkedV4PayloadSigner.java
Show resolved
Hide resolved
...va/software/amazon/awssdk/http/auth/aws/internal/signer/io/UnbufferedChecksumSubscriber.java
Outdated
Show resolved
Hide resolved
...aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/util/SignerUtils.java
Outdated
Show resolved
Hide resolved
Yes, this is probably true, but this is a functionality gap rather than a feature, so I think this is okay. I don't have concrete numbers, but I will start some long running tests to see. |
...tware/amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPayload.java
Outdated
Show resolved
Hide resolved
- Rename to computeAndMoveContentLength - Rename variable to chunkedPayload - Fix javadocs - Sign payload only if non-null
0a7ec87
to
a222719
Compare
Motivation and Context
This commit adds support for SigV4 signing of async request payloads.
In addition this commit moves the support for trailing checksums from HttpChecksumStage to the V4 signer implementation; this puts it in line with how sync chunked bodies are already handled.
This fills a gap in our signing logic where payloads that would normally be signed are not.
Modifications
HttpChecksumStage
; trailing checksums taken care of inAwsChunkedV4PayloadSigner
, same as for sync payloadsAwsChunkedV4PayloadSigner
AwschunkedV4PayloadSigner
to reduce code duplicationTesting
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