From 892336a9e4d2cb8640c6812785ecb391dcdc2848 Mon Sep 17 00:00:00 2001 From: 0marperez <60363173+0marperez@users.noreply.github.com> Date: Tue, 23 Jan 2024 12:04:22 -0500 Subject: [PATCH] fix: override signing config for s3 control (#1188) --- .changes/8147aee6-9f81-40cc-965e-9867044439b9.json | 9 +++++++++ .../kotlin/codegen/customization/s3/S3SigningConfig.kt | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .changes/8147aee6-9f81-40cc-965e-9867044439b9.json diff --git a/.changes/8147aee6-9f81-40cc-965e-9867044439b9.json b/.changes/8147aee6-9f81-40cc-965e-9867044439b9.json new file mode 100644 index 00000000000..aaefe3e1a4c --- /dev/null +++ b/.changes/8147aee6-9f81-40cc-965e-9867044439b9.json @@ -0,0 +1,9 @@ +{ + "id": "8147aee6-9f81-40cc-965e-9867044439b9", + "type": "bugfix", + "description": "Add missing `x-amz-content-sha256` header for SigV4 requests.", + "issues": [ + "awslabs/aws-sdk-kotlin#1187" + ], + "module": "s3control" +} \ No newline at end of file diff --git a/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/s3/S3SigningConfig.kt b/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/s3/S3SigningConfig.kt index b87d8a5e678..982aff4a85c 100644 --- a/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/s3/S3SigningConfig.kt +++ b/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/s3/S3SigningConfig.kt @@ -24,8 +24,10 @@ class S3SigningConfig : KotlinIntegration { override val order: Byte get() = 127 - override fun enabledForService(model: Model, settings: KotlinSettings) = - model.expectShape(settings.service).isS3 + override fun enabledForService(model: Model, settings: KotlinSettings): Boolean { + val service = model.expectShape(settings.service) + return (service.isS3 || service.isS3Control) + } override val sectionWriters: List get() = listOf(