AWS SDK

AWS SDK

rev. d03dc2cbf92e42a76d74caf3e8c12a8b87f47120..f84e6e4d36613aa6afc08892fa5cf996e7b3fbae

Files changed:

tmp-codegen-diff/services/codebuild/build.gradle.kts

@@ -1,1 +60,60 @@
    1      1   
    2      2   
description = "The AWS SDK for Kotlin client for CodeBuild"
    3      3   
project.ext.set("aws.sdk.id", "CodeBuild")
    4      4   
    5      5   
kotlin {
    6      6   
    sourceSets {
    7      7   
        commonMain {
    8      8   
            dependencies {
    9         -
                implementation("aws.smithy.kotlin:aws-credentials:1.4.10-SNAPSHOT")
           9  +
                implementation("aws.smithy.kotlin:aws-credentials:1.4.4-SNAPSHOT")
   10     10   
                implementation(project(":aws-runtime:aws-http"))
   11         -
                implementation("aws.smithy.kotlin:aws-json-protocols:1.4.10-SNAPSHOT")
   12         -
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.10-SNAPSHOT")
   13         -
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.10-SNAPSHOT")
   14         -
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.10-SNAPSHOT")
   15         -
                implementation("aws.smithy.kotlin:http:1.4.10-SNAPSHOT")
   16         -
                implementation("aws.smithy.kotlin:http-auth:1.4.10-SNAPSHOT")
   17         -
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.10-SNAPSHOT")
   18         -
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.10-SNAPSHOT")
   19         -
                implementation("aws.smithy.kotlin:identity-api:1.4.10-SNAPSHOT")
          11  +
                implementation("aws.smithy.kotlin:aws-json-protocols:1.4.4-SNAPSHOT")
          12  +
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.4-SNAPSHOT")
          13  +
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.4-SNAPSHOT")
          14  +
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.4-SNAPSHOT")
          15  +
                implementation("aws.smithy.kotlin:http:1.4.4-SNAPSHOT")
          16  +
                implementation("aws.smithy.kotlin:http-auth:1.4.4-SNAPSHOT")
          17  +
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.4-SNAPSHOT")
          18  +
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.4-SNAPSHOT")
          19  +
                implementation("aws.smithy.kotlin:identity-api:1.4.4-SNAPSHOT")
   20     20   
                implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
   21         -
                implementation("aws.smithy.kotlin:serde:1.4.10-SNAPSHOT")
   22         -
                implementation("aws.smithy.kotlin:serde-json:1.4.10-SNAPSHOT")
   23         -
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.10-SNAPSHOT")
          21  +
                implementation("aws.smithy.kotlin:serde:1.4.4-SNAPSHOT")
          22  +
                implementation("aws.smithy.kotlin:serde-json:1.4.4-SNAPSHOT")
          23  +
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.4-SNAPSHOT")
   24     24   
                api(project(":aws-runtime:aws-config"))
   25     25   
                api(project(":aws-runtime:aws-core"))
   26     26   
                api(project(":aws-runtime:aws-endpoint"))
   27         -
                api("aws.smithy.kotlin:http-client:1.4.10-SNAPSHOT")
   28         -
                api("aws.smithy.kotlin:runtime-core:1.4.10-SNAPSHOT")
   29         -
                api("aws.smithy.kotlin:smithy-client:1.4.10-SNAPSHOT")
   30         -
                api("aws.smithy.kotlin:telemetry-api:1.4.10-SNAPSHOT")
          27  +
                api("aws.smithy.kotlin:http-client:1.4.4-SNAPSHOT")
          28  +
                api("aws.smithy.kotlin:runtime-core:1.4.4-SNAPSHOT")
          29  +
                api("aws.smithy.kotlin:smithy-client:1.4.4-SNAPSHOT")
          30  +
                api("aws.smithy.kotlin:telemetry-api:1.4.4-SNAPSHOT")
   31     31   
            }
   32     32   
        }
   33     33   
    }
   34     34   
   35     35   
    jvm {
   36     36   
        compilations {
   37     37   
            val mainPath = getByName("main").output.classesDirs
   38     38   
            val testPath = getByName("test").output.classesDirs
   39     39   
            tasks {
   40     40   
                register<Jar>("smokeTestJar") {

tmp-codegen-diff/services/dynamodb/build.gradle.kts

@@ -1,1 +60,60 @@
    1      1   
    2      2   
description = "The AWS SDK for Kotlin client for DynamoDB"
    3      3   
project.ext.set("aws.sdk.id", "DynamoDB")
    4      4   
    5      5   
kotlin {
    6      6   
    sourceSets {
    7      7   
        commonMain {
    8      8   
            dependencies {
    9         -
                implementation("aws.smithy.kotlin:aws-credentials:1.4.10-SNAPSHOT")
           9  +
                implementation("aws.smithy.kotlin:aws-credentials:1.4.4-SNAPSHOT")
   10     10   
                implementation(project(":aws-runtime:aws-http"))
   11         -
                implementation("aws.smithy.kotlin:aws-json-protocols:1.4.10-SNAPSHOT")
   12         -
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.10-SNAPSHOT")
   13         -
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.10-SNAPSHOT")
   14         -
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.10-SNAPSHOT")
   15         -
                implementation("aws.smithy.kotlin:http:1.4.10-SNAPSHOT")
   16         -
                implementation("aws.smithy.kotlin:http-auth:1.4.10-SNAPSHOT")
   17         -
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.10-SNAPSHOT")
   18         -
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.10-SNAPSHOT")
   19         -
                implementation("aws.smithy.kotlin:identity-api:1.4.10-SNAPSHOT")
          11  +
                implementation("aws.smithy.kotlin:aws-json-protocols:1.4.4-SNAPSHOT")
          12  +
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.4-SNAPSHOT")
          13  +
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.4-SNAPSHOT")
          14  +
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.4-SNAPSHOT")
          15  +
                implementation("aws.smithy.kotlin:http:1.4.4-SNAPSHOT")
          16  +
                implementation("aws.smithy.kotlin:http-auth:1.4.4-SNAPSHOT")
          17  +
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.4-SNAPSHOT")
          18  +
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.4-SNAPSHOT")
          19  +
                implementation("aws.smithy.kotlin:identity-api:1.4.4-SNAPSHOT")
   20     20   
                implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
   21         -
                implementation("aws.smithy.kotlin:serde:1.4.10-SNAPSHOT")
   22         -
                implementation("aws.smithy.kotlin:serde-json:1.4.10-SNAPSHOT")
   23         -
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.10-SNAPSHOT")
          21  +
                implementation("aws.smithy.kotlin:serde:1.4.4-SNAPSHOT")
          22  +
                implementation("aws.smithy.kotlin:serde-json:1.4.4-SNAPSHOT")
          23  +
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.4-SNAPSHOT")
   24     24   
                api(project(":aws-runtime:aws-config"))
   25     25   
                api(project(":aws-runtime:aws-core"))
   26     26   
                api(project(":aws-runtime:aws-endpoint"))
   27         -
                api("aws.smithy.kotlin:http-client:1.4.10-SNAPSHOT")
   28         -
                api("aws.smithy.kotlin:runtime-core:1.4.10-SNAPSHOT")
   29         -
                api("aws.smithy.kotlin:smithy-client:1.4.10-SNAPSHOT")
   30         -
                api("aws.smithy.kotlin:telemetry-api:1.4.10-SNAPSHOT")
          27  +
                api("aws.smithy.kotlin:http-client:1.4.4-SNAPSHOT")
          28  +
                api("aws.smithy.kotlin:runtime-core:1.4.4-SNAPSHOT")
          29  +
                api("aws.smithy.kotlin:smithy-client:1.4.4-SNAPSHOT")
          30  +
                api("aws.smithy.kotlin:telemetry-api:1.4.4-SNAPSHOT")
   31     31   
            }
   32     32   
        }
   33     33   
    }
   34     34   
   35     35   
    jvm {
   36     36   
        compilations {
   37     37   
            val mainPath = getByName("main").output.classesDirs
   38     38   
            val testPath = getByName("test").output.classesDirs
   39     39   
            tasks {
   40     40   
                register<Jar>("smokeTestJar") {

tmp-codegen-diff/services/ec2/build.gradle.kts

@@ -1,1 +61,61 @@
    1      1   
    2      2   
description = "The AWS SDK for Kotlin client for EC2"
    3      3   
project.ext.set("aws.sdk.id", "EC2")
    4      4   
    5      5   
kotlin {
    6      6   
    sourceSets {
    7      7   
        commonMain {
    8      8   
            dependencies {
    9         -
                implementation("aws.smithy.kotlin:aws-credentials:1.4.10-SNAPSHOT")
           9  +
                implementation("aws.smithy.kotlin:aws-credentials:1.4.4-SNAPSHOT")
   10     10   
                implementation(project(":aws-runtime:aws-http"))
   11         -
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.10-SNAPSHOT")
   12         -
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.10-SNAPSHOT")
   13         -
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.10-SNAPSHOT")
   14         -
                implementation("aws.smithy.kotlin:aws-xml-protocols:1.4.10-SNAPSHOT")
   15         -
                implementation("aws.smithy.kotlin:http:1.4.10-SNAPSHOT")
   16         -
                implementation("aws.smithy.kotlin:http-auth:1.4.10-SNAPSHOT")
   17         -
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.10-SNAPSHOT")
   18         -
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.10-SNAPSHOT")
   19         -
                implementation("aws.smithy.kotlin:identity-api:1.4.10-SNAPSHOT")
          11  +
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.4-SNAPSHOT")
          12  +
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.4-SNAPSHOT")
          13  +
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.4-SNAPSHOT")
          14  +
                implementation("aws.smithy.kotlin:aws-xml-protocols:1.4.4-SNAPSHOT")
          15  +
                implementation("aws.smithy.kotlin:http:1.4.4-SNAPSHOT")
          16  +
                implementation("aws.smithy.kotlin:http-auth:1.4.4-SNAPSHOT")
          17  +
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.4-SNAPSHOT")
          18  +
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.4-SNAPSHOT")
          19  +
                implementation("aws.smithy.kotlin:identity-api:1.4.4-SNAPSHOT")
   20     20   
                implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
   21         -
                implementation("aws.smithy.kotlin:serde:1.4.10-SNAPSHOT")
   22         -
                implementation("aws.smithy.kotlin:serde-form-url:1.4.10-SNAPSHOT")
   23         -
                implementation("aws.smithy.kotlin:serde-xml:1.4.10-SNAPSHOT")
   24         -
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.10-SNAPSHOT")
          21  +
                implementation("aws.smithy.kotlin:serde:1.4.4-SNAPSHOT")
          22  +
                implementation("aws.smithy.kotlin:serde-form-url:1.4.4-SNAPSHOT")
          23  +
                implementation("aws.smithy.kotlin:serde-xml:1.4.4-SNAPSHOT")
          24  +
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.4-SNAPSHOT")
   25     25   
                api(project(":aws-runtime:aws-config"))
   26     26   
                api(project(":aws-runtime:aws-core"))
   27     27   
                api(project(":aws-runtime:aws-endpoint"))
   28         -
                api("aws.smithy.kotlin:http-client:1.4.10-SNAPSHOT")
   29         -
                api("aws.smithy.kotlin:runtime-core:1.4.10-SNAPSHOT")
   30         -
                api("aws.smithy.kotlin:smithy-client:1.4.10-SNAPSHOT")
   31         -
                api("aws.smithy.kotlin:telemetry-api:1.4.10-SNAPSHOT")
          28  +
                api("aws.smithy.kotlin:http-client:1.4.4-SNAPSHOT")
          29  +
                api("aws.smithy.kotlin:runtime-core:1.4.4-SNAPSHOT")
          30  +
                api("aws.smithy.kotlin:smithy-client:1.4.4-SNAPSHOT")
          31  +
                api("aws.smithy.kotlin:telemetry-api:1.4.4-SNAPSHOT")
   32     32   
            }
   33     33   
        }
   34     34   
    }
   35     35   
   36     36   
    jvm {
   37     37   
        compilations {
   38     38   
            val mainPath = getByName("main").output.classesDirs
   39     39   
            val testPath = getByName("test").output.classesDirs
   40     40   
            tasks {
   41     41   
                register<Jar>("smokeTestJar") {

tmp-codegen-diff/services/polly/build.gradle.kts

@@ -1,1 +60,60 @@
    1      1   
    2      2   
description = "The AWS SDK for Kotlin client for Polly"
    3      3   
project.ext.set("aws.sdk.id", "Polly")
    4      4   
    5      5   
kotlin {
    6      6   
    sourceSets {
    7      7   
        commonMain {
    8      8   
            dependencies {
    9         -
                implementation("aws.smithy.kotlin:aws-credentials:1.4.10-SNAPSHOT")
           9  +
                implementation("aws.smithy.kotlin:aws-credentials:1.4.4-SNAPSHOT")
   10     10   
                implementation(project(":aws-runtime:aws-http"))
   11         -
                implementation("aws.smithy.kotlin:aws-json-protocols:1.4.10-SNAPSHOT")
   12         -
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.10-SNAPSHOT")
   13         -
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.10-SNAPSHOT")
   14         -
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.10-SNAPSHOT")
   15         -
                implementation("aws.smithy.kotlin:http:1.4.10-SNAPSHOT")
   16         -
                implementation("aws.smithy.kotlin:http-auth:1.4.10-SNAPSHOT")
   17         -
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.10-SNAPSHOT")
   18         -
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.10-SNAPSHOT")
   19         -
                implementation("aws.smithy.kotlin:identity-api:1.4.10-SNAPSHOT")
          11  +
                implementation("aws.smithy.kotlin:aws-json-protocols:1.4.4-SNAPSHOT")
          12  +
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.4-SNAPSHOT")
          13  +
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.4-SNAPSHOT")
          14  +
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.4-SNAPSHOT")
          15  +
                implementation("aws.smithy.kotlin:http:1.4.4-SNAPSHOT")
          16  +
                implementation("aws.smithy.kotlin:http-auth:1.4.4-SNAPSHOT")
          17  +
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.4-SNAPSHOT")
          18  +
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.4-SNAPSHOT")
          19  +
                implementation("aws.smithy.kotlin:identity-api:1.4.4-SNAPSHOT")
   20     20   
                implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
   21         -
                implementation("aws.smithy.kotlin:serde:1.4.10-SNAPSHOT")
   22         -
                implementation("aws.smithy.kotlin:serde-json:1.4.10-SNAPSHOT")
   23         -
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.10-SNAPSHOT")
          21  +
                implementation("aws.smithy.kotlin:serde:1.4.4-SNAPSHOT")
          22  +
                implementation("aws.smithy.kotlin:serde-json:1.4.4-SNAPSHOT")
          23  +
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.4-SNAPSHOT")
   24     24   
                api(project(":aws-runtime:aws-config"))
   25     25   
                api(project(":aws-runtime:aws-core"))
   26     26   
                api(project(":aws-runtime:aws-endpoint"))
   27         -
                api("aws.smithy.kotlin:http-client:1.4.10-SNAPSHOT")
   28         -
                api("aws.smithy.kotlin:runtime-core:1.4.10-SNAPSHOT")
   29         -
                api("aws.smithy.kotlin:smithy-client:1.4.10-SNAPSHOT")
   30         -
                api("aws.smithy.kotlin:telemetry-api:1.4.10-SNAPSHOT")
          27  +
                api("aws.smithy.kotlin:http-client:1.4.4-SNAPSHOT")
          28  +
                api("aws.smithy.kotlin:runtime-core:1.4.4-SNAPSHOT")
          29  +
                api("aws.smithy.kotlin:smithy-client:1.4.4-SNAPSHOT")
          30  +
                api("aws.smithy.kotlin:telemetry-api:1.4.4-SNAPSHOT")
   31     31   
            }
   32     32   
        }
   33     33   
        commonTest {
   34     34   
            dependencies {
   35     35   
                implementation("org.jetbrains.kotlin:kotlin-test:2.1.0")
   36     36   
            }
   37     37   
        }
   38     38   
    }
   39     39   
   40     40   
    jvm {

tmp-codegen-diff/services/s3/build.gradle.kts

@@ -1,1 +41,41 @@
    1      1   
    2      2   
description = "The AWS SDK for Kotlin client for S3"
    3      3   
project.ext.set("aws.sdk.id", "S3")
    4      4   
    5      5   
kotlin {
    6      6   
    sourceSets {
    7      7   
        commonMain {
    8      8   
            dependencies {
    9         -
                implementation("aws.smithy.kotlin:aws-credentials:1.4.10-SNAPSHOT")
   10         -
                implementation("aws.smithy.kotlin:aws-event-stream:1.4.10-SNAPSHOT")
           9  +
                implementation("aws.smithy.kotlin:aws-credentials:1.4.4-SNAPSHOT")
          10  +
                implementation("aws.smithy.kotlin:aws-event-stream:1.4.4-SNAPSHOT")
   11     11   
                implementation(project(":aws-runtime:aws-http"))
   12         -
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.10-SNAPSHOT")
   13         -
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.10-SNAPSHOT")
   14         -
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.10-SNAPSHOT")
   15         -
                implementation("aws.smithy.kotlin:aws-xml-protocols:1.4.10-SNAPSHOT")
   16         -
                implementation("aws.smithy.kotlin:http:1.4.10-SNAPSHOT")
   17         -
                implementation("aws.smithy.kotlin:http-auth:1.4.10-SNAPSHOT")
   18         -
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.10-SNAPSHOT")
   19         -
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.10-SNAPSHOT")
   20         -
                implementation("aws.smithy.kotlin:identity-api:1.4.10-SNAPSHOT")
          12  +
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.4-SNAPSHOT")
          13  +
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.4-SNAPSHOT")
          14  +
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.4-SNAPSHOT")
          15  +
                implementation("aws.smithy.kotlin:aws-xml-protocols:1.4.4-SNAPSHOT")
          16  +
                implementation("aws.smithy.kotlin:http:1.4.4-SNAPSHOT")
          17  +
                implementation("aws.smithy.kotlin:http-auth:1.4.4-SNAPSHOT")
          18  +
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.4-SNAPSHOT")
          19  +
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.4-SNAPSHOT")
          20  +
                implementation("aws.smithy.kotlin:identity-api:1.4.4-SNAPSHOT")
   21     21   
                implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
   22         -
                implementation("aws.smithy.kotlin:serde:1.4.10-SNAPSHOT")
   23         -
                implementation("aws.smithy.kotlin:serde-xml:1.4.10-SNAPSHOT")
   24         -
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.10-SNAPSHOT")
          22  +
                implementation("aws.smithy.kotlin:serde:1.4.4-SNAPSHOT")
          23  +
                implementation("aws.smithy.kotlin:serde-xml:1.4.4-SNAPSHOT")
          24  +
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.4-SNAPSHOT")
   25     25   
                api(project(":aws-runtime:aws-config"))
   26     26   
                api(project(":aws-runtime:aws-core"))
   27     27   
                api(project(":aws-runtime:aws-endpoint"))
   28         -
                api("aws.smithy.kotlin:http-client:1.4.10-SNAPSHOT")
   29         -
                api("aws.smithy.kotlin:runtime-core:1.4.10-SNAPSHOT")
   30         -
                api("aws.smithy.kotlin:smithy-client:1.4.10-SNAPSHOT")
   31         -
                api("aws.smithy.kotlin:telemetry-api:1.4.10-SNAPSHOT")
          28  +
                api("aws.smithy.kotlin:http-client:1.4.4-SNAPSHOT")
          29  +
                api("aws.smithy.kotlin:runtime-core:1.4.4-SNAPSHOT")
          30  +
                api("aws.smithy.kotlin:smithy-client:1.4.4-SNAPSHOT")
          31  +
                api("aws.smithy.kotlin:telemetry-api:1.4.4-SNAPSHOT")
   32     32   
            }
   33     33   
        }
   34     34   
        commonTest {
   35     35   
            dependencies {
   36     36   
                implementation("org.jetbrains.kotlin:kotlin-test:2.1.0")
   37         -
                implementation("aws.smithy.kotlin:smithy-test:1.4.10-SNAPSHOT")
          37  +
                implementation("aws.smithy.kotlin:smithy-test:1.4.4-SNAPSHOT")
   38     38   
            }
   39     39   
        }
   40     40   
    }
   41     41   
}

tmp-codegen-diff/services/sqs/common/src/aws.sdk.kotlin.services.sqs/SqsMd5ChecksumValidationInterceptor.kt

@@ -0,1 +0,344 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
package aws.sdk.kotlin.services.sqs
           6  +
           7  +
import aws.sdk.kotlin.services.sqs.internal.ValidationEnabled
           8  +
import aws.sdk.kotlin.services.sqs.internal.ValidationScope
           9  +
import aws.sdk.kotlin.services.sqs.model.*
          10  +
import aws.smithy.kotlin.runtime.client.ResponseInterceptorContext
          11  +
import aws.smithy.kotlin.runtime.hashing.md5
          12  +
import aws.smithy.kotlin.runtime.http.interceptors.ChecksumMismatchException
          13  +
import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
          14  +
import aws.smithy.kotlin.runtime.http.request.HttpRequest
          15  +
import aws.smithy.kotlin.runtime.http.response.HttpResponse
          16  +
import aws.smithy.kotlin.runtime.io.SdkBuffer
          17  +
import aws.smithy.kotlin.runtime.telemetry.logging.Logger
          18  +
import aws.smithy.kotlin.runtime.telemetry.logging.logger
          19  +
          20  +
/**
          21  +
 * Interceptor that validates MD5 checksums for SQS message operations.
          22  +
 *
          23  +
 * This interceptor performs client-side validation of MD5 checksums returned by SQS to ensure
          24  +
 * message integrity during transmission. It validates the following components:
          25  +
 * - Message body
          26  +
 * - Message attributes
          27  +
 * - Message system attributes
          28  +
 *
          29  +
 * The validation behavior can be configured using:
          30  +
 * - [checksumValidationEnabled] - Controls when validation occurs (ALWAYS, WHEN_SENDING, WHEN_RECEIVING, NEVER)
          31  +
 * - [checksumValidationScopes] - Specifies which message components to validate
          32  +
 *
          33  +
 * Supported operations:
          34  +
 * - SendMessage
          35  +
 * - SendMessageBatch
          36  +
 * - ReceiveMessage
          37  +
 */
          38  +
@OptIn(ExperimentalStdlibApi::class)
          39  +
public class SqsMd5ChecksumValidationInterceptor(
          40  +
    private val validationEnabled: ValidationEnabled?,
          41  +
    private val validationScopes: Set<ValidationScope>,
          42  +
) : HttpInterceptor {
          43  +
    public companion object {
          44  +
        private const val STRING_TYPE_FIELD_INDEX: Byte = 1
          45  +
        private const val BINARY_TYPE_FIELD_INDEX: Byte = 2
          46  +
        private const val STRING_LIST_TYPE_FIELD_INDEX: Byte = 3
          47  +
        private const val BINARY_LIST_TYPE_FIELD_INDEX: Byte = 4
          48  +
    }
          49  +
          50  +
    override fun readAfterExecution(context: ResponseInterceptorContext<Any, Any, HttpRequest?, HttpResponse?>) {
          51  +
        if (validationEnabled == ValidationEnabled.NEVER) return
          52  +
          53  +
        val logger = context.executionContext.coroutineContext.logger<SqsMd5ChecksumValidationInterceptor>()
          54  +
          55  +
        // Test MD5 availability
          56  +
        try {
          57  +
            "MD5".encodeToByteArray().md5()
          58  +
        } catch (e: Exception) {
          59  +
            logger.error { "MD5 checksums are not available (likely due to FIPS mode). Checksum validation will be disabled." }
          60  +
            return
          61  +
        }
          62  +
          63  +
        val request = context.request
          64  +
        val response = context.response.getOrNull()
          65  +
          66  +
        if (response != null) {
          67  +
            when (request) {
          68  +
                is SendMessageRequest -> {
          69  +
                    if (validationEnabled == ValidationEnabled.WHEN_RECEIVING) return
          70  +
          71  +
                    val sendMessageRequest = request as SendMessageRequest
          72  +
                    val sendMessageResponse = response as SendMessageResponse
          73  +
                    sendMessageOperationMd5Check(sendMessageRequest, sendMessageResponse, logger)
          74  +
                }
          75  +
          76  +
                is ReceiveMessageRequest -> {
          77  +
                    if (validationEnabled == ValidationEnabled.WHEN_SENDING) return
          78  +
          79  +
                    val receiveMessageResponse = response as ReceiveMessageResponse
          80  +
                    receiveMessageResultMd5Check(receiveMessageResponse, logger)
          81  +
                }
          82  +
          83  +
                is SendMessageBatchRequest -> {
          84  +
                    if (validationEnabled == ValidationEnabled.WHEN_RECEIVING) return
          85  +
          86  +
                    val sendMessageBatchRequest = request as SendMessageBatchRequest
          87  +
                    val sendMessageBatchResponse = response as SendMessageBatchResponse
          88  +
                    sendMessageBatchOperationMd5Check(sendMessageBatchRequest, sendMessageBatchResponse, logger)
          89  +
                }
          90  +
            }
          91  +
        }
          92  +
    }
          93  +
          94  +
    private fun sendMessageOperationMd5Check(
          95  +
        sendMessageRequest: SendMessageRequest,
          96  +
        sendMessageResponse: SendMessageResponse,
          97  +
        logger: Logger,
          98  +
    ) {
          99  +
        if (validationScopes.contains(ValidationScope.MESSAGE_BODY)) {
         100  +
            val messageBodySent = sendMessageRequest.messageBody
         101  +
         102  +
            if (!messageBodySent.isNullOrEmpty()) {
         103  +
                logger.debug { "Validating message body MD5 checksum for SendMessage" }
         104  +
         105  +
                val bodyMD5Returned = sendMessageResponse.md5OfMessageBody
         106  +
                val clientSideBodyMd5 = calculateMessageBodyMd5(messageBodySent)
         107  +
                if (clientSideBodyMd5 != bodyMD5Returned) {
         108  +
                    throw ChecksumMismatchException("Checksum mismatch. Expected $clientSideBodyMd5 but was $bodyMD5Returned")
         109  +
                }
         110  +
         111  +
                logger.debug { "Message body MD5 checksum for SendMessage validated" }
         112  +
            }
         113  +
        }
         114  +
         115  +
        if (validationScopes.contains(ValidationScope.MESSAGE_ATTRIBUTES)) {
         116  +
            val messageAttrSent = sendMessageRequest.messageAttributes
         117  +
            if (!messageAttrSent.isNullOrEmpty()) {
         118  +
                logger.debug { "Validating message attribute MD5 checksum for SendMessage" }
         119  +
         120  +
                val messageAttrMD5Returned = sendMessageResponse.md5OfMessageAttributes
         121  +
                val clientSideAttrMd5 = calculateMessageAttributesMd5(messageAttrSent)
         122  +
                if (clientSideAttrMd5 != messageAttrMD5Returned) {
         123  +
                    throw ChecksumMismatchException("Checksum mismatch. Expected $clientSideAttrMd5 but was $messageAttrMD5Returned")
         124  +
                }
         125  +
         126  +
                logger.debug { "Message attribute MD5 checksum for SendMessage validated" }
         127  +
            }
         128  +
        }
         129  +
         130  +
        if (validationScopes.contains(ValidationScope.MESSAGE_SYSTEM_ATTRIBUTES)) {
         131  +
            val messageSysAttrSent = sendMessageRequest.messageSystemAttributes
         132  +
            if (!messageSysAttrSent.isNullOrEmpty()) {
         133  +
                logger.debug { "Validating message system attribute MD5 checksum for SendMessage" }
         134  +
         135  +
                val messageSysAttrMD5Returned = sendMessageResponse.md5OfMessageSystemAttributes
         136  +
                val clientSideSysAttrMd5 = calculateMessageSystemAttributesMd5(messageSysAttrSent)
         137  +
                if (clientSideSysAttrMd5 != messageSysAttrMD5Returned) {
         138  +
                    throw ChecksumMismatchException("Checksum mismatch. Expected $clientSideSysAttrMd5 but was $messageSysAttrMD5Returned")
         139  +
                }
         140  +
         141  +
                logger.debug { "Message system attribute MD5 checksum for SendMessage validated" }
         142  +
            }
         143  +
        }
         144  +
    }
         145  +
         146  +
    private fun receiveMessageResultMd5Check(receiveMessageResponse: ReceiveMessageResponse, logger: Logger) {
         147  +
        receiveMessageResponse.messages?.forEach { messageReceived ->
         148  +
            if (validationScopes.contains(ValidationScope.MESSAGE_BODY)) {
         149  +
                val messageBody = messageReceived.body
         150  +
                if (!messageBody.isNullOrEmpty()) {
         151  +
                    logger.debug { "Validating message body MD5 checksum for ReceiveMessage" }
         152  +
         153  +
                    val bodyMd5Returned = messageReceived.md5OfBody
         154  +
                    val clientSideBodyMd5 = calculateMessageBodyMd5(messageBody)
         155  +
                    if (clientSideBodyMd5 != bodyMd5Returned) {
         156  +
                        throw ChecksumMismatchException("Checksum mismatch. Expected $clientSideBodyMd5 but was $bodyMd5Returned")
         157  +
                    }
         158  +
         159  +
                    logger.debug { "Message body MD5 checksum for ReceiveMessage validated " }
         160  +
                }
         161  +
            }
         162  +
         163  +
            if (validationScopes.contains(ValidationScope.MESSAGE_ATTRIBUTES)) {
         164  +
                val messageAttr = messageReceived.messageAttributes
         165  +
         166  +
                if (!messageAttr.isNullOrEmpty()) {
         167  +
                    logger.debug { "Validating message attribute MD5 checksum for ReceiveMessage" }
         168  +
         169  +
                    val attrMd5Returned = messageReceived.md5OfMessageAttributes
         170  +
                    val clientSideAttrMd5 = calculateMessageAttributesMd5(messageAttr)
         171  +
                    if (clientSideAttrMd5 != attrMd5Returned) {
         172  +
                        throw ChecksumMismatchException("Checksum mismatch. Expected $clientSideAttrMd5 but was $attrMd5Returned")
         173  +
                    }
         174  +
         175  +
                    logger.debug { "Message attribute MD5 checksum for ReceiveMessage validated " }
         176  +
                }
         177  +
            }
         178  +
        }
         179  +
    }
         180  +
         181  +
    private fun sendMessageBatchOperationMd5Check(
         182  +
        sendMessageBatchRequest: SendMessageBatchRequest,
         183  +
        sendMessageBatchResponse: SendMessageBatchResponse,
         184  +
        logger: Logger,
         185  +
    ) {
         186  +
        val idToRequestEntryMap = sendMessageBatchRequest
         187  +
            .entries
         188  +
            .orEmpty()
         189  +
            .associateBy { it.id }
         190  +
         191  +
        for (entry in sendMessageBatchResponse.successful) {
         192  +
            if (validationScopes.contains(ValidationScope.MESSAGE_BODY)) {
         193  +
                val messageBody = idToRequestEntryMap[entry.id]?.messageBody
         194  +
         195  +
                if (!messageBody.isNullOrEmpty()) {
         196  +
                    logger.debug { "Validating message body MD5 checksum for SendMessageBatch: ${entry.messageId}" }
         197  +
         198  +
                    val bodyMd5Returned = entry.md5OfMessageBody
         199  +
                    val clientSideBodyMd5 = calculateMessageBodyMd5(messageBody)
         200  +
                    if (clientSideBodyMd5 != bodyMd5Returned) {
         201  +
                        throw ChecksumMismatchException("Checksum mismatch. Expected $clientSideBodyMd5 but was $bodyMd5Returned")
         202  +
                    }
         203  +
         204  +
                    logger.debug { "Message body MD5 checksum for SendMessageBatch: ${entry.messageId} validated" }
         205  +
                }
         206  +
            }
         207  +
         208  +
            if (validationScopes.contains(ValidationScope.MESSAGE_ATTRIBUTES)) {
         209  +
                val messageAttrSent = idToRequestEntryMap[entry.id]?.messageAttributes
         210  +
                if (!messageAttrSent.isNullOrEmpty()) {
         211  +
                    logger.debug { "Validating message attribute MD5 checksum for SendMessageBatch: ${entry.messageId}" }
         212  +
         213  +
                    val messageAttrMD5Returned = entry.md5OfMessageAttributes
         214  +
                    val clientSideAttrMd5 = calculateMessageAttributesMd5(messageAttrSent)
         215  +
                    if (clientSideAttrMd5 != messageAttrMD5Returned) {
         216  +
                        throw ChecksumMismatchException("Checksum mismatch. Expected $clientSideAttrMd5 but was $messageAttrMD5Returned")
         217  +
                    }
         218  +
         219  +
                    logger.debug { "Message attribute MD5 checksum for SendMessageBatch: ${entry.messageId} validated" }
         220  +
                }
         221  +
            }
         222  +
         223  +
            if (validationScopes.contains(ValidationScope.MESSAGE_SYSTEM_ATTRIBUTES)) {
         224  +
                val messageSysAttrSent = idToRequestEntryMap[entry.id]?.messageSystemAttributes
         225  +
                if (!messageSysAttrSent.isNullOrEmpty()) {
         226  +
                    logger.debug { "Validating message system attribute MD5 checksum for SendMessageBatch: ${entry.messageId}" }
         227  +
         228  +
                    val messageSysAttrMD5Returned = entry.md5OfMessageSystemAttributes
         229  +
                    val clientSideSysAttrMd5 = calculateMessageSystemAttributesMd5(messageSysAttrSent)
         230  +
                    if (clientSideSysAttrMd5 != messageSysAttrMD5Returned) {
         231  +
                        throw ChecksumMismatchException("Checksum mismatch. Expected $clientSideSysAttrMd5 but was $messageSysAttrMD5Returned")
         232  +
                    }
         233  +
         234  +
                    logger.debug { "Message system attribute MD5 checksum for SendMessageBatch: ${entry.messageId} validated" }
         235  +
                }
         236  +
            }
         237  +
        }
         238  +
    }
         239  +
         240  +
    private fun calculateMessageBodyMd5(messageBody: String): String {
         241  +
        val expectedMD5 = messageBody.encodeToByteArray().md5()
         242  +
        val expectedMD5Hex = expectedMD5.toHexString()
         243  +
         244  +
        return expectedMD5Hex
         245  +
    }
         246  +
         247  +
    /**
         248  +
     * Calculates the MD5 digest for message attributes according to SQS specifications.
         249  +
     * https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-attributes-md5-message-digest-calculation
         250  +
     */
         251  +
    private fun calculateMessageAttributesMd5(messageAttributes: Map<String, MessageAttributeValue>): String {
         252  +
        val buffer = SdkBuffer()
         253  +
         254  +
        messageAttributes
         255  +
            .entries
         256  +
            .sortedBy { (name, _) -> name }
         257  +
            .forEach { (attributeName, attributeValue) ->
         258  +
                updateLengthAndBytes(buffer, attributeName)
         259  +
         260  +
                updateLengthAndBytes(buffer, attributeValue.dataType)
         261  +
         262  +
                val stringValue = attributeValue.stringValue
         263  +
                val binaryValue = attributeValue.binaryValue
         264  +
                val stringListValues = attributeValue.stringListValues
         265  +
                val binaryListValues = attributeValue.binaryListValues
         266  +
         267  +
                when {
         268  +
                    stringValue != null -> updateForStringType(buffer, stringValue)
         269  +
                    binaryValue != null -> updateForBinaryType(buffer, binaryValue)
         270  +
                    !stringListValues.isNullOrEmpty() -> updateForStringListType(buffer, stringListValues)
         271  +
                    !binaryListValues.isNullOrEmpty() -> updateForBinaryListType(buffer, binaryListValues)
         272  +
                }
         273  +
            }
         274  +
         275  +
        val payload = buffer.readByteArray()
         276  +
        return payload.md5().toHexString()
         277  +
    }
         278  +
         279  +
    private fun calculateMessageSystemAttributesMd5(
         280  +
        messageSysAttrs: Map<MessageSystemAttributeNameForSends, MessageSystemAttributeValue>,
         281  +
    ): String {
         282  +
        val buffer = SdkBuffer()
         283  +
         284  +
        messageSysAttrs
         285  +
            .entries
         286  +
            .sortedBy { (name, _) -> name.value }
         287  +
            .forEach { (attributeName, attributeValue) ->
         288  +
                updateLengthAndBytes(buffer, attributeName.value)
         289  +
         290  +
                updateLengthAndBytes(buffer, attributeValue.dataType)
         291  +
         292  +
                val stringValue = attributeValue.stringValue
         293  +
                val binaryValue = attributeValue.binaryValue
         294  +
                val stringListValues = attributeValue.stringListValues
         295  +
                val binaryListValues = attributeValue.binaryListValues
         296  +
         297  +
                when {
         298  +
                    stringValue != null -> updateForStringType(buffer, stringValue)
         299  +
                    binaryValue != null -> updateForBinaryType(buffer, binaryValue)
         300  +
                    !stringListValues.isNullOrEmpty() -> updateForStringListType(buffer, stringListValues)
         301  +
                    !binaryListValues.isNullOrEmpty() -> updateForBinaryListType(buffer, binaryListValues)
         302  +
                }
         303  +
            }
         304  +
         305  +
        val payload = buffer.readByteArray()
         306  +
        return payload.md5().toHexString()
         307  +
    }
         308  +
         309  +
    private fun updateForStringType(buffer: SdkBuffer, value: String) {
         310  +
        buffer.writeByte(STRING_TYPE_FIELD_INDEX)
         311  +
        updateLengthAndBytes(buffer, value)
         312  +
    }
         313  +
         314  +
    private fun updateForBinaryType(buffer: SdkBuffer, value: ByteArray) {
         315  +
        buffer.writeByte(BINARY_TYPE_FIELD_INDEX)
         316  +
        updateLengthAndBytes(buffer, value)
         317  +
    }
         318  +
         319  +
    private fun updateForStringListType(buffer: SdkBuffer, values: List<String>) {
         320  +
        buffer.writeByte(STRING_LIST_TYPE_FIELD_INDEX)
         321  +
        values.forEach { value ->
         322  +
            updateLengthAndBytes(buffer, value)
         323  +
        }
         324  +
    }
         325  +
         326  +
    private fun updateForBinaryListType(buffer: SdkBuffer, values: List<ByteArray>) {
         327  +
        buffer.writeByte(BINARY_LIST_TYPE_FIELD_INDEX)
         328  +
        values.forEach { value ->
         329  +
            updateLengthAndBytes(buffer, value)
         330  +
        }
         331  +
    }
         332  +
         333  +
    private fun updateLengthAndBytes(buffer: SdkBuffer, stringValue: String) =
         334  +
        updateLengthAndBytes(buffer, stringValue.encodeToByteArray())
         335  +
         336  +
    /**
         337  +
     * Update the digest using a sequence of bytes that consists of the length (in 4 bytes) of the
         338  +
     * input binaryValue and all the bytes it contains.
         339  +
     */
         340  +
    private fun updateLengthAndBytes(buffer: SdkBuffer, binaryValue: ByteArray) {
         341  +
        buffer.writeInt(binaryValue.size)
         342  +
        buffer.write(binaryValue)
         343  +
    }
         344  +
}

tmp-codegen-diff/services/sqs/common/src/aws.sdk.kotlin.services.sqs/internal/FinalizeSqsConfig.kt

@@ -0,1 +0,35 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
package aws.sdk.kotlin.services.sqs.internal
           6  +
           7  +
import aws.sdk.kotlin.runtime.config.profile.*
           8  +
import aws.sdk.kotlin.services.sqs.SqsClient
           9  +
import aws.smithy.kotlin.runtime.config.resolve
          10  +
import aws.smithy.kotlin.runtime.util.LazyAsyncValue
          11  +
import aws.smithy.kotlin.runtime.util.PlatformProvider
          12  +
          13  +
internal suspend fun finalizeSqsConfig(
          14  +
    builder: SqsClient.Builder,
          15  +
    sharedConfig: LazyAsyncValue<AwsSharedConfig>,
          16  +
    provider: PlatformProvider = PlatformProvider.System,
          17  +
) {
          18  +
    val activeProfile = sharedConfig.get().activeProfile
          19  +
    builder.config.checksumValidationEnabled = builder.config.checksumValidationEnabled
          20  +
        ?: SqsSetting.checksumValidationEnabled.resolve(provider)
          21  +
        ?: activeProfile.checksumValidationEnabled
          22  +
        ?: ValidationEnabled.NEVER // TODO: MD5 checksum validation is temporarily disabled. Set default to ALWAYS in next minor version
          23  +
          24  +
    builder.config.checksumValidationScopes = builder.config.checksumValidationScopes.ifEmpty {
          25  +
        SqsSetting.checksumValidationScopes.resolve(provider)
          26  +
            ?: activeProfile.checksumValidationScopes
          27  +
            ?: ValidationScope.entries.toSet()
          28  +
    }
          29  +
}
          30  +
          31  +
private val AwsProfile.checksumValidationEnabled: ValidationEnabled?
          32  +
    get() = getEnumOrNull<ValidationEnabled>("sqs_checksum_validation_enabled")
          33  +
          34  +
private val AwsProfile.checksumValidationScopes: Set<ValidationScope>?
          35  +
    get() = getEnumSetOrNull<ValidationScope>("sqs_checksum_validation_scope")

tmp-codegen-diff/services/sqs/common/src/aws.sdk.kotlin.services.sqs/internal/SqsSetting.kt

@@ -0,1 +0,49 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
package aws.sdk.kotlin.services.sqs.internal
           6  +
           7  +
import aws.smithy.kotlin.runtime.config.*
           8  +
           9  +
/**
          10  +
 * SQS specific system settings
          11  +
 */
          12  +
internal object SqsSetting {
          13  +
    /**
          14  +
     * Configure when MD5 checksum validation is performed for SQS operations.
          15  +
     *
          16  +
     * Can be configured using:
          17  +
     * - System property: aws.SqsChecksumValidationEnabled
          18  +
     * - Environment variable: AWS_SQS_CHECKSUM_VALIDATION_ENABLED
          19  +
     *
          20  +
     * Valid values:
          21  +
     * - ALWAYS (default) - Validates checksums for both sending and receiving operations
          22  +
     * - WHEN_SENDING - Validates checksums only when sending messages
          23  +
     * - WHEN_RECEIVING - Validates checksums only when receiving messages
          24  +
     * - NEVER - Disables checksum validation
          25  +
     *
          26  +
     * Note: Value matching is case-insensitive when configured via environment variables.
          27  +
     */
          28  +
    public val checksumValidationEnabled: EnvironmentSetting<ValidationEnabled> =
          29  +
        enumEnvSetting("aws.SqsChecksumValidationEnabled", "AWS_SQS_CHECKSUM_VALIDATION_ENABLED")
          30  +
          31  +
    /**
          32  +
     * Configure the scope of checksum validation for SQS operations.
          33  +
     *
          34  +
     * Can be configured using:
          35  +
     * - System property: aws.SqsChecksumValidationScope
          36  +
     * - Environment variable: AWS_SQS_CHECKSUM_VALIDATION_SCOPE
          37  +
     *
          38  +
     * Valid values are comma-separated combinations of:
          39  +
     * - MESSAGE_BODY: Validate message body checksums
          40  +
     * - MESSAGE_ATTRIBUTES: Validate message attribute checksums
          41  +
     * - SYSTEM_ATTRIBUTES: Validate system attribute checksums
          42  +
     *
          43  +
     * Example: "MESSAGE_BODY,MESSAGE_ATTRIBUTES"
          44  +
     *
          45  +
     * If not specified, defaults to validating all scopes.
          46  +
     */
          47  +
    public val checksumValidationScopes: EnvironmentSetting<Set<ValidationScope>?> =
          48  +
        enumSetEnvSetting<ValidationScope>("aws.SqsChecksumValidationScope", "AWS_SQS_CHECKSUM_VALIDATION_SCOPE")
          49  +
}

tmp-codegen-diff/services/sqs/common/src/aws.sdk.kotlin.services.sqs/internal/ValidationConfig.kt

@@ -0,1 +0,46 @@
           1  +
package aws.sdk.kotlin.services.sqs.internal
           2  +
           3  +
/**
           4  +
 * Controls when MD5 checksum validation is performed for SQS operations.
           5  +
 *
           6  +
 * This configuration determines under which conditions checksums will be automatically
           7  +
 * calculated and validated for SQS message operations.
           8  +
 *
           9  +
 * Valid values:
          10  +
 * - ALWAYS - Validates checksums for both sending and receiving operations
          11  +
 *           (SendMessage, SendMessageBatch, and ReceiveMessage)
          12  +
 * - WHEN_SENDING - Validates checksums only when sending messages
          13  +
 *                 (SendMessage and SendMessageBatch)
          14  +
 * - WHEN_RECEIVING - Validates checksums only when receiving messages
          15  +
 *                   (ReceiveMessage)
          16  +
 * - NEVER - Disables checksum validation completely
          17  +
 *
          18  +
 * Default: ALWAYS
          19  +
 */
          20  +
public enum class ValidationEnabled {
          21  +
    ALWAYS,
          22  +
    WHEN_SENDING,
          23  +
    WHEN_RECEIVING,
          24  +
    NEVER,
          25  +
}
          26  +
          27  +
/**
          28  +
 * Specifies which parts of an SQS message should undergo MD5 checksum validation.
          29  +
 *
          30  +
 * This configuration determines which components of a message will be validated
          31  +
 * when checksum validation is enabled.
          32  +
 *
          33  +
 * Valid values:
          34  +
 * - MESSAGE_ATTRIBUTES - Validates checksums for message attributes
          35  +
 * - MESSAGE_SYSTEM_ATTRIBUTES - Validates checksums for message system attributes
          36  +
 *   (Note: Not available for ReceiveMessage operations as SQS does not calculate
          37  +
 *   checksums for system attributes during message receipt)
          38  +
 * - MESSAGE_BODY - Validates checksums for the message body
          39  +
 *
          40  +
 * Default: All scopes enabled
          41  +
 */
          42  +
public enum class ValidationScope {
          43  +
    MESSAGE_ATTRIBUTES,
          44  +
    MESSAGE_SYSTEM_ATTRIBUTES,
          45  +
    MESSAGE_BODY,
          46  +
}

tmp-codegen-diff/services/sqs/e2eTest/src/SqsMd5ChecksumValidationTest.kt

@@ -0,1 +0,225 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
package aws.sdk.kotlin.e2etest
           6  +
           7  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.DEFAULT_REGION
           8  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.TEST_MESSAGE_ATTRIBUTES_NAME
           9  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.TEST_MESSAGE_ATTRIBUTES_VALUE
          10  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.TEST_MESSAGE_BODY
          11  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE
          12  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.TEST_QUEUE_CORRECT_CHECKSUM_PREFIX
          13  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.TEST_QUEUE_WRONG_CHECKSUM_PREFIX
          14  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.buildSendMessageBatchRequestEntry
          15  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.deleteQueueAndAllMessages
          16  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.getTestQueueUrl
          17  +
import aws.sdk.kotlin.services.sqs.SqsClient
          18  +
import aws.sdk.kotlin.services.sqs.internal.ValidationEnabled
          19  +
import aws.sdk.kotlin.services.sqs.internal.ValidationScope
          20  +
import aws.sdk.kotlin.services.sqs.model.*
          21  +
import aws.smithy.kotlin.runtime.client.ResponseInterceptorContext
          22  +
import aws.smithy.kotlin.runtime.hashing.md5
          23  +
import aws.smithy.kotlin.runtime.http.interceptors.ChecksumMismatchException
          24  +
import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
          25  +
import aws.smithy.kotlin.runtime.http.request.HttpRequest
          26  +
import aws.smithy.kotlin.runtime.http.response.HttpResponse
          27  +
import kotlinx.coroutines.runBlocking
          28  +
import org.junit.jupiter.api.*
          29  +
          30  +
/**
          31  +
 * Tests for Sqs MD5 checksum validation
          32  +
 */
          33  +
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
          34  +
class SqsMd5ChecksumValidationTest {
          35  +
    // An interceptor that set wrong md5 checksums in SQS response
          36  +
    @OptIn(ExperimentalStdlibApi::class)
          37  +
    private val wrongChecksumInterceptor = object : HttpInterceptor {
          38  +
        override suspend fun modifyBeforeCompletion(
          39  +
            context: ResponseInterceptorContext<Any, Any, HttpRequest?, HttpResponse?>,
          40  +
        ): Result<Any> {
          41  +
            val wrongMd5ofMessageBody = "wrong message md5".encodeToByteArray().md5().toHexString()
          42  +
            val wrongMd5ofMessageAttribute = "wrong attribute md5".encodeToByteArray().md5().toHexString()
          43  +
            val wrongMd5ofMessageSystemAttribute = "wrong system attribute md5".encodeToByteArray().md5().toHexString()
          44  +
          45  +
            when (val response = context.response.getOrNull()) {
          46  +
                is SendMessageResponse -> {
          47  +
                    val modifiedResponse = response.copy {
          48  +
                        md5OfMessageBody = wrongMd5ofMessageBody
          49  +
                        md5OfMessageAttributes = wrongMd5ofMessageAttribute
          50  +
                        md5OfMessageSystemAttributes = wrongMd5ofMessageSystemAttribute
          51  +
                    }
          52  +
                    return Result.success(modifiedResponse)
          53  +
                }
          54  +
                is ReceiveMessageResponse -> {
          55  +
                    val modifiedMessages = response.messages?.map { message ->
          56  +
                        message.copy {
          57  +
                            md5OfBody = wrongMd5ofMessageBody
          58  +
                            md5OfMessageAttributes = wrongMd5ofMessageAttribute
          59  +
                        }
          60  +
                    }
          61  +
          62  +
                    val modifiedResponse = ReceiveMessageResponse {
          63  +
                        messages = modifiedMessages
          64  +
                    }
          65  +
                    return Result.success(modifiedResponse)
          66  +
                }
          67  +
                is SendMessageBatchResponse -> {
          68  +
                    val modifiedEntries = response.successful.map { entry ->
          69  +
                        entry.copy {
          70  +
                            md5OfMessageBody = wrongMd5ofMessageBody
          71  +
                            md5OfMessageAttributes = wrongMd5ofMessageAttribute
          72  +
                            md5OfMessageSystemAttributes = wrongMd5ofMessageSystemAttribute
          73  +
                        }
          74  +
                    }
          75  +
          76  +
                    val modifiedResponse = SendMessageBatchResponse {
          77  +
                        successful = modifiedEntries
          78  +
                        failed = response.failed
          79  +
                    }
          80  +
                    return Result.success(modifiedResponse)
          81  +
                }
          82  +
            }
          83  +
            return context.response
          84  +
        }
          85  +
    }
          86  +
          87  +
    private val correctChecksumClient = SqsClient {
          88  +
        region = DEFAULT_REGION
          89  +
        checksumValidationEnabled = ValidationEnabled.ALWAYS
          90  +
        checksumValidationScopes = ValidationScope.entries.toSet()
          91  +
    }
          92  +
          93  +
    // used for wrong checksum tests
          94  +
    private val wrongChecksumClient = SqsClient {
          95  +
        region = DEFAULT_REGION
          96  +
        checksumValidationEnabled = ValidationEnabled.ALWAYS
          97  +
        checksumValidationScopes = ValidationScope.entries.toSet()
          98  +
        interceptors += wrongChecksumInterceptor
          99  +
    }
         100  +
         101  +
    private lateinit var correctChecksumTestQueueUrl: String
         102  +
    private lateinit var wrongChecksumTestQueueUrl: String
         103  +
         104  +
    @BeforeAll
         105  +
    private fun setUp(): Unit = runBlocking {
         106  +
        correctChecksumTestQueueUrl = getTestQueueUrl(correctChecksumClient, TEST_QUEUE_CORRECT_CHECKSUM_PREFIX, DEFAULT_REGION)
         107  +
        wrongChecksumTestQueueUrl = getTestQueueUrl(wrongChecksumClient, TEST_QUEUE_WRONG_CHECKSUM_PREFIX, DEFAULT_REGION)
         108  +
    }
         109  +
         110  +
    @AfterAll
         111  +
    private fun cleanUp(): Unit = runBlocking {
         112  +
        deleteQueueAndAllMessages(correctChecksumClient, correctChecksumTestQueueUrl)
         113  +
        deleteQueueAndAllMessages(wrongChecksumClient, wrongChecksumTestQueueUrl)
         114  +
        correctChecksumClient.close()
         115  +
        wrongChecksumClient.close()
         116  +
    }
         117  +
         118  +
    @Test
         119  +
    fun testSendMessage(): Unit = runBlocking {
         120  +
        correctChecksumClient.sendMessage(
         121  +
            SendMessageRequest {
         122  +
                queueUrl = correctChecksumTestQueueUrl
         123  +
                messageBody = TEST_MESSAGE_BODY
         124  +
                messageAttributes = hashMapOf(
         125  +
                    TEST_MESSAGE_ATTRIBUTES_NAME to MessageAttributeValue {
         126  +
                        dataType = "String"
         127  +
                        stringValue = TEST_MESSAGE_ATTRIBUTES_VALUE
         128  +
                    },
         129  +
                )
         130  +
                messageSystemAttributes = hashMapOf(
         131  +
                    MessageSystemAttributeNameForSends.AwsTraceHeader to MessageSystemAttributeValue {
         132  +
                        dataType = "String"
         133  +
                        stringValue = TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE
         134  +
                    },
         135  +
                )
         136  +
            },
         137  +
        )
         138  +
    }
         139  +
         140  +
    @Test
         141  +
    fun testReceiveMessage(): Unit = runBlocking {
         142  +
        correctChecksumClient.receiveMessage(
         143  +
            ReceiveMessageRequest {
         144  +
                queueUrl = correctChecksumTestQueueUrl
         145  +
                maxNumberOfMessages = 1
         146  +
                messageAttributeNames = listOf(TEST_MESSAGE_ATTRIBUTES_NAME)
         147  +
                messageSystemAttributeNames = listOf(MessageSystemAttributeName.AwsTraceHeader)
         148  +
            },
         149  +
        )
         150  +
    }
         151  +
         152  +
    @Test
         153  +
    fun testSendMessageBatch(): Unit = runBlocking {
         154  +
        val entries = (1..5).map { batchId ->
         155  +
            buildSendMessageBatchRequestEntry(batchId)
         156  +
        }
         157  +
         158  +
        correctChecksumClient.sendMessageBatch(
         159  +
            SendMessageBatchRequest {
         160  +
                queueUrl = correctChecksumTestQueueUrl
         161  +
                this.entries = entries
         162  +
            },
         163  +
        )
         164  +
    }
         165  +
         166  +
    @Test
         167  +
    fun testSendMessageWithWrongChecksum(): Unit = runBlocking {
         168  +
        val exception = assertThrows<ChecksumMismatchException> {
         169  +
            wrongChecksumClient.sendMessage(
         170  +
                SendMessageRequest {
         171  +
                    queueUrl = wrongChecksumTestQueueUrl
         172  +
                    messageBody = TEST_MESSAGE_BODY
         173  +
                    messageAttributes = hashMapOf(
         174  +
                        TEST_MESSAGE_ATTRIBUTES_NAME to MessageAttributeValue {
         175  +
                            dataType = "String"
         176  +
                            stringValue = TEST_MESSAGE_ATTRIBUTES_VALUE
         177  +
                        },
         178  +
                    )
         179  +
                    messageSystemAttributes = hashMapOf(
         180  +
                        MessageSystemAttributeNameForSends.AwsTraceHeader to MessageSystemAttributeValue {
         181  +
                            dataType = "String"
         182  +
                            stringValue = TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE
         183  +
                        },
         184  +
                    )
         185  +
                },
         186  +
            )
         187  +
        }
         188  +
         189  +
        assert(exception.message!!.contains("Checksum mismatch"))
         190  +
    }
         191  +
         192  +
    @Test
         193  +
    fun testReceiveMessageWithWrongChecksum(): Unit = runBlocking {
         194  +
        val exception = assertThrows<ChecksumMismatchException> {
         195  +
            wrongChecksumClient.receiveMessage(
         196  +
                ReceiveMessageRequest {
         197  +
                    queueUrl = wrongChecksumTestQueueUrl
         198  +
                    maxNumberOfMessages = 1
         199  +
                    messageAttributeNames = listOf(TEST_MESSAGE_ATTRIBUTES_NAME)
         200  +
                    messageSystemAttributeNames = listOf(MessageSystemAttributeName.AwsTraceHeader)
         201  +
                },
         202  +
            )
         203  +
        }
         204  +
         205  +
        assert(exception.message!!.contains("Checksum mismatch"))
         206  +
    }
         207  +
         208  +
    @Test
         209  +
    fun testSendMessageBatchWithWrongChecksum(): Unit = runBlocking {
         210  +
        val entries = (1..5).map { batchId ->
         211  +
            buildSendMessageBatchRequestEntry(batchId)
         212  +
        }
         213  +
         214  +
        val exception = assertThrows<ChecksumMismatchException> {
         215  +
            wrongChecksumClient.sendMessageBatch(
         216  +
                SendMessageBatchRequest {
         217  +
                    queueUrl = wrongChecksumTestQueueUrl
         218  +
                    this.entries = entries
         219  +
                },
         220  +
            )
         221  +
        }
         222  +
         223  +
        assert(exception.message!!.contains("Checksum mismatch"))
         224  +
    }
         225  +
}

tmp-codegen-diff/services/sqs/e2eTest/src/SqsTestUtils.kt

@@ -0,1 +0,100 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
package aws.sdk.kotlin.e2etest
           6  +
           7  +
import aws.sdk.kotlin.services.sqs.SqsClient
           8  +
import aws.sdk.kotlin.services.sqs.createQueue
           9  +
import aws.sdk.kotlin.services.sqs.model.*
          10  +
import aws.sdk.kotlin.services.sqs.paginators.listQueuesPaginated
          11  +
import aws.sdk.kotlin.services.sqs.paginators.queueUrls
          12  +
import kotlinx.coroutines.flow.firstOrNull
          13  +
import kotlinx.coroutines.withTimeout
          14  +
import java.util.*
          15  +
import kotlin.time.Duration.Companion.seconds
          16  +
          17  +
object SqsTestUtils {
          18  +
    const val DEFAULT_REGION = "us-west-2"
          19  +
          20  +
    const val TEST_QUEUE_WRONG_CHECKSUM_PREFIX = "sqs-test-queue-wrong-checksum-"
          21  +
    const val TEST_QUEUE_CORRECT_CHECKSUM_PREFIX = "sqs-test-queue-correct-checksum-"
          22  +
          23  +
    const val TEST_MESSAGE_BODY = "Hello World"
          24  +
    const val TEST_MESSAGE_ATTRIBUTES_NAME = "TestAttribute"
          25  +
    const val TEST_MESSAGE_ATTRIBUTES_VALUE = "TestAttributeValue"
          26  +
    const val TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE = "TestSystemAttributeValue"
          27  +
          28  +
    suspend fun getTestQueueUrl(
          29  +
        client: SqsClient,
          30  +
        prefix: String,
          31  +
        region: String? = null,
          32  +
    ): String = getQueueUrlWithPrefix(client, prefix, region)
          33  +
          34  +
    private suspend fun getQueueUrlWithPrefix(
          35  +
        client: SqsClient,
          36  +
        prefix: String,
          37  +
        region: String? = null,
          38  +
    ): String = withTimeout(60.seconds) {
          39  +
        var matchingQueueUrl = client
          40  +
            .listQueuesPaginated { queueNamePrefix = prefix }
          41  +
            .queueUrls()
          42  +
            .firstOrNull()
          43  +
          44  +
        if (matchingQueueUrl == null) {
          45  +
            matchingQueueUrl = prefix + UUID.randomUUID()
          46  +
            println("Creating Sqs queue: $matchingQueueUrl")
          47  +
          48  +
            client.createQueue {
          49  +
                queueName = matchingQueueUrl
          50  +
            }
          51  +
        } else {
          52  +
            println("Using existing Sqs queue: $matchingQueueUrl")
          53  +
        }
          54  +
          55  +
        matchingQueueUrl
          56  +
    }
          57  +
          58  +
    suspend fun deleteQueueAndAllMessages(client: SqsClient, queueUrl: String) {
          59  +
        try {
          60  +
            println("Purging Sqs queue: $queueUrl")
          61  +
          62  +
            client.purgeQueue(
          63  +
                PurgeQueueRequest {
          64  +
                    this.queueUrl = queueUrl
          65  +
                },
          66  +
            )
          67  +
          68  +
            println("Queue purged successfully.")
          69  +
          70  +
            println("Deleting Sqs queue: $queueUrl")
          71  +
          72  +
            client.deleteQueue(
          73  +
                DeleteQueueRequest {
          74  +
                    this.queueUrl = queueUrl
          75  +
                },
          76  +
            )
          77  +
          78  +
            println("Queue deleted successfully.")
          79  +
        } catch (e: SqsException) {
          80  +
            println("Error during delete SQS queue: ${e.message}")
          81  +
        }
          82  +
    }
          83  +
          84  +
    fun buildSendMessageBatchRequestEntry(batchId: Int): SendMessageBatchRequestEntry = SendMessageBatchRequestEntry {
          85  +
        id = batchId.toString()
          86  +
        messageBody = TEST_MESSAGE_BODY + batchId
          87  +
        messageAttributes = mapOf(
          88  +
            TEST_MESSAGE_ATTRIBUTES_NAME to MessageAttributeValue {
          89  +
                dataType = "String"
          90  +
                stringValue = TEST_MESSAGE_ATTRIBUTES_VALUE + batchId
          91  +
            },
          92  +
        )
          93  +
        messageSystemAttributes = mapOf(
          94  +
            MessageSystemAttributeNameForSends.AwsTraceHeader to MessageSystemAttributeValue {
          95  +
                dataType = "String"
          96  +
                stringValue = TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE + batchId
          97  +
            },
          98  +
        )
          99  +
    }
         100  +
}

tmp-codegen-diff/services/sts/build.gradle.kts

@@ -1,1 +35,35 @@
    1      1   
    2      2   
description = "The AWS SDK for Kotlin client for STS"
    3      3   
project.ext.set("aws.sdk.id", "STS")
    4      4   
    5      5   
kotlin {
    6      6   
    sourceSets {
    7      7   
        commonMain {
    8      8   
            dependencies {
    9         -
                implementation("aws.smithy.kotlin:aws-credentials:1.4.10-SNAPSHOT")
           9  +
                implementation("aws.smithy.kotlin:aws-credentials:1.4.4-SNAPSHOT")
   10     10   
                implementation(project(":aws-runtime:aws-http"))
   11         -
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.10-SNAPSHOT")
   12         -
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.10-SNAPSHOT")
   13         -
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.10-SNAPSHOT")
   14         -
                implementation("aws.smithy.kotlin:aws-xml-protocols:1.4.10-SNAPSHOT")
   15         -
                implementation("aws.smithy.kotlin:http:1.4.10-SNAPSHOT")
   16         -
                implementation("aws.smithy.kotlin:http-auth:1.4.10-SNAPSHOT")
   17         -
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.10-SNAPSHOT")
   18         -
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.10-SNAPSHOT")
   19         -
                implementation("aws.smithy.kotlin:identity-api:1.4.10-SNAPSHOT")
          11  +
                implementation("aws.smithy.kotlin:aws-protocol-core:1.4.4-SNAPSHOT")
          12  +
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.4-SNAPSHOT")
          13  +
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.4-SNAPSHOT")
          14  +
                implementation("aws.smithy.kotlin:aws-xml-protocols:1.4.4-SNAPSHOT")
          15  +
                implementation("aws.smithy.kotlin:http:1.4.4-SNAPSHOT")
          16  +
                implementation("aws.smithy.kotlin:http-auth:1.4.4-SNAPSHOT")
          17  +
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.4-SNAPSHOT")
          18  +
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.4-SNAPSHOT")
          19  +
                implementation("aws.smithy.kotlin:identity-api:1.4.4-SNAPSHOT")
   20     20   
                implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
   21         -
                implementation("aws.smithy.kotlin:serde:1.4.10-SNAPSHOT")
   22         -
                implementation("aws.smithy.kotlin:serde-form-url:1.4.10-SNAPSHOT")
   23         -
                implementation("aws.smithy.kotlin:serde-xml:1.4.10-SNAPSHOT")
   24         -
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.10-SNAPSHOT")
          21  +
                implementation("aws.smithy.kotlin:serde:1.4.4-SNAPSHOT")
          22  +
                implementation("aws.smithy.kotlin:serde-form-url:1.4.4-SNAPSHOT")
          23  +
                implementation("aws.smithy.kotlin:serde-xml:1.4.4-SNAPSHOT")
          24  +
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.4-SNAPSHOT")
   25     25   
                api(project(":aws-runtime:aws-config"))
   26     26   
                api(project(":aws-runtime:aws-core"))
   27     27   
                api(project(":aws-runtime:aws-endpoint"))
   28         -
                api("aws.smithy.kotlin:http-client:1.4.10-SNAPSHOT")
   29         -
                api("aws.smithy.kotlin:runtime-core:1.4.10-SNAPSHOT")
   30         -
                api("aws.smithy.kotlin:smithy-client:1.4.10-SNAPSHOT")
   31         -
                api("aws.smithy.kotlin:telemetry-api:1.4.10-SNAPSHOT")
          28  +
                api("aws.smithy.kotlin:http-client:1.4.4-SNAPSHOT")
          29  +
                api("aws.smithy.kotlin:runtime-core:1.4.4-SNAPSHOT")
          30  +
                api("aws.smithy.kotlin:smithy-client:1.4.4-SNAPSHOT")
          31  +
                api("aws.smithy.kotlin:telemetry-api:1.4.4-SNAPSHOT")
   32     32   
            }
   33     33   
        }
   34     34   
    }
   35     35   
}