Skip to content

Commit da2ff54

Browse files
committed
Signer Refactor
1 parent a4e299a commit da2ff54

File tree

65 files changed

+2021
-1335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2021
-1335
lines changed

auth/src/main/java/software/amazon/awssdk/auth/AwsExecutionAttributes.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515

1616
package software.amazon.awssdk.auth;
1717

18+
import java.util.Date;
1819
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
1920
import software.amazon.awssdk.auth.credentials.AwsCredentials;
2021
import software.amazon.awssdk.core.interceptor.ExecutionAttribute;
2122
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
2223
import software.amazon.awssdk.core.interceptor.SdkExecutionAttributes;
23-
import software.amazon.awssdk.core.runtime.auth.Signer;
24+
import software.amazon.awssdk.core.signer.Signer;
2425
import software.amazon.awssdk.regions.Region;
2526

2627
/**
@@ -36,10 +37,33 @@ public final class AwsExecutionAttributes extends SdkExecutionAttributes {
3637
public static final ExecutionAttribute<AwsCredentials> AWS_CREDENTIALS = new ExecutionAttribute<>("AwsCredentials");
3738

3839
/**
39-
* The AWS {@link Region} the client was configured with.
40+
* The AWS {@link Region} the client was configured with. This is not always same as {@link #SIGNING_REGION} for
41+
* global services like IAM.
4042
*/
4143
public static final ExecutionAttribute<Region> AWS_REGION = new ExecutionAttribute<>("AwsRegion");
4244

45+
/**
46+
* The AWS {@link Region} that is used for signing a request. This is not always same as {@link #AWS_REGION} for
47+
* global services like IAM.
48+
*/
49+
public static final ExecutionAttribute<Region> SIGNING_REGION = new ExecutionAttribute<>("SigningRegion");
50+
51+
/**
52+
* The signing name of the service to be using in SigV4 signing
53+
*/
54+
public static final ExecutionAttribute<String> SERVICE_SIGNING_NAME = new ExecutionAttribute<>("ServiceSigningName");
55+
56+
/**
57+
* The key to specify whether to use double url encoding during signing.
58+
*/
59+
public static final ExecutionAttribute<Boolean> SIGNER_DOUBLE_URL_ENCODE = new ExecutionAttribute<>("DoubleUrlEncode");
60+
61+
/**
62+
* The key to specify the expiration date when pre-signing aws requests.
63+
*/
64+
public static final ExecutionAttribute<Date> AWS_PRESIGNER_EXPIRATION_DATE =
65+
new ExecutionAttribute<>("PresignerExpirationDate");
66+
4367
private AwsExecutionAttributes() {
4468
}
4569
}

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

Lines changed: 0 additions & 26 deletions
This file was deleted.

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

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@
3333
import software.amazon.awssdk.annotations.ReviewBeforeRelease;
3434
import software.amazon.awssdk.auth.credentials.AwsCredentials;
3535
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
36-
import software.amazon.awssdk.auth.signer.internal.Aws4SignerRequestParams;
3736
import software.amazon.awssdk.core.RequestClientOptions;
3837
import software.amazon.awssdk.core.exception.SdkClientException;
39-
import software.amazon.awssdk.core.runtime.auth.Signer;
4038
import software.amazon.awssdk.core.runtime.io.SdkDigestInputStream;
39+
import software.amazon.awssdk.core.signer.Signer;
4140
import software.amazon.awssdk.http.SdkHttpFullRequest;
4241
import software.amazon.awssdk.utils.Base64Utils;
4342
import software.amazon.awssdk.utils.BinaryUtils;
@@ -239,7 +238,7 @@ protected String getCanonicalizedQueryString(Map<String, List<String>> parameter
239238
}
240239

241240
@ReviewBeforeRelease("Do we still want to make read limit user-configurable as in V1?")
242-
protected static int getReadLimit(Aws4SignerRequestParams signerRequestParams) {
241+
protected static int getReadLimit() {
243242
return RequestClientOptions.DEFAULT_STREAM_BUFFER_SIZE;
244243

245244
}

0 commit comments

Comments
 (0)