Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

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);

Copy link
Contributor

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.


ContentStreamProvider payload = payloadSigner.sign(request.payload().orElse(null), v4aContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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

// sanitizes the URI path, we need to double check that this behavior it's safe and that it won't break anything else.
// With useSraAuth=test, need to add the forward slash to the endpoint below to make related tests pass.
// private final static URI MULTI_REGION_ENDPOINT =
// URI.create("https://mfzwi23gnjvgw.mrap.accesspoint.s3-global.amazonaws.com/");
private final static URI MULTI_REGION_ENDPOINT =
URI.create("https://mfzwi23gnjvgw.mrap.accesspoint.s3-global.amazonaws.com");
private MockHttpClient mockHttpClient;
Expand Down