diff --git a/clients/client-s3/src/commands/DeleteObjectsCommand.ts b/clients/client-s3/src/commands/DeleteObjectsCommand.ts index 1994e3000d3e..da60ddfe28b7 100644 --- a/clients/client-s3/src/commands/DeleteObjectsCommand.ts +++ b/clients/client-s3/src/commands/DeleteObjectsCommand.ts @@ -322,6 +322,7 @@ export class DeleteObjectsCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), getThrow200ExceptionsPlugin(config), diff --git a/clients/client-s3/src/commands/PutBucketAccelerateConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketAccelerateConfigurationCommand.ts index 83dcc4dc13a5..14e4f31b4e7e 100644 --- a/clients/client-s3/src/commands/PutBucketAccelerateConfigurationCommand.ts +++ b/clients/client-s3/src/commands/PutBucketAccelerateConfigurationCommand.ts @@ -124,6 +124,7 @@ export class PutBucketAccelerateConfigurationCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: false, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketAclCommand.ts b/clients/client-s3/src/commands/PutBucketAclCommand.ts index e1d95b2bfaa5..12aa7505ab7d 100644 --- a/clients/client-s3/src/commands/PutBucketAclCommand.ts +++ b/clients/client-s3/src/commands/PutBucketAclCommand.ts @@ -315,6 +315,7 @@ export class PutBucketAclCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketCorsCommand.ts b/clients/client-s3/src/commands/PutBucketCorsCommand.ts index 7576aaaa7e33..0b20c8f6a0d8 100644 --- a/clients/client-s3/src/commands/PutBucketCorsCommand.ts +++ b/clients/client-s3/src/commands/PutBucketCorsCommand.ts @@ -199,6 +199,7 @@ export class PutBucketCorsCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketEncryptionCommand.ts b/clients/client-s3/src/commands/PutBucketEncryptionCommand.ts index a9fbbbb3c38a..810e31fa9539 100644 --- a/clients/client-s3/src/commands/PutBucketEncryptionCommand.ts +++ b/clients/client-s3/src/commands/PutBucketEncryptionCommand.ts @@ -214,6 +214,7 @@ export class PutBucketEncryptionCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketLifecycleConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketLifecycleConfigurationCommand.ts index 7a5d1a98c227..43c23e4bc6f2 100644 --- a/clients/client-s3/src/commands/PutBucketLifecycleConfigurationCommand.ts +++ b/clients/client-s3/src/commands/PutBucketLifecycleConfigurationCommand.ts @@ -300,6 +300,7 @@ export class PutBucketLifecycleConfigurationCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), getThrow200ExceptionsPlugin(config), diff --git a/clients/client-s3/src/commands/PutBucketLoggingCommand.ts b/clients/client-s3/src/commands/PutBucketLoggingCommand.ts index e58d8d87528f..51a7fe44f0a1 100644 --- a/clients/client-s3/src/commands/PutBucketLoggingCommand.ts +++ b/clients/client-s3/src/commands/PutBucketLoggingCommand.ts @@ -215,6 +215,7 @@ export class PutBucketLoggingCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketPolicyCommand.ts b/clients/client-s3/src/commands/PutBucketPolicyCommand.ts index 6c134c1d7d65..869328b878ac 100644 --- a/clients/client-s3/src/commands/PutBucketPolicyCommand.ts +++ b/clients/client-s3/src/commands/PutBucketPolicyCommand.ts @@ -167,6 +167,7 @@ export class PutBucketPolicyCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketReplicationCommand.ts b/clients/client-s3/src/commands/PutBucketReplicationCommand.ts index 44433ae0b8ff..c80902905ea5 100644 --- a/clients/client-s3/src/commands/PutBucketReplicationCommand.ts +++ b/clients/client-s3/src/commands/PutBucketReplicationCommand.ts @@ -239,6 +239,7 @@ export class PutBucketReplicationCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketRequestPaymentCommand.ts b/clients/client-s3/src/commands/PutBucketRequestPaymentCommand.ts index 58bb078aa5cb..78a39025471c 100644 --- a/clients/client-s3/src/commands/PutBucketRequestPaymentCommand.ts +++ b/clients/client-s3/src/commands/PutBucketRequestPaymentCommand.ts @@ -115,6 +115,7 @@ export class PutBucketRequestPaymentCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketTaggingCommand.ts b/clients/client-s3/src/commands/PutBucketTaggingCommand.ts index 41f1ed96767d..e6d51ba191ed 100644 --- a/clients/client-s3/src/commands/PutBucketTaggingCommand.ts +++ b/clients/client-s3/src/commands/PutBucketTaggingCommand.ts @@ -169,6 +169,7 @@ export class PutBucketTaggingCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketVersioningCommand.ts b/clients/client-s3/src/commands/PutBucketVersioningCommand.ts index 90416d5d4799..46c08e37a79b 100644 --- a/clients/client-s3/src/commands/PutBucketVersioningCommand.ts +++ b/clients/client-s3/src/commands/PutBucketVersioningCommand.ts @@ -149,6 +149,7 @@ export class PutBucketVersioningCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutBucketWebsiteCommand.ts b/clients/client-s3/src/commands/PutBucketWebsiteCommand.ts index a211b6becdc1..7b1cc50f7ddb 100644 --- a/clients/client-s3/src/commands/PutBucketWebsiteCommand.ts +++ b/clients/client-s3/src/commands/PutBucketWebsiteCommand.ts @@ -250,6 +250,7 @@ export class PutBucketWebsiteCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/PutObjectAclCommand.ts b/clients/client-s3/src/commands/PutObjectAclCommand.ts index 3af046afa4dc..3248b7e0c015 100644 --- a/clients/client-s3/src/commands/PutObjectAclCommand.ts +++ b/clients/client-s3/src/commands/PutObjectAclCommand.ts @@ -314,6 +314,7 @@ export class PutObjectAclCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), getThrow200ExceptionsPlugin(config), diff --git a/clients/client-s3/src/commands/PutObjectCommand.ts b/clients/client-s3/src/commands/PutObjectCommand.ts index eb701293f76b..e08b97de77f3 100644 --- a/clients/client-s3/src/commands/PutObjectCommand.ts +++ b/clients/client-s3/src/commands/PutObjectCommand.ts @@ -463,6 +463,7 @@ export class PutObjectCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: false, }), getCheckContentLengthHeaderPlugin(config), diff --git a/clients/client-s3/src/commands/PutObjectLegalHoldCommand.ts b/clients/client-s3/src/commands/PutObjectLegalHoldCommand.ts index 2dcebf439f04..863f8651f072 100644 --- a/clients/client-s3/src/commands/PutObjectLegalHoldCommand.ts +++ b/clients/client-s3/src/commands/PutObjectLegalHoldCommand.ts @@ -92,6 +92,7 @@ export class PutObjectLegalHoldCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), getThrow200ExceptionsPlugin(config), diff --git a/clients/client-s3/src/commands/PutObjectLockConfigurationCommand.ts b/clients/client-s3/src/commands/PutObjectLockConfigurationCommand.ts index df5f27ceaeb2..247d5c326295 100644 --- a/clients/client-s3/src/commands/PutObjectLockConfigurationCommand.ts +++ b/clients/client-s3/src/commands/PutObjectLockConfigurationCommand.ts @@ -115,6 +115,7 @@ export class PutObjectLockConfigurationCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), getThrow200ExceptionsPlugin(config), diff --git a/clients/client-s3/src/commands/PutObjectRetentionCommand.ts b/clients/client-s3/src/commands/PutObjectRetentionCommand.ts index 8e3aabf0a3cf..1a03e54aeceb 100644 --- a/clients/client-s3/src/commands/PutObjectRetentionCommand.ts +++ b/clients/client-s3/src/commands/PutObjectRetentionCommand.ts @@ -95,6 +95,7 @@ export class PutObjectRetentionCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), getThrow200ExceptionsPlugin(config), diff --git a/clients/client-s3/src/commands/PutObjectTaggingCommand.ts b/clients/client-s3/src/commands/PutObjectTaggingCommand.ts index cbaf8768b2c3..7fcbf2aa1542 100644 --- a/clients/client-s3/src/commands/PutObjectTaggingCommand.ts +++ b/clients/client-s3/src/commands/PutObjectTaggingCommand.ts @@ -175,6 +175,7 @@ export class PutObjectTaggingCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), getThrow200ExceptionsPlugin(config), diff --git a/clients/client-s3/src/commands/PutPublicAccessBlockCommand.ts b/clients/client-s3/src/commands/PutPublicAccessBlockCommand.ts index ba5e98693e36..bd18f8531e12 100644 --- a/clients/client-s3/src/commands/PutPublicAccessBlockCommand.ts +++ b/clients/client-s3/src/commands/PutPublicAccessBlockCommand.ts @@ -123,6 +123,7 @@ export class PutPublicAccessBlockCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: true, }), ]; diff --git a/clients/client-s3/src/commands/RestoreObjectCommand.ts b/clients/client-s3/src/commands/RestoreObjectCommand.ts index 3ee9ffc16793..4ca11760b8f4 100644 --- a/clients/client-s3/src/commands/RestoreObjectCommand.ts +++ b/clients/client-s3/src/commands/RestoreObjectCommand.ts @@ -389,6 +389,7 @@ export class RestoreObjectCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: false, }), getThrow200ExceptionsPlugin(config), diff --git a/clients/client-s3/src/commands/UploadPartCommand.ts b/clients/client-s3/src/commands/UploadPartCommand.ts index bdcbde264141..73e0d576f32f 100644 --- a/clients/client-s3/src/commands/UploadPartCommand.ts +++ b/clients/client-s3/src/commands/UploadPartCommand.ts @@ -321,6 +321,7 @@ export class UploadPartCommand extends $Command getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getFlexibleChecksumsPlugin(config, { requestAlgorithmMember: "ChecksumAlgorithm", + requestAlgorithmMemberHttpHeader: "x-amz-sdk-checksum-algorithm", requestChecksumRequired: false, }), getThrow200ExceptionsPlugin(config), diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddHttpChecksumDependency.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddHttpChecksumDependency.java index ccf41e150e2e..60cc445817a8 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddHttpChecksumDependency.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddHttpChecksumDependency.java @@ -28,8 +28,11 @@ import software.amazon.smithy.codegen.core.SymbolProvider; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.HttpHeaderTrait; import software.amazon.smithy.typescript.codegen.LanguageTarget; import software.amazon.smithy.typescript.codegen.TypeScriptDependency; import software.amazon.smithy.typescript.codegen.TypeScriptSettings; @@ -201,6 +204,15 @@ private static Map getPluginFunctionParams( params.put("requestChecksumRequired", httpChecksumTrait.isRequestChecksumRequired()); httpChecksumTrait.getRequestAlgorithmMember().ifPresent(requestAlgorithmMember -> { params.put("requestAlgorithmMember", requestAlgorithmMember); + + // We know that input shape is structure, and contains requestAlgorithmMember. + StructureShape inputShape = model.expectShape(operation.getInput().get(), StructureShape.class); + MemberShape requestAlgorithmMemberShape = inputShape.getAllMembers().get(requestAlgorithmMember); + + // Set requestAlgorithmMemberHttpHeader if HttpHeaderTrait is present. + requestAlgorithmMemberShape.getTrait(HttpHeaderTrait.class).ifPresent(httpHeaderTrait -> { + params.put("requestAlgorithmMemberHttpHeader", httpHeaderTrait.getValue()); + }); }); httpChecksumTrait.getRequestValidationModeMember().ifPresent(requestValidationModeMember -> { params.put("requestValidationModeMember", requestValidationModeMember); diff --git a/packages/middleware-flexible-checksums/src/flexibleChecksumsMiddleware.ts b/packages/middleware-flexible-checksums/src/flexibleChecksumsMiddleware.ts index 317537dd9ab7..bc3d6308851d 100644 --- a/packages/middleware-flexible-checksums/src/flexibleChecksumsMiddleware.ts +++ b/packages/middleware-flexible-checksums/src/flexibleChecksumsMiddleware.ts @@ -30,6 +30,12 @@ export interface FlexibleChecksumsRequestMiddlewareConfig { * Defines a top-level operation input member that is used to configure request checksum behavior. */ requestAlgorithmMember?: string; + + /** + * The {@link httpHeader} value for {@link requestAlgorithmMember}, if present. + * {@link https://smithy.io/2.0/spec/http-bindings.html#httpheader-trait httpHeader} + */ + requestAlgorithmMemberHttpHeader?: string; } export const flexibleChecksumsMiddlewareOptions: BuildHandlerOptions = {