Skip to content

Commit

Permalink
Merge pull request #1575 from aws/staging/94db3824-6397-44c3-a4a3-b44…
Browse files Browse the repository at this point in the history
…e3fef2bf8

Pull request: release <- staging/94db3824-6397-44c3-a4a3-b44e3fef2bf8
  • Loading branch information
aws-sdk-java-automation authored Jul 29, 2021
2 parents 77be8cd + f8e452e commit 61d94ed
Show file tree
Hide file tree
Showing 338 changed files with 948 additions and 436 deletions.
48 changes: 48 additions & 0 deletions .changes/2.17.8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"version": "2.17.8",
"date": "2021-07-29",
"entries": [
{
"type": "feature",
"category": "AWS IoT",
"contributor": "",
"description": "Increase maximum credential duration of role alias to 12 hours."
},
{
"type": "feature",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Updated service endpoint metadata."
},
{
"type": "feature",
"category": "Amazon Elastic Compute Cloud",
"contributor": "",
"description": "This release adds support for G4ad xlarge and 2xlarge instances powered by AMD Radeon Pro V520 GPUs and AMD 2nd Generation EPYC processors"
},
{
"type": "bugfix",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Correctly handle multi-value headers in Aws4Signer"
},
{
"type": "feature",
"category": "Amazon Chime",
"contributor": "",
"description": "Adds support for live transcription of meetings with Amazon Transcribe and Amazon Transcribe Medical. The new APIs, StartMeetingTranscription and StopMeetingTranscription, control the generation of user-attributed transcriptions sent to meeting clients via Amazon Chime SDK data messages."
},
{
"type": "feature",
"category": "AWS Savings Plans",
"contributor": "",
"description": "Documentation update for valid Savings Plans offering ID pattern"
},
{
"type": "feature",
"category": "AWS IoT SiteWise",
"contributor": "",
"description": "Added support for AWS IoT SiteWise Edge. You can now create an AWS IoT SiteWise gateway that runs on AWS IoT Greengrass V2. With the gateway, you can collect local server and equipment data, process the data, and export the selected data from the edge to the AWS Cloud."
}
]
}
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# __2.17.8__ __2021-07-29__
## __AWS IoT__
- ### Features
- Increase maximum credential duration of role alias to 12 hours.

## __AWS IoT SiteWise__
- ### Features
- Added support for AWS IoT SiteWise Edge. You can now create an AWS IoT SiteWise gateway that runs on AWS IoT Greengrass V2. With the gateway, you can collect local server and equipment data, process the data, and export the selected data from the edge to the AWS Cloud.

## __AWS SDK for Java v2__
- ### Features
- Updated service endpoint metadata.

- ### Bugfixes
- Correctly handle multi-value headers in Aws4Signer

## __AWS Savings Plans__
- ### Features
- Documentation update for valid Savings Plans offering ID pattern

## __Amazon Chime__
- ### Features
- Adds support for live transcription of meetings with Amazon Transcribe and Amazon Transcribe Medical. The new APIs, StartMeetingTranscription and StopMeetingTranscription, control the generation of user-attributed transcriptions sent to meeting clients via Amazon Chime SDK data messages.

## __Amazon Elastic Compute Cloud__
- ### Features
- This release adds support for G4ad xlarge and 2xlarge instances powered by AMD Radeon Pro V520 GPUs and AMD 2nd Generation EPYC processors

