Skip to content

Commit 86f27e8

Browse files
Merge pull request #817 from aws/staging/16c1575b-cf4b-460d-9d0f-ba6d0777acf9
Pull request: release <- staging/16c1575b-cf4b-460d-9d0f-ba6d0777acf9
2 parents 295f4ba + 9b6d7b7 commit 86f27e8

File tree

283 files changed

+1492
-436
lines changed

Some content is hidden

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

283 files changed

+1492
-436
lines changed

.changes/2.13.4.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.13.4",
3+
"date": "2020-04-27",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "AWS Database Migration Service",
8+
"description": "Adding minimum replication engine version for describe-endpoint-types api."
9+
},
10+
{
11+
"type": "feature",
12+
"category": "AWS SDK for Java v2",
13+
"description": "Various performance improvements."
14+
},
15+
{
16+
"type": "feature",
17+
"category": "AWS SDK for Java v2",
18+
"description": "Updated service endpoint metadata."
19+
},
20+
{
21+
"type": "feature",
22+
"category": "Amazon SageMaker Service",
23+
"description": "Change to the input, ResourceSpec, changing EnvironmentArn to SageMakerImageArn. This affects the following preview APIs: CreateDomain, DescribeDomain, UpdateDomain, CreateUserProfile, DescribeUserProfile, UpdateUserProfile, CreateApp and DescribeApp."
24+
},
25+
{
26+
"type": "feature",
27+
"category": "AWS Data Exchange",
28+
"description": "This release introduces AWS Data Exchange support for configurable encryption parameters when exporting data sets to Amazon S3."
29+
},
30+
{
31+
"type": "feature",
32+
"category": "Access Analyzer",
33+
"description": "This release adds support for inclusion of S3 Access Point policies in IAM Access Analyzer evaluation of S3 bucket access. IAM Access Analyzer now reports findings for buckets shared through access points and identifies the access point that permits access."
34+
}
35+
]
36+
}

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# __2.13.4__ __2020-04-27__
2+
## __AWS Data Exchange__
3+
- ### Features
4+
- This release introduces AWS Data Exchange support for configurable encryption parameters when exporting data sets to Amazon S3.
5+
6+
## __AWS Database Migration Service__
7+
- ### Features
8+
- Adding minimum replication engine version for describe-endpoint-types api.
9+
10+
## __AWS SDK for Java v2__
11+
- ### Features
12+
- Updated service endpoint metadata.
13+
- Various performance improvements.
14+
15+
## __Access Analyzer__
16+
- ### Features
17+
- This release adds support for inclusion of S3 Access Point policies in IAM Access Analyzer evaluation of S3 bucket access. IAM Access Analyzer now reports findings for buckets shared through access points and identifies the access point that permits access.
18+
19+
## __Amazon SageMaker Service__
20+
- ### Features
21+
- Change to the input, ResourceSpec, changing EnvironmentArn to SageMakerImageArn. This affects the following preview APIs: CreateDomain, DescribeDomain, UpdateDomain, CreateUserProfile, DescribeUserProfile, UpdateUserProfile, CreateApp and DescribeApp.
22+
123
# __2.13.3__ __2020-04-24__
224
## __AWS IoT__
325
- ### Features

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To automatically manage module versions (currently all modules have the same ver
4949
<dependency>
5050
<groupId>software.amazon.awssdk</groupId>
5151
<artifactId>bom</artifactId>
52-
<version>2.13.3</version>
52+
<version>2.13.4</version>
5353
<type>pom</type>
5454
<scope>import</scope>
5555
</dependency>
@@ -83,12 +83,12 @@ Alternatively you can add dependencies for the specific services you use only:
8383
<dependency>
8484
<groupId>software.amazon.awssdk</groupId>
8585
<artifactId>ec2</artifactId>
86-
<version>2.13.3</version>
86+
<version>2.13.4</version>
8787
</dependency>
8888
<dependency>
8989
<groupId>software.amazon.awssdk</groupId>
9090
<artifactId>s3</artifactId>
91-
<version>2.13.3</version>
91+
<version>2.13.4</version>
9292
</dependency>
9393
```
9494

@@ -100,7 +100,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
100100
<dependency>
101101
<groupId>software.amazon.awssdk</groupId>
102102
<artifactId>aws-sdk-java</artifactId>
103-
<version>2.13.3</version>
103+
<version>2.13.4</version>
104104
</dependency>
105105
```
106106

archetypes/archetype-lambda/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.3</version>
23+
<version>2.13.4</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetype-lambda</artifactId>

archetypes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.3</version>
23+
<version>2.13.4</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetypes</artifactId>

aws-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.13.3</version>
20+
<version>2.13.4</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>aws-sdk-java</artifactId>

bom-internal/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.3</version>
23+
<version>2.13.4</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.13.3</version>
20+
<version>2.13.4</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>bom</artifactId>

bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.3</version>
24+
<version>2.13.4</version>
2525
</parent>
2626
<artifactId>bundle</artifactId>
2727
<packaging>jar</packaging>

codegen-lite-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.13.3</version>
25+
<version>2.13.4</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.3</version>
24+
<version>2.13.4</version>
2525
</parent>
2626
<artifactId>codegen-lite</artifactId>
2727
<name>AWS Java SDK :: Code Generator Lite</name>

codegen-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.13.3</version>
25+
<version>2.13.4</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-maven-plugin</artifactId>

codegen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.3</version>
24+
<version>2.13.4</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

core/annotations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>core</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.3</version>
23+
<version>2.13.4</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/arns/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>core</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.3</version>
23+
<version>2.13.4</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/auth/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>core</artifactId>
25-
<version>2.13.3</version>
25+
<version>2.13.4</version>
2626
</parent>
2727

2828
<artifactId>auth</artifactId>

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

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.Arrays;
2525
import java.util.List;
2626
import java.util.Map;
27+
import java.util.TreeMap;
2728
import software.amazon.awssdk.annotations.SdkInternalApi;
2829
import software.amazon.awssdk.auth.credentials.AwsCredentials;
2930
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
@@ -75,7 +76,14 @@ protected SdkHttpFullRequest.Builder doSign(SdkHttpFullRequest request,
7576
.filter(h -> h.equals("required"))
7677
.ifPresent(h -> mutableRequest.putHeader(SignerConstant.X_AMZ_CONTENT_SHA256, contentSha256));
7778

78-
String canonicalRequest = createCanonicalRequest(mutableRequest, contentSha256, signingParams.doubleUrlEncode());
79+
Map<String, List<String>> canonicalHeaders = canonicalizeSigningHeaders(mutableRequest.headers());
80+
String signedHeadersString = getSignedHeadersString(canonicalHeaders);
81+
82+
String canonicalRequest = createCanonicalRequest(mutableRequest,
83+
canonicalHeaders,
84+
signedHeadersString,
85+
contentSha256,
86+
signingParams.doubleUrlEncode());
7987

8088
String stringToSign = createStringToSign(canonicalRequest, requestParams);
8189

@@ -84,7 +92,7 @@ protected SdkHttpFullRequest.Builder doSign(SdkHttpFullRequest request,
8492
byte[] signature = computeSignature(stringToSign, signingKey);
8593

8694
mutableRequest.putHeader(SignerConstant.AUTHORIZATION,
87-
buildAuthorizationHeader(signature, sanitizedCredentials, requestParams, mutableRequest));
95+
buildAuthorizationHeader(signature, sanitizedCredentials, requestParams, signedHeadersString));
8896

8997
processRequestPayload(mutableRequest, signature, signingKey, requestParams, signingParams);
9098

@@ -110,11 +118,16 @@ protected SdkHttpFullRequest.Builder doPresign(SdkHttpFullRequest request,
110118
}
111119

112120
// Add the important parameters for v4 signing
113-
addPreSignInformationToRequest(mutableRequest, sanitizedCredentials, requestParams, expirationInSeconds);
121+
Map<String, List<String>> canonicalizedHeaders = canonicalizeSigningHeaders(mutableRequest.headers());
122+
String signedHeadersString = getSignedHeadersString(canonicalizedHeaders);
123+
124+
addPreSignInformationToRequest(mutableRequest, signedHeadersString, sanitizedCredentials,
125+
requestParams, expirationInSeconds);
114126

115127
String contentSha256 = calculateContentHashPresign(mutableRequest, signingParams);
116128

117-
String canonicalRequest = createCanonicalRequest(mutableRequest, contentSha256, signingParams.doubleUrlEncode());
129+
String canonicalRequest = createCanonicalRequest(mutableRequest, canonicalizedHeaders, signedHeadersString,
130+
contentSha256, signingParams.doubleUrlEncode());
118131

119132
String stringToSign = createStringToSign(canonicalRequest, requestParams);
120133

@@ -191,19 +204,20 @@ protected final byte[] deriveSigningKey(AwsCredentials credentials, Instant sign
191204
* generate the canonical request.
192205
*/
193206
private String createCanonicalRequest(SdkHttpFullRequest.Builder request,
207+
Map<String, List<String>> canonicalHeaders,
208+
String signedHeadersString,
194209
String contentSha256,
195210
boolean doubleUrlEncode) {
196-
197211
String canonicalRequest = request.method().toString() +
198212
SignerConstant.LINE_SEPARATOR +
199213
// This would optionally double url-encode the resource path
200214
getCanonicalizedResourcePath(request.encodedPath(), doubleUrlEncode) +
201215
SignerConstant.LINE_SEPARATOR +
202216
getCanonicalizedQueryString(request.rawQueryParameters()) +
203217
SignerConstant.LINE_SEPARATOR +
204-
getCanonicalizedHeaderString(request.headers()) +
218+
getCanonicalizedHeaderString(canonicalHeaders) +
205219
SignerConstant.LINE_SEPARATOR +
206-
getSignedHeadersString(request.headers()) +
220+
signedHeadersString +
207221
SignerConstant.LINE_SEPARATOR +
208222
contentSha256;
209223

@@ -254,12 +268,11 @@ private byte[] computeSignature(String stringToSign, byte[] signingKey) {
254268
private String buildAuthorizationHeader(byte[] signature,
255269
AwsCredentials credentials,
256270
Aws4SignerRequestParams signerParams,
257-
SdkHttpFullRequest.Builder mutableRequest) {
271+
String signedHeadersString) {
258272

259273
String signingCredentials = credentials.accessKeyId() + "/" + signerParams.getScope();
260274
String credential = "Credential=" + signingCredentials;
261-
String signerHeaders = "SignedHeaders=" +
262-
getSignedHeadersString(mutableRequest.headers());
275+
String signerHeaders = "SignedHeaders=" + signedHeadersString;
263276
String signatureHeader = "Signature=" + BinaryUtils.toHex(signature);
264277

265278
return SignerConstant.AWS4_SIGNING_ALGORITHM + " " + credential + ", " + signerHeaders + ", " + signatureHeader;
@@ -269,6 +282,7 @@ private String buildAuthorizationHeader(byte[] signature,
269282
* Includes all the signing headers as request parameters for pre-signing.
270283
*/
271284
private void addPreSignInformationToRequest(SdkHttpFullRequest.Builder mutableRequest,
285+
String signedHeadersString,
272286
AwsCredentials sanitizedCredentials,
273287
Aws4SignerRequestParams signerParams,
274288
long expirationInSeconds) {
@@ -277,34 +291,39 @@ private void addPreSignInformationToRequest(SdkHttpFullRequest.Builder mutableRe
277291

278292
mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_ALGORITHM, SignerConstant.AWS4_SIGNING_ALGORITHM);
279293
mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_DATE, signerParams.getFormattedRequestSigningDateTime());
280-
mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_SIGNED_HEADER,
281-
getSignedHeadersString(mutableRequest.headers()));
282-
mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_EXPIRES,
283-
Long.toString(expirationInSeconds));
294+
mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_SIGNED_HEADER, signedHeadersString);
295+
mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_EXPIRES, Long.toString(expirationInSeconds));
284296
mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_CREDENTIAL, signingCredentials);
285297
}
286298

299+
private Map<String, List<String>> canonicalizeSigningHeaders(Map<String, List<String>> headers) {
300+
Map<String, List<String>> result = new TreeMap<>();
287301

288-
private String getCanonicalizedHeaderString(Map<String, List<String>> headers) {
289-
List<String> sortedHeaders = new ArrayList<>(headers.keySet());
290-
sortedHeaders.sort(String.CASE_INSENSITIVE_ORDER);
291-
292-
StringBuilder buffer = new StringBuilder();
293-
for (String header : sortedHeaders) {
294-
if (shouldExcludeHeaderFromSigning(header)) {
302+
for (Map.Entry<String, List<String>> header : headers.entrySet()) {
303+
String lowerCaseHeader = lowerCase(header.getKey());
304+
if (LIST_OF_HEADERS_TO_IGNORE_IN_LOWER_CASE.contains(lowerCaseHeader)) {
295305
continue;
296306
}
297-
String key = lowerCase(header);
298307

299-
for (String headerValue : headers.get(header)) {
300-
appendCompactedString(buffer, key);
308+
result.computeIfAbsent(lowerCaseHeader, x -> new ArrayList<>()).addAll(header.getValue());
309+
}
310+
311+
return result;
312+
}
313+
314+
private String getCanonicalizedHeaderString(Map<String, List<String>> canonicalizedHeaders) {
315+
StringBuilder buffer = new StringBuilder();
316+
317+
canonicalizedHeaders.forEach((headerName, headerValues) -> {
318+
for (String headerValue : headerValues) {
319+
appendCompactedString(buffer, headerName);
301320
buffer.append(":");
302321
if (headerValue != null) {
303322
appendCompactedString(buffer, headerValue);
304323
}
305324
buffer.append("\n");
306325
}
307-
}
326+
});
308327

309328
return buffer.toString();
310329
}
@@ -350,28 +369,17 @@ private boolean isWhiteSpace(final char ch) {
350369
return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\u000b' || ch == '\r' || ch == '\f';
351370
}
352371

353-
private String getSignedHeadersString(Map<String, List<String>> headers) {
354-
List<String> sortedHeaders = new ArrayList<>(headers.keySet());
355-
sortedHeaders.sort(String.CASE_INSENSITIVE_ORDER);
356-
372+
private String getSignedHeadersString(Map<String, List<String>> canonicalizedHeaders) {
357373
StringBuilder buffer = new StringBuilder();
358-
for (String header : sortedHeaders) {
359-
if (shouldExcludeHeaderFromSigning(header)) {
360-
continue;
361-
}
374+
for (String header : canonicalizedHeaders.keySet()) {
362375
if (buffer.length() > 0) {
363376
buffer.append(";");
364377
}
365-
buffer.append(lowerCase(header));
378+
buffer.append(header);
366379
}
367-
368380
return buffer.toString();
369381
}
370382

371-
private boolean shouldExcludeHeaderFromSigning(String header) {
372-
return LIST_OF_HEADERS_TO_IGNORE_IN_LOWER_CASE.contains(lowerCase(header));
373-
}
374-
375383
private void addHostHeader(SdkHttpFullRequest.Builder mutableRequest) {
376384
// AWS4 requires that we sign the Host header so we
377385
// have to have it in the request by the time we sign.

0 commit comments

Comments
 (0)