Skip to content

Commit 5d37010

Browse files
committed
Moved internal auth classes to internal package.
1 parent 7bb4b34 commit 5d37010

File tree

29 files changed

+119
-72
lines changed

29 files changed

+119
-72
lines changed

auth/src/main/java/software/amazon/awssdk/auth/credentials/ContainerCredentialsProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
import java.util.Set;
2929
import software.amazon.awssdk.annotations.SdkPublicApi;
3030
import software.amazon.awssdk.annotations.SdkTestInternalApi;
31+
import software.amazon.awssdk.auth.credentials.internal.ContainerCredentialsRetryPolicy;
32+
import software.amazon.awssdk.auth.credentials.internal.HttpCredentialsProvider;
3133
import software.amazon.awssdk.core.SdkSystemSetting;
3234
import software.amazon.awssdk.core.exception.SdkClientException;
3335
import software.amazon.awssdk.regions.internal.util.ResourcesEndpointProvider;

auth/src/main/java/software/amazon/awssdk/auth/util/CredentialUtils.java renamed to auth/src/main/java/software/amazon/awssdk/auth/credentials/CredentialUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.auth.util;
16+
package software.amazon.awssdk.auth.credentials;
1717

1818
import software.amazon.awssdk.annotations.SdkProtectedApi;
19-
import software.amazon.awssdk.auth.credentials.AwsCredentials;
2019

