-
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
Do not re-use sanitized request when forming signed request #4543
Do not re-use sanitized request when forming signed request #4543
Conversation
e70ecb4
to
ae7c3b5
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.
I'm treating the comments as non-blocking for the release.
@@ -228,7 +228,7 @@ private static SignedRequest doSign(SignRequest<? extends AwsCredentialsIdentity | |||
|
|||
HttpRequest crtRequest = toRequest(sanitizedRequest, request.payload().orElse(null)); | |||
|
|||
V4aContext v4aContext = sign(sanitizedRequest, crtRequest, signingConfig); | |||
V4aContext v4aContext = sign(requestBuilder.build(), crtRequest, signingConfig); |
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.
can we do
SdkHttpRequest.Builder requestBuilder = request.request().toBuilder();
payloadSigner.beforeSigning(requestBuilder, request.payload().orElse(null), signingConfig.getSignedBodyValue());
// The requestBuilder changes should be done now.
SdkHttpRequest requestToSign = requestBuilder.build();
SdkHttpRequest sanitizedRequest = sanitizeRequest(requestToSign);
HttpRequest crtRequest = toRequest(sanitizedRequest, request.payload().orElse(null));
V4aContext v4aContext = sign(requestToSign, crtRequest, signingConfig);
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.
And I know we have the MultiRegionAccessPointEndpointResolutionTest test, but is worth adding a unit test to this module.
@@ -40,11 +40,6 @@ | |||
public class MultiRegionAccessPointEndpointResolutionTest { | |||
|
|||
private final static String MULTI_REGION_ARN = "arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap"; | |||
// TODO(sra-identity-and-auth): The forward slash of the URL below was added to account for the signer behavior that |
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.
you didn't call it out, but I assume you tested this with useSraAuth=true
SonarCloud Quality Gate failed. 9 Bugs 85.5% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
669e269
into
feature/master/sra-identity-auth
Motivation and Context
/
if path is empty, etc)Modifications
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