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 @@ -536,11 +536,6 @@ private MethodSpec authSchemeWithEndpointSignerPropertiesMethod() {

method.beginControlFlow("for ($T endpointAuthScheme : endpointAuthSchemes)", EndpointAuthScheme.class);

// Don't include signer properties for auth options that don't match our selected auth scheme
method.beginControlFlow("if (!endpointAuthScheme.schemeId().equals(selectedAuthScheme.authSchemeOption().schemeId()))");
method.addStatement("continue");
method.endControlFlow();

method.addStatement("$T option = selectedAuthScheme.authSchemeOption().toBuilder()", AuthSchemeOption.Builder.class);

if (dependsOnHttpAuthAws) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ private static void operationWithStaticContextParamsStaticContextParams(QueryEnd
private <T extends Identity> SelectedAuthScheme<T> authSchemeWithEndpointSignerProperties(
List<EndpointAuthScheme> endpointAuthSchemes, SelectedAuthScheme<T> selectedAuthScheme) {
for (EndpointAuthScheme endpointAuthScheme : endpointAuthSchemes) {
if (!endpointAuthScheme.schemeId().equals(selectedAuthScheme.authSchemeOption().schemeId())) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @millems for highlighting that not checking this could be an issue for useSraAuth=true client, in a case for example where SelectedAuthScheme=sigv4a, but endpointAuthSchemes=["sigv4","sigv4a"] and the shared signer properties like disableDoubleEncoding have different values from endpoint rules. Without this check, the value from sigv4 EndpointAuthScheme will get used, even though it should use from sigv4a EndpointAuthScheme.

Will address this is separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressing in #4505

continue;
}
AuthSchemeOption.Builder option = selectedAuthScheme.authSchemeOption().toBuilder();
if (endpointAuthScheme instanceof SigV4AuthScheme) {
SigV4AuthScheme v4AuthScheme = (SigV4AuthScheme) endpointAuthScheme;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@
"interceptors": [
"software.amazon.awssdk.services.s3control.internal.interceptors.ConfigureSignerInterceptor",
"software.amazon.awssdk.services.s3control.internal.interceptors.PayloadSigningInterceptor"
],
"useSraAuth": true
]
}