2120
@SdkProtectedApi
2221
public final class CredentialUtils {

auth/src/main/java/software/amazon/awssdk/auth/credentials/EnvironmentVariableCredentialsProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.util.Optional;
1919
import software.amazon.awssdk.annotations.SdkPublicApi;
20+
import software.amazon.awssdk.auth.credentials.internal.SystemSettingsCredentialsProvider;
2021
import software.amazon.awssdk.utils.SystemSetting;
2122
import software.amazon.awssdk.utils.ToString;
2223

auth/src/main/java/software/amazon/awssdk/auth/credentials/InstanceProfileCredentialsProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.io.IOException;
1919
import java.net.URI;
2020
import software.amazon.awssdk.annotations.SdkPublicApi;
21+
import software.amazon.awssdk.auth.credentials.internal.HttpCredentialsProvider;
2122
import software.amazon.awssdk.core.SdkSystemSetting;
2223
import software.amazon.awssdk.core.exception.SdkClientException;
2324
import software.amazon.awssdk.regions.internal.util.HttpResourcesUtils;

auth/src/main/java/software/amazon/awssdk/auth/credentials/SystemPropertyCredentialsProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.util.Optional;
1919
import software.amazon.awssdk.annotations.SdkPublicApi;
20+
import software.amazon.awssdk.auth.credentials.internal.SystemSettingsCredentialsProvider;
2021
import software.amazon.awssdk.utils.SystemSetting;
2122
import software.amazon.awssdk.utils.ToString;
2223

auth/src/main/java/software/amazon/awssdk/auth/credentials/ContainerCredentialsRetryPolicy.java renamed to auth/src/main/java/software/amazon/awssdk/auth/credentials/internal/ContainerCredentialsRetryPolicy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.auth.credentials;
16+
package software.amazon.awssdk.auth.credentials.internal;
1717

1818
import java.io.IOException;
1919
import software.amazon.awssdk.annotations.SdkInternalApi;
@@ -22,7 +22,7 @@
2222
import software.amazon.awssdk.regions.internal.util.ResourcesEndpointRetryPolicy;
2323

2424
@SdkInternalApi
25-
final class ContainerCredentialsRetryPolicy implements ResourcesEndpointRetryPolicy {
25+
public final class ContainerCredentialsRetryPolicy implements ResourcesEndpointRetryPolicy {
2626

2727
/** Max number of times a request is retried before failing. */
2828
private static final int MAX_RETRIES = 5;

auth/src/main/java/software/amazon/awssdk/auth/credentials/HttpCredentialsProvider.java renamed to auth/src/main/java/software/amazon/awssdk/auth/credentials/internal/HttpCredentialsProvider.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.auth.credentials;
16+
package software.amazon.awssdk.auth.credentials.internal;
1717

1818
import com.fasterxml.jackson.databind.JsonMappingException;
1919
import com.fasterxml.jackson.databind.JsonNode;
@@ -22,6 +22,10 @@
2222
import java.time.Instant;
2323
import java.util.Optional;
2424
import software.amazon.awssdk.annotations.SdkInternalApi;
25+
import software.amazon.awssdk.auth.credentials.AwsCredentials;
26+
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
27+
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
28+
import software.amazon.awssdk.auth.credentials.InstanceProfileCredentialsProvider;
2529
import software.amazon.awssdk.core.exception.SdkClientException;
2630
import software.amazon.awssdk.core.util.ComparableUtils;
2731
import software.amazon.awssdk.core.util.DateUtils;
@@ -39,10 +43,10 @@
3943
* a container (e.g. an EC2 instance).
4044
*/
4145
@SdkInternalApi
42-
abstract class HttpCredentialsProvider implements AwsCredentialsProvider, SdkAutoCloseable {
46+
public abstract class HttpCredentialsProvider implements AwsCredentialsProvider, SdkAutoCloseable {
4347
private final Optional<CachedSupplier<AwsCredentials>> credentialsCache;
4448

45-
HttpCredentialsProvider(Builder<?, ?> builder) {
49+
protected HttpCredentialsProvider(Builder<?, ?> builder) {
4650
this(builder.asyncCredentialUpdateEnabled, builder.asyncThreadName);
4751
}
4852

@@ -83,7 +87,7 @@ private RefreshResult<AwsCredentials> refreshCredentials() {
8387
Validate.notNull(secretKey, "Failed to load secret key.");
8488

8589
AwsCredentials credentials =
86-
token == null ? new AwsCredentials(accessKey.asText(), secretKey.asText())
90+
token == null ? AwsCredentials.create(accessKey.asText(), secretKey.asText())
8791
: AwsSessionCredentials.create(accessKey.asText(), secretKey.asText(), token.asText());
8892

8993
Instant expiration = getExpiration(expirationNode).orElse(null);

auth/src/main/java/software/amazon/awssdk/auth/credentials/SystemSettingsCredentialsProvider.java renamed to auth/src/main/java/software/amazon/awssdk/auth/credentials/internal/SystemSettingsCredentialsProvider.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.auth.credentials;
16+
package software.amazon.awssdk.auth.credentials.internal;
1717

1818
import static software.amazon.awssdk.utils.StringUtils.trim;
1919

2020
import java.util.Optional;
2121
import software.amazon.awssdk.annotations.SdkInternalApi;
22+
import software.amazon.awssdk.auth.credentials.AwsCredentials;
23+
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
24+
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
25+
import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;
26+
import software.amazon.awssdk.auth.credentials.SystemPropertyCredentialsProvider;
2227
import software.amazon.awssdk.core.SdkSystemSetting;
2328
import software.amazon.awssdk.core.exception.SdkClientException;
2429
import software.amazon.awssdk.utils.StringUtils;
@@ -36,7 +41,7 @@
3641
* @see SystemPropertyCredentialsProvider
3742
*/
3843
@SdkInternalApi
39-
abstract class SystemSettingsCredentialsProvider implements AwsCredentialsProvider {
44+
public abstract class SystemSettingsCredentialsProvider implements AwsCredentialsProvider {
4045
@Override
4146
public AwsCredentials getCredentials() {
4247
String accessKey = trim(loadSetting(SdkSystemSetting.AWS_ACCESS_KEY_ID).orElse(null));

auth/src/main/java/software/amazon/awssdk/auth/signer/AbstractAws4Signer.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.slf4j.Logger;
3131
import org.slf4j.LoggerFactory;
3232
import software.amazon.awssdk.annotations.SdkProtectedApi;
33-
import software.amazon.awssdk.auth.AwsExecutionAttribute;
3433
import software.amazon.awssdk.auth.credentials.AwsCredentials;
3534
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
3635
import software.amazon.awssdk.auth.signer.internal.AbstractAwsSigner;
@@ -409,20 +408,20 @@ private byte[] newSigningKey(AwsCredentials credentials,
409408
protected <B extends Aws4PresignerParams.Builder> B extractPresignerParams(B builder,
410409
ExecutionAttributes executionAttributes) {
411410
builder = extractSignerParams(builder, executionAttributes);
412-
builder.expirationTime(executionAttributes.getAttribute(AwsExecutionAttribute.PRESIGNER_EXPIRATION));
411+
builder.expirationTime(executionAttributes.getAttribute(AwsSignerExecutionAttribute.PRESIGNER_EXPIRATION));
413412

414413
return builder;
415414
}
416415

417416
protected <B extends Aws4SignerParams.Builder> B extractSignerParams(B paramsBuilder,
418417
ExecutionAttributes executionAttributes) {
419-
paramsBuilder.awsCredentials(executionAttributes.getAttribute(AwsExecutionAttribute.AWS_CREDENTIALS))
420-
.signingName(executionAttributes.getAttribute(AwsExecutionAttribute.SERVICE_SIGNING_NAME))
421-
.signingRegion(executionAttributes.getAttribute(AwsExecutionAttribute.SIGNING_REGION))
422-
.timeOffset(executionAttributes.getAttribute(AwsExecutionAttribute.TIME_OFFSET));
418+
paramsBuilder.awsCredentials(executionAttributes.getAttribute(AwsSignerExecutionAttribute.AWS_CREDENTIALS))
419+
.signingName(executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_SIGNING_NAME))
420+
.signingRegion(executionAttributes.getAttribute(AwsSignerExecutionAttribute.SIGNING_REGION))
421+
.timeOffset(executionAttributes.getAttribute(AwsSignerExecutionAttribute.TIME_OFFSET));
423422

424-
if (executionAttributes.getAttribute(AwsExecutionAttribute.SIGNER_DOUBLE_URL_ENCODE) != null) {
425-
paramsBuilder.doubleUrlEncode(executionAttributes.getAttribute(AwsExecutionAttribute.SIGNER_DOUBLE_URL_ENCODE));
423+
if (executionAttributes.getAttribute(AwsSignerExecutionAttribute.SIGNER_DOUBLE_URL_ENCODE) != null) {
424+
paramsBuilder.doubleUrlEncode(executionAttributes.getAttribute(AwsSignerExecutionAttribute.SIGNER_DOUBLE_URL_ENCODE));
426425
}
427426

428427
return paramsBuilder;

auth/src/main/java/software/amazon/awssdk/auth/signer/Aws4Signer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
package software.amazon.awssdk.auth.signer;
1717

1818
import software.amazon.awssdk.annotations.SdkPublicApi;
19+
import software.amazon.awssdk.auth.credentials.CredentialUtils;
1920
import software.amazon.awssdk.auth.signer.internal.Aws4SignerRequestParams;
2021
import software.amazon.awssdk.auth.signer.params.Aws4PresignerParams;
2122
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
22-
import software.amazon.awssdk.auth.util.CredentialUtils;
2323
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
2424
import software.amazon.awssdk.http.SdkHttpFullRequest;
2525

auth/src/main/java/software/amazon/awssdk/auth/AwsExecutionAttribute.java renamed to auth/src/main/java/software/amazon/awssdk/auth/signer/AwsSignerExecutionAttribute.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.auth;
16+
package software.amazon.awssdk.auth.signer;
1717

1818
import java.time.Instant;
1919
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
@@ -26,27 +26,21 @@
2626
import software.amazon.awssdk.regions.Region;
2727

2828
/**
29-
* AWS-specific attributes attached to the execution. This information is available to {@link ExecutionInterceptor}s and
29+
* AWS-specific signing attributes attached to the execution. This information is available to {@link ExecutionInterceptor}s and
3030
* {@link Signer}s.
3131
*/
3232
@ReviewBeforeRelease("We should also consider making some of the SDK/AWS-owned set of attributes part of the immutable context"
3333
+ "if we don't want the interceptors to modify them.")
3434
@SdkProtectedApi
35-
public final class AwsExecutionAttribute extends SdkExecutionAttribute {
35+
public final class AwsSignerExecutionAttribute extends SdkExecutionAttribute {
3636
/**
3737
* The key under which the request credentials are set.
3838
*/
3939
public static final ExecutionAttribute<AwsCredentials> AWS_CREDENTIALS = new ExecutionAttribute<>("AwsCredentials");
4040

4141
/**
42-
* The AWS {@link Region} the client was configured with. This is not always same as {@link #SIGNING_REGION} for
43-
* global services like IAM.
44-
*/
45-
public static final ExecutionAttribute<Region> AWS_REGION = new ExecutionAttribute<>("AwsRegion");
46-
47-
/**
48-
* The AWS {@link Region} that is used for signing a request. This is not always same as {@link #AWS_REGION} for
49-
* global services like IAM.
42+
* The AWS {@link Region} that is used for signing a request. This is not always same as the region configured on the client
43+
* for global services like IAM.
5044
*/
5145
public static final ExecutionAttribute<Region> SIGNING_REGION = new ExecutionAttribute<>("SigningRegion");
5246

@@ -65,6 +59,6 @@ public final class AwsExecutionAttribute extends SdkExecutionAttribute {
6559
*/
6660
public static final ExecutionAttribute<Instant> PRESIGNER_EXPIRATION = new ExecutionAttribute<>("PresignerExpiration");
6761

68-
private AwsExecutionAttribute() {
62+
private AwsSignerExecutionAttribute() {
6963
}
7064
}

auth/src/main/java/software/amazon/awssdk/auth/signer/QueryStringSigner.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
import java.util.Date;
2121
import java.util.TimeZone;
2222
import software.amazon.awssdk.annotations.SdkProtectedApi;
23-
import software.amazon.awssdk.auth.AwsExecutionAttribute;
2423
import software.amazon.awssdk.auth.credentials.AwsCredentials;
2524
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
25+
import software.amazon.awssdk.auth.credentials.CredentialUtils;
2626
import software.amazon.awssdk.auth.signer.internal.AbstractAwsSigner;
27-
import software.amazon.awssdk.auth.util.CredentialUtils;
2827
import software.amazon.awssdk.core.exception.SdkClientException;
2928
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
3029
import software.amazon.awssdk.http.SdkHttpFullRequest;
@@ -66,8 +65,8 @@ public static QueryStringSigner create() {
6665
*/
6766
@Override
6867
public SdkHttpFullRequest sign(SdkHttpFullRequest request, ExecutionAttributes executionAttributes) {
69-
final AwsCredentials awsCredentials = executionAttributes.getAttribute(AwsExecutionAttribute.AWS_CREDENTIALS);
70-
final Integer offset = executionAttributes.getAttribute(AwsExecutionAttribute.TIME_OFFSET);
68+
final AwsCredentials awsCredentials = executionAttributes.getAttribute(AwsSignerExecutionAttribute.AWS_CREDENTIALS);
69+
final Integer offset = executionAttributes.getAttribute(AwsSignerExecutionAttribute.TIME_OFFSET);
7170

7271
// anonymous credentials, don't sign
7372
if (CredentialUtils.isAnonymous(awsCredentials)) {

auth/src/main/java/software/amazon/awssdk/auth/signer/SigningAlgorithm.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
import java.security.NoSuchAlgorithmException;
1919
import javax.crypto.Mac;
20-
import software.amazon.awssdk.annotations.SdkInternalApi;
20+
import software.amazon.awssdk.annotations.SdkProtectedApi;
2121
import software.amazon.awssdk.core.exception.SdkClientException;
2222

23-
@SdkInternalApi
23+
@SdkProtectedApi
2424
public enum SigningAlgorithm {
2525

2626
HmacSHA256;

auth/src/test/java/software/amazon/awssdk/auth/credentials/ContainerCredentialsRetryPolicyTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.IOException;
2222
import org.junit.BeforeClass;
2323
import org.junit.Test;
24+
import software.amazon.awssdk.auth.credentials.internal.ContainerCredentialsRetryPolicy;
2425
import software.amazon.awssdk.regions.internal.util.ResourcesEndpointRetryParameters;
2526

2627
public class ContainerCredentialsRetryPolicyTest {

auth/src/test/java/software/amazon/awssdk/auth/credentials/HttpCredentialsProviderTest.java renamed to auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/HttpCredentialsProviderTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.auth.credentials;
16+
package software.amazon.awssdk.auth.credentials.internal;
1717

1818
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
1919
import static com.github.tomakehurst.wiremock.client.WireMock.get;
@@ -33,6 +33,7 @@
3333
import org.junit.BeforeClass;
3434
import org.junit.ClassRule;
3535
import org.junit.Test;
36+
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
3637
import software.amazon.awssdk.core.exception.SdkClientException;
3738
import software.amazon.awssdk.core.util.DateUtils;
3839
import software.amazon.awssdk.regions.internal.util.ResourcesEndpointProvider;

auth/src/test/java/software/amazon/awssdk/auth/signer/QueryStringSignerTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.util.TimeZone;
2727
import org.junit.BeforeClass;
2828
import org.junit.Test;
29-
import software.amazon.awssdk.auth.AwsExecutionAttribute;
3029
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
3130
import software.amazon.awssdk.auth.credentials.AwsCredentials;
3231
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
@@ -94,6 +93,6 @@ private void assertSignature(String expected,
9493
}
9594

9695
private ExecutionAttributes constructAttributes(AwsCredentials awsCredentials) {
97-
return new ExecutionAttributes().putAttribute(AwsExecutionAttribute.AWS_CREDENTIALS, awsCredentials);
96+
return new ExecutionAttributes().putAttribute(AwsSignerExecutionAttribute.AWS_CREDENTIALS, awsCredentials);
9897
}
9998
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
package software.amazon.awssdk.awscore;
17+
18+
import software.amazon.awssdk.annotations.SdkProtectedApi;
19+
import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute;
20+
import software.amazon.awssdk.core.interceptor.ExecutionAttribute;
21+
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
22+
import software.amazon.awssdk.core.interceptor.SdkExecutionAttribute;
23+
import software.amazon.awssdk.regions.Region;
24+
25+
/**
26+
* AWS-specific attributes attached to the execution. This information is available to {@link ExecutionInterceptor}s.
27+
*/
28+
@SdkProtectedApi
29+
public final class AwsExecutionAttribute extends SdkExecutionAttribute {
30+
/**
31+
* The AWS {@link Region} the client was configured with. This is not always same as the
32+
* {@link AwsSignerExecutionAttribute#SIGNING_REGION} for global services like IAM.
33+
*/
34+
public static final ExecutionAttribute<Region> AWS_REGION = new ExecutionAttribute<>("AwsRegion");
35+
36+
private AwsExecutionAttribute() {}
37+
}

aws-core/src/main/java/software/amazon/awssdk/awscore/interceptor/GlobalServiceExecutionInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import java.net.UnknownHostException;
1919
import software.amazon.awssdk.annotations.SdkProtectedApi;
20-
import software.amazon.awssdk.auth.AwsExecutionAttribute;
20+
import software.amazon.awssdk.awscore.AwsExecutionAttribute;
2121
import software.amazon.awssdk.core.exception.SdkClientException;
2222
import software.amazon.awssdk.core.interceptor.Context;
2323
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;

aws-core/src/main/java/software/amazon/awssdk/awscore/internal/client/handler/AwsClientHandlerUtils.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
package software.amazon.awssdk.awscore.internal.client.handler;
1717

1818
import software.amazon.awssdk.annotations.SdkInternalApi;
19-
import software.amazon.awssdk.auth.AwsExecutionAttribute;
2019
import software.amazon.awssdk.auth.credentials.AwsCredentials;
2120
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
21+
import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute;
22+
import software.amazon.awssdk.awscore.AwsExecutionAttribute;
2223
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
2324
import software.amazon.awssdk.awscore.client.config.AwsAdvancedClientOption;
2425
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
@@ -54,16 +55,16 @@ public static ExecutionContext createExecutionContext(SdkRequest originalRequest
5455
Validate.validState(credentials != null, "Credential providers must never return null.");
5556

5657
ExecutionAttributes executionAttributes = new ExecutionAttributes()
57-
.putAttribute(AwsExecutionAttribute.SERVICE_CONFIG, clientConfig.option(SdkClientOption.SERVICE_CONFIGURATION))
58-
.putAttribute(AwsExecutionAttribute.AWS_CREDENTIALS, credentials)
59-
.putAttribute(AwsExecutionAttribute.REQUEST_CONFIG, originalRequest.overrideConfiguration()
60-
.map(c -> (RequestOverrideConfiguration) c)
61-
.orElse(AwsRequestOverrideConfiguration.builder()
62-
.build()))
63-
.putAttribute(AwsExecutionAttribute.SERVICE_SIGNING_NAME,
58+
.putAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG, clientConfig.option(SdkClientOption.SERVICE_CONFIGURATION))
59+
.putAttribute(AwsSignerExecutionAttribute.AWS_CREDENTIALS, credentials)
60+
.putAttribute(AwsSignerExecutionAttribute.REQUEST_CONFIG,
61+
originalRequest.overrideConfiguration()
62+
.map(c -> (RequestOverrideConfiguration) c)
63+
.orElse(AwsRequestOverrideConfiguration.builder().build()))
64+
.putAttribute(AwsSignerExecutionAttribute.SERVICE_SIGNING_NAME,
6465
clientConfig.option(AwsClientOption.SERVICE_SIGNING_NAME))
6566
.putAttribute(AwsExecutionAttribute.AWS_REGION, clientConfig.option(AwsClientOption.AWS_REGION))
66-
.putAttribute(AwsExecutionAttribute.SIGNING_REGION, clientConfig.option(AwsClientOption.SIGNING_REGION));
67+
.putAttribute(AwsSignerExecutionAttribute.SIGNING_REGION, clientConfig.option(AwsClientOption.SIGNING_REGION));
6768

6869
ExecutionInterceptorChain executionInterceptorChain =
6970
new ExecutionInterceptorChain(clientConfig.option(SdkClientOption.EXECUTION_INTERCEPTORS));

0 commit comments

Comments
 (0)