# __2.17.7__ __2021-07-28__
## __AWS CloudFormation__
- ### Features
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To automatically manage module versions (currently all modules have the same ver
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -86,12 +86,12 @@ Alternatively you can add dependencies for the specific services you use only:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ec2</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
</dependency>
```

Expand All @@ -103,7 +103,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-app-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-lambda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetype-lambda</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetypes</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>aws-sdk-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<artifactId>bundle</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-lite-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<artifactId>codegen-lite</artifactId>
<name>AWS Java SDK :: Code Generator Lite</name>
Expand Down
2 changes: 1 addition & 1 deletion codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<artifactId>codegen</artifactId>
<name>AWS Java SDK :: Code Generator</name>
Expand Down
2 changes: 1 addition & 1 deletion core/annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/arns/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>core</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>

<artifactId>auth</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.stream.Collectors;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.auth.credentials.AwsCredentials;
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
Expand Down Expand Up @@ -323,46 +324,51 @@ private String getCanonicalizedHeaderString(Map<String, List<String>> canonicali
StringBuilder buffer = new StringBuilder();

canonicalizedHeaders.forEach((headerName, headerValues) -> {
for (String headerValue : headerValues) {
appendCompactedString(buffer, headerName);
buffer.append(":");
if (headerValue != null) {
appendCompactedString(buffer, headerValue);
}
buffer.append("\n");
}
buffer.append(headerName);
buffer.append(":");
buffer.append(String.join(",", trimAll(headerValues)));
buffer.append("\n");
});

return buffer.toString();
}

/**
* This method appends a string to a string builder and collapses contiguous
* white space is a single space.
*
* This is equivalent to:
* destination.append(source.replaceAll("\\s+", " "))
* "The Trimall function removes excess white space before and after values,
* and converts sequential spaces to a single space."
* <p>
* https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
* <p>
* The collapse-whitespace logic is equivalent to:
* <pre>
* value.replaceAll("\\s+", " ")
* </pre>
* but does not create a Pattern object that needs to compile the match
* string; it also prevents us from having to make a Matcher object as well.
*
*/
private void appendCompactedString(final StringBuilder destination, final String source) {
private String trimAll(String value) {
boolean previousIsWhiteSpace = false;
int length = source.length();
StringBuilder sb = new StringBuilder(value.length());

for (int i = 0; i < length; i++) {
char ch = source.charAt(i);
for (int i = 0; i < value.length(); i++) {
char ch = value.charAt(i);
if (isWhiteSpace(ch)) {
if (previousIsWhiteSpace) {
continue;
}
destination.append(' ');
sb.append(' ');
previousIsWhiteSpace = true;
} else {
destination.append(ch);
sb.append(ch);
previousIsWhiteSpace = false;
}
}

return sb.toString().trim();
}

private List<String> trimAll(List<String> values) {
return values.stream().map(this::trimAll).collect(Collectors.toList());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,48 @@ public void xAmznTraceId_NotSigned() throws Exception {
"Signature=581d0042389009a28d461124138f1fe8eeb8daed87611d2a2b47fd3d68d81d73");
}

/**
* Multi-value headers should be comma separated.
*/
@Test
public void canonicalizedHeaderString_multiValueHeaders_areCommaSeparated() throws Exception {
AwsBasicCredentials credentials = AwsBasicCredentials.create("akid", "skid");
SdkHttpFullRequest.Builder request = generateBasicRequest();
request.appendHeader("foo","bar");
request.appendHeader("foo","baz");

SdkHttpFullRequest actual = SignerTestUtils.signRequest(signer, request.build(), credentials, "demo", signingOverrideClock, "us-east-1");

// We cannot easily test the canonical header string value, but the below signature asserts that it contains:
// foo:bar,baz
assertThat(actual.firstMatchingHeader("Authorization"))
.hasValue("AWS4-HMAC-SHA256 Credential=akid/19810216/us-east-1/demo/aws4_request, "
+ "SignedHeaders=foo;host;x-amz-archive-description;x-amz-date, "
+ "Signature=1253bc1751048ea299e688cbe07a2224292e5cc606a079cb40459ad987793c19");
}

/**
* Canonical headers should remove excess white space before and after values, and convert sequential spaces to a single
* space.
*/
@Test
public void canonicalizedHeaderString_valuesWithExtraWhitespace_areTrimmed() throws Exception {
AwsBasicCredentials credentials = AwsBasicCredentials.create("akid", "skid");
SdkHttpFullRequest.Builder request = generateBasicRequest();
request.putHeader("My-header1"," a b c ");
request.putHeader("My-Header2"," \"a b c\" ");

SdkHttpFullRequest actual = SignerTestUtils.signRequest(signer, request.build(), credentials, "demo", signingOverrideClock, "us-east-1");

// We cannot easily test the canonical header string value, but the below signature asserts that it contains:
// my-header1:a b c
// my-header2:"a b c"
assertThat(actual.firstMatchingHeader("Authorization"))
.hasValue("AWS4-HMAC-SHA256 Credential=akid/19810216/us-east-1/demo/aws4_request, "
+ "SignedHeaders=host;my-header1;my-header2;x-amz-archive-description;x-amz-date, "
+ "Signature=6d3520e3397e7aba593d8ebd8361fc4405e90aed71bc4c7a09dcacb6f72460b9");
}

private SdkHttpFullRequest.Builder generateBasicRequest() {
return SdkHttpFullRequest.builder()
.contentStreamProvider(() -> new ByteArrayInputStream("{\"TableName\": \"foo\"}".getBytes()))
Expand Down
2 changes: 1 addition & 1 deletion core/aws-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>core</artifactId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>

<artifactId>aws-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/json-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.7</version>
<version>2.17.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading

0 comments on commit 61d94ed

Please sign in to comment.