GeezerVison is showing github.com — Skip Signing of requests which are defined with authtype as none (#3281) · aws/aws-sdk-java-v2@1d92f36
File treeExpand file treeCollapse file tree Open diff view settings main/java/software/amazon/awssdk/codegen/poet/client test/resources/software/amazon/awssdk/codegen/poet/client
aws-core/src/main/java/software/amazon/awssdk/awscore/internal sdk-core/src/main/java/software/amazon/awssdk/core/interceptor
test/codegen-generated-classes-test/src main/resources/codegen-resources test/java/software/amazon/awssdk/services
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +{ | | 2 | + "type": "bugfix", | | 3 | + "category": "AWS SDK for Java v2", | | 4 | + "contributor": "", | | 5 | + "description": "Requests which are defined with AuthType as None should not be signed or authorized by the SDK." | | 6 | +} |
Collapse file Copy file name to clipboardExpand all lines: codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 41 | 41 | import software.amazon.awssdk.codegen.poet.PoetExtension; | 42 | 42 | import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumRequiredTrait; | 43 | 43 | import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumTrait; | | 44 | +import software.amazon.awssdk.codegen.poet.client.traits.NoneAuthTypeRequestTrait; | 44 | 45 | import software.amazon.awssdk.codegen.poet.eventstream.EventStreamUtils; | 45 | 46 | import software.amazon.awssdk.codegen.poet.model.EventStreamSpecHelper; | 46 | 47 | import software.amazon.awssdk.core.SdkPojoBuilder; | @@ -177,7 +178,8 @@ public CodeBlock executionHandler(OperationModel opModel) { | 177 | 178 | .add(".withInput($L)\n", opModel.getInput().getVariableName()) | 178 | 179 | .add(".withMetricCollector(apiCallMetricCollector)") | 179 | 180 | .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)) | 180 | | - .add(HttpChecksumTrait.create(opModel)); | | 181 | + .add(HttpChecksumTrait.create(opModel)) | | 182 | + .add(NoneAuthTypeRequestTrait.create(opModel)); | 181 | 183 |
| 182 | 184 | if (opModel.hasStreamingInput()) { | 183 | 185 | codeBlock.add(".withRequestBody(requestBody)") | @@ -245,6 +247,7 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper | 245 | 247 | .add(asyncRequestBody) | 246 | 248 | .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)) | 247 | 249 | .add(HttpChecksumTrait.create(opModel)) | | 250 | + .add(NoneAuthTypeRequestTrait.create(opModel)) | 248 | 251 | .add(".withInput($L)$L);", | 249 | 252 | opModel.getInput().getVariableName(), asyncResponseTransformerVariable(isStreaming, isRestJson, opModel)); | 250 | 253 |
| |
Collapse file Copy file name to clipboardExpand all lines: codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/QueryProtocolSpec.java +7-2Lines changed: 7 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | import software.amazon.awssdk.codegen.poet.PoetExtension; | 31 | 31 | import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumRequiredTrait; | 32 | 32 | import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumTrait; | | 33 | +import software.amazon.awssdk.codegen.poet.client.traits.NoneAuthTypeRequestTrait; | 33 | 34 | import software.amazon.awssdk.core.async.AsyncResponseTransformer; | 34 | 35 | import software.amazon.awssdk.core.client.handler.ClientExecutionParams; | 35 | 36 | import software.amazon.awssdk.core.http.HttpResponseHandler; | @@ -113,7 +114,9 @@ public CodeBlock executionHandler(OperationModel opModel) { | 113 | 114 | .add(".withInput($L)", opModel.getInput().getVariableName()) | 114 | 115 | .add(".withMetricCollector(apiCallMetricCollector)") | 115 | 116 | .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)) | 116 | | - .add(HttpChecksumTrait.create(opModel)); | | 117 | + .add(HttpChecksumTrait.create(opModel)) | | 118 | + .add(NoneAuthTypeRequestTrait.create(opModel)); | | 119 | + | 117 | 120 |
| 118 | 121 | if (opModel.hasStreamingInput()) { | 119 | 122 | return codeBlock.add(".withRequestBody(requestBody)") | @@ -145,7 +148,9 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper | 145 | 148 | .add(".withErrorResponseHandler(errorResponseHandler)\n") | 146 | 149 | .add(".withMetricCollector(apiCallMetricCollector)\n") | 147 | 150 | .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)) | 148 | | - .add(HttpChecksumTrait.create(opModel)); | | 151 | + .add(HttpChecksumTrait.create(opModel)) | | 152 | + .add(NoneAuthTypeRequestTrait.create(opModel)); | | 153 | + | 149 | 154 |
| 150 | 155 | builder.add(hostPrefixExpression(opModel) + asyncRequestBody + ".withInput($L)$L);", | 151 | 156 | opModel.getInput().getVariableName(), | |
Collapse file Copy file name to clipboardExpand all lines: codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/XmlProtocolSpec.java +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 36 | 36 | import software.amazon.awssdk.codegen.poet.PoetExtension; | 37 | 37 | import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumRequiredTrait; | 38 | 38 | import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumTrait; | | 39 | +import software.amazon.awssdk.codegen.poet.client.traits.NoneAuthTypeRequestTrait; | 39 | 40 | import software.amazon.awssdk.codegen.poet.eventstream.EventStreamUtils; | 40 | 41 | import software.amazon.awssdk.codegen.poet.model.EventStreamSpecHelper; | 41 | 42 | import software.amazon.awssdk.core.SdkPojoBuilder; | @@ -132,7 +133,9 @@ public CodeBlock executionHandler(OperationModel opModel) { | 132 | 133 | discoveredEndpoint(opModel)) | 133 | 134 | .add(".withInput($L)", opModel.getInput().getVariableName()) | 134 | 135 | .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)) | 135 | | - .add(HttpChecksumTrait.create(opModel)); | | 136 | + .add(HttpChecksumTrait.create(opModel)) | | 137 | + .add(NoneAuthTypeRequestTrait.create(opModel)); | | 138 | + | 136 | 139 |
| 137 | 140 | s3ArnableFields(opModel, model).ifPresent(codeBlock::add); | 138 | 141 |
| @@ -207,7 +210,8 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper | 207 | 210 | .add(".withMetricCollector(apiCallMetricCollector)\n") | 208 | 211 | .add(asyncRequestBody(opModel)) | 209 | 212 | .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)) | 210 | | - .add(HttpChecksumTrait.create(opModel)); | | 213 | + .add(HttpChecksumTrait.create(opModel)) | | 214 | + .add(NoneAuthTypeRequestTrait.create(opModel)); | 211 | 215 |
| 212 | 216 | s3ArnableFields(opModel, model).ifPresent(builder::add); | 213 | 217 |
| |
Collapse file Copy file name to clipboard +51Lines changed: 51 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +/* | | 2 | + * Copyright 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.codegen.poet.client.traits; | | 17 | + | | 18 | +import com.squareup.javapoet.CodeBlock; | | 19 | +import software.amazon.awssdk.annotations.SdkInternalApi; | | 20 | +import software.amazon.awssdk.codegen.model.intermediate.OperationModel; | | 21 | +import software.amazon.awssdk.codegen.model.service.AuthType; | | 22 | +import software.amazon.awssdk.core.client.handler.ClientExecutionParams; | | 23 | +import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute; | | 24 | + | | 25 | +/** | | 26 | + * Trait which defines if a given request needs to be authenticated. | | 27 | + * A request is not authenticated only if it has "auththpe" trait explicitly marked as "none" | | 28 | + */ | | 29 | +@SdkInternalApi | | 30 | +public class NoneAuthTypeRequestTrait { | | 31 | + | | 32 | + private NoneAuthTypeRequestTrait() { | | 33 | + } | | 34 | + | | 35 | + /** | | 36 | + * Generate a ".putExecutionAttribute(...)" code-block for the provided operation model. This should be used within the | | 37 | + * context of initializing {@link ClientExecutionParams}. If and only if "authType" trait is explicitly set as "none" the set | | 38 | + * the execution attribute as false. | | 39 | + */ | | 40 | + public static CodeBlock create(OperationModel operationModel) { | | 41 | + | | 42 | + if (operationModel.getAuthType() == AuthType.NONE) { | | 43 | + CodeBlock.Builder codeBuilder = CodeBlock.builder(); | | 44 | + codeBuilder.add(CodeBlock.of(".putExecutionAttribute($T.IS_NONE_AUTH_TYPE_REQUEST, $L)", | | 45 | + SdkInternalExecutionAttribute.class, operationModel.getAuthType() != AuthType.NONE)); | | 46 | + return codeBuilder.build(); | | 47 | + } else { | | 48 | + return CodeBlock.of(""); | | 49 | + } | | 50 | + } | | 51 | +} |
Collapse file Copy file name to clipboardExpand all lines: codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 22 | 22 | }, | 23 | 23 | "httpChecksumRequired": true | 24 | 24 | }, | | 25 | + "OperationWithNoneAuthType": { | | 26 | + "name": "APostOperation", | | 27 | + "http": { | | 28 | + "method": "POST", | | 29 | + "requestUri": "/" | | 30 | + }, | | 31 | + "authtype": "none" | | 32 | + }, | 25 | 33 | "APostOperation": { | 26 | 34 | "name": "APostOperation", | 27 | 35 | "http": { | |
Collapse file Copy file name to clipboardExpand all lines: codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | }, | 22 | 22 | "httpChecksumRequired": true | 23 | 23 | }, | | 24 | + "OperationWithNoneAuthType": { | | 25 | + "name": "APostOperation", | | 26 | + "http": { | | 27 | + "method": "POST", | | 28 | + "requestUri": "/" | | 29 | + }, | | 30 | + "authtype": "none" | | 31 | + }, | 24 | 32 | "APostOperation": { | 25 | 33 | "name": "APostOperation", | 26 | 34 | "http": { | |
Collapse file Copy file name to clipboardExpand all lines: codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | }, | 22 | 22 | "httpChecksumRequired": true | 23 | 23 | }, | | 24 | + "OperationWithNoneAuthType": { | | 25 | + "name": "NoneAuthTypeOperation", | | 26 | + "http": { | | 27 | + "method": "POST", | | 28 | + "requestUri": "/" | | 29 | + }, | | 30 | + "authtype": "none" | | 31 | + }, | 24 | 32 | "APostOperation": { | 25 | 33 | "name": "APostOperation", | 26 | 34 | "http": { | |
Collapse file Copy file name to clipboardExpand all lines: codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-aws-json-async-client-class.java +60Lines changed: 60 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 75 | 75 | import software.amazon.awssdk.services.json.model.JsonRequest; | 76 | 76 | import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; | 77 | 77 | import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; | | 78 | +import software.amazon.awssdk.services.json.model.OperationWithNoneAuthTypeRequest; | | 79 | +import software.amazon.awssdk.services.json.model.OperationWithNoneAuthTypeResponse; | 78 | 80 | import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; | 79 | 81 | import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; | 80 | 82 | import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; | | 99 | 101 | import software.amazon.awssdk.services.json.transform.InputEventMarshaller; | 100 | 102 | import software.amazon.awssdk.services.json.transform.InputEventTwoMarshaller; | 101 | 103 | import software.amazon.awssdk.services.json.transform.OperationWithChecksumRequiredRequestMarshaller; | | 104 | +import software.amazon.awssdk.services.json.transform.OperationWithNoneAuthTypeRequestMarshaller; | 102 | 105 | import software.amazon.awssdk.services.json.transform.PaginatedOperationWithResultKeyRequestMarshaller; | 103 | 106 | import software.amazon.awssdk.services.json.transform.PaginatedOperationWithoutResultKeyRequestMarshaller; | 104 | 107 | import software.amazon.awssdk.services.json.transform.StreamingInputOperationRequestMarshaller; | @@ -617,6 +620,63 @@ public CompletableFuture<OperationWithChecksumRequiredResponse> operationWithChe | 617 | 620 | } | 618 | 621 | } | 619 | 622 |
| | 623 | + /** | | 624 | + * Invokes the OperationWithNoneAuthType operation asynchronously. | | 625 | + * | | 626 | + * @param operationWithNoneAuthTypeRequest | | 627 | + * @return A Java Future containing the result of the OperationWithNoneAuthType operation returned by the service.<br/> | | 628 | + * The CompletableFuture returned by this method can be completed exceptionally with the following | | 629 | + * exceptions. | | 630 | + * <ul> | | 631 | + * <li>SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). | | 632 | + * Can be used for catch all scenarios.</li> | | 633 | + * <li>SdkClientException If any client side error occurs such as an IO related failure, failure to get | | 634 | + * credentials, etc.</li> | | 635 | + * <li>JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance | | 636 | + * of this type.</li> | | 637 | + * </ul> | | 638 | + * @sample JsonAsyncClient.OperationWithNoneAuthType | | 639 | + * @see <a href="https://docs.aws.amazon.com/goto/WebAPI/json-service-2010-05-08/OperationWithNoneAuthType" | | 640 | + * target="_top">AWS API Documentation</a> | | 641 | + */ | | 642 | + @Override | | 643 | + public CompletableFuture<OperationWithNoneAuthTypeResponse> operationWithNoneAuthType( | | 644 | + OperationWithNoneAuthTypeRequest operationWithNoneAuthTypeRequest) { | | 645 | + List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, operationWithNoneAuthTypeRequest | | 646 | + .overrideConfiguration().orElse(null)); | | 647 | + MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector | | 648 | + .create("ApiCall"); | | 649 | + try { | | 650 | + apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); | | 651 | + apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "OperationWithNoneAuthType"); | | 652 | + JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) | | 653 | + .isPayloadJson(true).build(); | | 654 | + | | 655 | + HttpResponseHandler<OperationWithNoneAuthTypeResponse> responseHandler = protocolFactory.createResponseHandler( | | 656 | + operationMetadata, OperationWithNoneAuthTypeResponse::builder); | | 657 | + | | 658 | + HttpResponseHandler<AwsServiceException> errorResponseHandler = createErrorResponseHandler(protocolFactory, | | 659 | + operationMetadata); | | 660 | + | | 661 | + CompletableFuture<OperationWithNoneAuthTypeResponse> executeFuture = clientHandler | | 662 | + .execute(new ClientExecutionParams<OperationWithNoneAuthTypeRequest, OperationWithNoneAuthTypeResponse>() | | 663 | + .withOperationName("OperationWithNoneAuthType") | | 664 | + .withMarshaller(new OperationWithNoneAuthTypeRequestMarshaller(protocolFactory)) | | 665 | + .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) | | 666 | + .withMetricCollector(apiCallMetricCollector) | | 667 | + .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) | | 668 | + .withInput(operationWithNoneAuthTypeRequest)); | | 669 | + CompletableFuture<OperationWithNoneAuthTypeResponse> whenCompleted = executeFuture.whenComplete((r, e) -> { | | 670 | + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); | | 671 | + }); | | 672 | + executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); | | 673 | + return executeFuture; | | 674 | + } catch (Throwable t) { | | 675 | + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); | | 676 | + return CompletableFutureUtils.failedFuture(t); | | 677 | + } | | 678 | + } | | 679 | + | 620 | 680 | /** | 621 | 681 | * Some paginated operation with result_key in paginators.json file | 622 | 682 | * | |
Collapse file Copy file name to clipboardExpand all lines: codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-query-async-client-class.java +57Lines changed: 57 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 44 | 44 | import software.amazon.awssdk.services.query.model.InvalidInputException; | 45 | 45 | import software.amazon.awssdk.services.query.model.OperationWithChecksumRequiredRequest; | 46 | 46 | import software.amazon.awssdk.services.query.model.OperationWithChecksumRequiredResponse; | | 47 | +import software.amazon.awssdk.services.query.model.OperationWithNoneAuthTypeRequest; | | 48 | +import software.amazon.awssdk.services.query.model.OperationWithNoneAuthTypeResponse; | 47 | 49 | import software.amazon.awssdk.services.query.model.PutOperationWithChecksumRequest; | 48 | 50 | import software.amazon.awssdk.services.query.model.PutOperationWithChecksumResponse; | 49 | 51 | import software.amazon.awssdk.services.query.model.QueryException; | | 56 | 58 | import software.amazon.awssdk.services.query.transform.APostOperationWithOutputRequestMarshaller; | 57 | 59 | import software.amazon.awssdk.services.query.transform.GetOperationWithChecksumRequestMarshaller; | 58 | 60 | import software.amazon.awssdk.services.query.transform.OperationWithChecksumRequiredRequestMarshaller; | | 61 | +import software.amazon.awssdk.services.query.transform.OperationWithNoneAuthTypeRequestMarshaller; | 59 | 62 | import software.amazon.awssdk.services.query.transform.PutOperationWithChecksumRequestMarshaller; | 60 | 63 | import software.amazon.awssdk.services.query.transform.StreamingInputOperationRequestMarshaller; | 61 | 64 | import software.amazon.awssdk.services.query.transform.StreamingOutputOperationRequestMarshaller; | @@ -322,6 +325,60 @@ public CompletableFuture<OperationWithChecksumRequiredResponse> operationWithChe | 322 | 325 | } | 323 | 326 | } | 324 | 327 |
| | 328 | + /** | | 329 | + * Invokes the OperationWithNoneAuthType operation asynchronously. | | 330 | + * | | 331 | + * @param operationWithNoneAuthTypeRequest | | 332 | + * @return A Java Future containing the result of the OperationWithNoneAuthType operation returned by the service.<br/> | | 333 | + * The CompletableFuture returned by this method can be completed exceptionally with the following | | 334 | + * exceptions. | | 335 | + * <ul> | | 336 | + * <li>SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). | | 337 | + * Can be used for catch all scenarios.</li> | | 338 | + * <li>SdkClientException If any client side error occurs such as an IO related failure, failure to get | | 339 | + * credentials, etc.</li> | | 340 | + * <li>QueryException Base class for all service exceptions. Unknown exceptions will be thrown as an | | 341 | + * instance of this type.</li> | | 342 | + * </ul> | | 343 | + * @sample QueryAsyncClient.OperationWithNoneAuthType | | 344 | + * @see <a href="https://docs.aws.amazon.com/goto/WebAPI/query-service-2010-05-08/OperationWithNoneAuthType" | | 345 | + * target="_top">AWS API Documentation</a> | | 346 | + */ | | 347 | + @Override | | 348 | + public CompletableFuture<OperationWithNoneAuthTypeResponse> operationWithNoneAuthType( | | 349 | + OperationWithNoneAuthTypeRequest operationWithNoneAuthTypeRequest) { | | 350 | + List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, operationWithNoneAuthTypeRequest | | 351 | + .overrideConfiguration().orElse(null)); | | 352 | + MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector | | 353 | + .create("ApiCall"); | | 354 | + try { | | 355 | + apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Query Service"); | | 356 | + apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "OperationWithNoneAuthType"); | | 357 | + | | 358 | + HttpResponseHandler<OperationWithNoneAuthTypeResponse> responseHandler = protocolFactory | | 359 | + .createResponseHandler(OperationWithNoneAuthTypeResponse::builder); | | 360 | + | | 361 | + HttpResponseHandler<AwsServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(); | | 362 | + | | 363 | + CompletableFuture<OperationWithNoneAuthTypeResponse> executeFuture = clientHandler | | 364 | + .execute(new ClientExecutionParams<OperationWithNoneAuthTypeRequest, OperationWithNoneAuthTypeResponse>() | | 365 | + .withOperationName("OperationWithNoneAuthType") | | 366 | + .withMarshaller(new OperationWithNoneAuthTypeRequestMarshaller(protocolFactory)) | | 367 | + .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) | | 368 | + .withMetricCollector(apiCallMetricCollector) | | 369 | + .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) | | 370 | + .withInput(operationWithNoneAuthTypeRequest)); | | 371 | + CompletableFuture<OperationWithNoneAuthTypeResponse> whenCompleteFuture = null; | | 372 | + whenCompleteFuture = executeFuture.whenComplete((r, e) -> { | | 373 | + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); | | 374 | + }); | | 375 | + return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture); | | 376 | + } catch (Throwable t) { | | 377 | + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); | | 378 | + return CompletableFutureUtils.failedFuture(t); | | 379 | + } | | 380 | + } | | 381 | + | 325 | 382 | /** | 326 | 383 | * Invokes the PutOperationWithChecksum operation asynchronously. | 327 | 384 | * | |
|