Skip to content

Commit c24f2e6

Browse files
Merge pull request aws#954 from aws/staging/c38a7134-93cb-4c57-a609-b36b60c6179c
Pull request: release <- staging/c38a7134-93cb-4c57-a609-b36b60c6179c
2 parents b82aec6 + 2317516 commit c24f2e6

File tree

311 files changed

+1879
-674
lines changed

Some content is hidden

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

311 files changed

+1879
-674
lines changed

.changes/2.14.17.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.14.17",
3+
"date": "2020-09-14",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "Amazon Elastic Compute Cloud",
8+
"description": "This release adds support for the T4G instance family to the EC2 ModifyDefaultCreditSpecification and GetDefaultCreditSpecification APIs."
9+
},
10+
{
11+
"type": "feature",
12+
"category": "Amazon Managed Blockchain",
13+
"description": "Introducing support for Hyperledger Fabric 1.4. When using framework version 1.4, the state database may optionally be specified when creating peer nodes (defaults to CouchDB)."
14+
},
15+
{
16+
"type": "bugfix",
17+
"category": "AWS SDK for Java v2",
18+
"description": "Fix a bug in the SDK where the contents of the `AsyncRequestBody` is not included in the AWS Signature Version 4 calculation, which is required for some streaming operations such as Glacier `UploadArchive' and ClouSearch Domain `UploadDocuments`."
19+
},
20+
{
21+
"type": "feature",
22+
"category": "AWS Step Functions",
23+
"description": "This release of the AWS Step Functions SDK introduces support for AWS X-Ray."
24+
},
25+
{
26+
"type": "feature",
27+
"category": "Amazon DocumentDB with MongoDB compatibility",
28+
"description": "Updated API documentation and added paginators for DescribeCertificates, DescribeDBClusterParameterGroups, DescribeDBClusterParameters, DescribeDBClusterSnapshots and DescribePendingMaintenanceActions"
29+
},
30+
{
31+
"type": "feature",
32+
"category": "AWS SDK for Java v2",
33+
"description": "Updated service endpoint metadata."
34+
}
35+
]
36+
}

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# __2.14.17__ __2020-09-14__
2+
## __AWS SDK for Java v2__
3+
- ### Features
4+
- Updated service endpoint metadata.
5+
6+
- ### Bugfixes
7+
- Fix a bug in the SDK where the contents of the `AsyncRequestBody` is not included in the AWS Signature Version 4 calculation, which is required for some streaming operations such as Glacier `UploadArchive' and ClouSearch Domain `UploadDocuments`.
8+
9+
## __AWS Step Functions__
10+
- ### Features
11+
- This release of the AWS Step Functions SDK introduces support for AWS X-Ray.
12+
13+
## __Amazon DocumentDB with MongoDB compatibility__
14+
- ### Features
15+
- Updated API documentation and added paginators for DescribeCertificates, DescribeDBClusterParameterGroups, DescribeDBClusterParameters, DescribeDBClusterSnapshots and DescribePendingMaintenanceActions
16+
17+
## __Amazon Elastic Compute Cloud__
18+
- ### Features
19+
- This release adds support for the T4G instance family to the EC2 ModifyDefaultCreditSpecification and GetDefaultCreditSpecification APIs.
20+
21+
## __Amazon Managed Blockchain__
22+
- ### Features
23+
- Introducing support for Hyperledger Fabric 1.4. When using framework version 1.4, the state database may optionally be specified when creating peer nodes (defaults to CouchDB).
24+
125
# __2.14.16__ __2020-09-11__
226
## __AWS SDK for Java v2__
327
- ### 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.14.16</version>
52+
<version>2.14.17</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.14.16</version>
86+
<version>2.14.17</version>
8787
</dependency>
8888
<dependency>
8989
<groupId>software.amazon.awssdk</groupId>
9090
<artifactId>s3</artifactId>
91-
<version>2.14.16</version>
91+
<version>2.14.17</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.14.16</version>
103+
<version>2.14.17</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.14.16</version>
23+
<version>2.14.17</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.14.16</version>
23+
<version>2.14.17</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.14.16</version>
20+
<version>2.14.17</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.14.16</version>
23+
<version>2.14.17</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.14.16</version>
20+
<version>2.14.17</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.14.16</version>
24+
<version>2.14.17</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.14.16</version>
25+
<version>2.14.17</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.14.16</version>
24+
<version>2.14.17</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.14.16</version>
25+
<version>2.14.17</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.14.16</version>
24+
<version>2.14.17</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/AsyncClientClass.java

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.slf4j.Logger;
4242
import org.slf4j.LoggerFactory;
4343
import software.amazon.awssdk.annotations.SdkInternalApi;
44+
import software.amazon.awssdk.auth.signer.AsyncAws4Signer;
4445
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
4546
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
4647
import software.amazon.awssdk.awscore.client.handler.AwsClientHandlerUtils;
@@ -49,7 +50,9 @@
4950
import software.amazon.awssdk.codegen.model.config.customization.UtilitiesMethod;
5051
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
5152
import software.amazon.awssdk.codegen.model.intermediate.OperationModel;
53+
import software.amazon.awssdk.codegen.model.intermediate.Protocol;
5254
import software.amazon.awssdk.codegen.model.intermediate.ShapeModel;
55+
import software.amazon.awssdk.codegen.model.service.AuthType;
5356
import software.amazon.awssdk.codegen.poet.PoetExtensions;
5457
import software.amazon.awssdk.codegen.poet.PoetUtils;
5558
import software.amazon.awssdk.codegen.poet.StaticImport;
@@ -119,8 +122,9 @@ public TypeSpec poetSpec() {
119122
classBuilder.addMethod(applyPaginatorUserAgentMethod(poetExtensions, model));
120123
}
121124

122-
if (model.containsRequestSigners() || model.containsRequestEventStreams()) {
125+
if (model.containsRequestSigners() || model.containsRequestEventStreams() || hasStreamingV4AuthOperations()) {
123126
classBuilder.addMethod(applySignerOverrideMethod(poetExtensions, model));
127+
classBuilder.addMethod(isSignerOverriddenOnClientMethod());
124128
}
125129

126130
if (model.getCustomizationConfig().getUtilitiesMethod() != null) {
@@ -224,9 +228,14 @@ protected MethodSpec.Builder operationBody(MethodSpec.Builder builder, Operation
224228
builder.addStatement("apiCallMetricCollector.reportMetric($T.$L, $S)",
225229
CoreMetric.class, "OPERATION_NAME", opModel.getOperationName());
226230

227-
builder.addCode(ClientClassUtils.callApplySignerOverrideMethod(opModel))
228-
.addCode(ClientClassUtils.addEndpointTraitCode(opModel))
229-
.addCode(protocolSpec.responseHandler(model, opModel));
231+
if (model.getMetadata().getProtocol() != Protocol.API_GATEWAY && shouldUseAsyncWithBodySigner(opModel)) {
232+
builder.addCode(applyAsyncWithBodyV4SignerOverride(opModel));
233+
} else {
234+
builder.addCode(ClientClassUtils.callApplySignerOverrideMethod(opModel));
235+
}
236+
237+
builder.addCode(ClientClassUtils.addEndpointTraitCode(opModel))
238+
.addCode(protocolSpec.responseHandler(model, opModel));
230239
protocolSpec.errorResponseHandler(opModel).ifPresent(builder::addCode);
231240
builder.addCode(eventToByteBufferPublisher(opModel));
232241

@@ -400,4 +409,44 @@ private MethodSpec resolveMetricPublishersMethod() {
400409

401410
return methodBuilder.build();
402411
}
412+
413+
private boolean shouldUseAsyncWithBodySigner(OperationModel opModel) {
414+
if (opModel.getInputShape().getRequestSignerClassFqcn() != null) {
415+
return false;
416+
}
417+
418+
AuthType authTypeForOperation = opModel.getAuthType();
419+
420+
if (authTypeForOperation == AuthType.IAM) {
421+
authTypeForOperation = model.getMetadata().getAuthType();
422+
}
423+
424+
return authTypeForOperation == AuthType.V4 && opModel.hasStreamingInput();
425+
}
426+
427+
private CodeBlock applyAsyncWithBodyV4SignerOverride(OperationModel opModel) {
428+
return CodeBlock.builder()
429+
.beginControlFlow("if (!isSignerOverridden($N))", "clientConfiguration")
430+
.addStatement("$1L = applySignerOverride($1L, $2T.create())",
431+
opModel.getInput().getVariableName(), AsyncAws4Signer.class)
432+
.endControlFlow()
433+
.build();
434+
}
435+
436+
private MethodSpec isSignerOverriddenOnClientMethod() {
437+
String clientConfigurationName = "clientConfiguration";
438+
439+
return MethodSpec.methodBuilder("isSignerOverridden")
440+
.returns(boolean.class)
441+
.addModifiers(PRIVATE, STATIC)
442+
.addParameter(SdkClientConfiguration.class, clientConfigurationName)
443+
.addStatement("return $T.TRUE.equals($N.option($T.$N))", Boolean.class, clientConfigurationName,
444+
SdkClientOption.class, "SIGNER_OVERRIDDEN")
445+
.build();
446+
}
447+
448+
private boolean hasStreamingV4AuthOperations() {
449+
return model.getOperations().values().stream()
450+
.anyMatch(this::shouldUseAsyncWithBodySigner);
451+
}
403452
}

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/ClientClassUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ static CodeBlock callApplySignerOverrideMethod(OperationModel opModel) {
159159
} else if (opModel.hasEventStreamInput()) {
160160
code.addStatement("$1L = applySignerOverride($1L, $2T.create())",
161161
opModel.getInput().getVariableName(), EventStreamAws4Signer.class);
162-
163162
}
164163

165164
return code.build();

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ public CodeBlock executionHandler(OperationModel opModel) {
161161
ClassName requestType = poetExtensions.getModelClass(opModel.getInput().getVariableType());
162162
ClassName marshaller = poetExtensions.getRequestTransformClass(opModel.getInputShape().getShapeName() + "Marshaller");
163163

164-
165164
CodeBlock.Builder codeBlock = CodeBlock
166165
.builder()
167166
.add("\n\nreturn clientHandler.execute(new $T<$T, $T>()\n" +

0 commit comments

Comments
 (0)