-
Notifications
You must be signed in to change notification settings - Fork 853
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
Add flexible checksum support for chunked-encoding cases #4383
Add flexible checksum support for chunked-encoding cases #4383
Conversation
|
||
public AwsChunkedV4PayloadSigner(CredentialScope credentialScope, int chunkSize) { | ||
public AwsChunkedV4PayloadSigner(CredentialScope credentialScope, int chunkSize, ChecksumAlgorithm checksumAlgorithm) { |
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.
Will change this to a builder.
eb70caa
to
3124558
Compare
credentialScope.getDatetime(), | ||
credentialScope.scope(), | ||
previousSignature, | ||
toHex(hash(getCanonicalHeadersString(getCanonicalHeaders(headers)))) |
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.
Chained methods are a bit hard to read, can we create variables?
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.
Sure, I'll break it up
* <p> | ||
* The checksum-algorithm MUST be set if this is called, otherwise it will throw. | ||
*/ | ||
private void setupChecksumTrailer(ChunkedEncodedInputStream.Builder builder, SdkHttpRequest.Builder request) { |
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.
Maybe we can rename it to setUpChecksumTrailerIfNeeded
and return if checksumAlgorithm is null? Then we can remove the checksumAlgorithm null check from the callers
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.
Sure, if that's an established naming pattern, I can do that
f5a1a44
to
fec7712
Compare
public interface Builder { | ||
Builder credentialScope(CredentialScope credentialScope); | ||
|
||
Builder chunkSize(int chunkSize); |
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.
Should probably be boxed type so that we can throw an exception or set a default if the caller doesn't set it.
SonarCloud Quality Gate failed. 5 Bugs 0.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
8f7070b
into
feature/master/sra-identity-auth
Motivation and Context
Modifications
AwsChunkedEncodedInputStream
to take a checksum-algorithm parameterTypes 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