AWS SDK

AWS SDK

rev. d03dc2cbf92e42a76d74caf3e8c12a8b87f47120..30ca40da592b0b40fb5787bcc41cfeb73f8c9951 (ignoring whitespace)

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

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

@@ -0,1 +0,34 @@
           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 v1.5
          23  +
          24  +
    builder.config.checksumValidationScopes = builder.config.checksumValidationScopes
          25  +
        ?: SqsSetting.checksumValidationScopes.resolve(provider)
          26  +
        ?: activeProfile.checksumValidationScopes
          27  +
        ?: ValidationScope.entries.toSet()
          28  +
}
          29  +
          30  +
private val AwsProfile.checksumValidationEnabled: ValidationEnabled?
          31  +
    get() = getEnumOrNull<ValidationEnabled>("sqs_checksum_validation_enabled")
          32  +
          33  +
private val AwsProfile.checksumValidationScopes: Set<ValidationScope>?
          34  +
    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 - 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 (default) - 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,47 @@
           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: `NEVER`
          19  +
 */
          20  +
// TODO: MD5 checksum validation is temporarily disabled. Change default to ALWAYS in v1.5
          21  +
public enum class ValidationEnabled {
          22  +
    ALWAYS,
          23  +
    WHEN_SENDING,
          24  +
    WHEN_RECEIVING,
          25  +
    NEVER,
          26  +
}
          27  +
          28  +
/**
          29  +
 * Specifies which parts of an SQS message should undergo MD5 checksum validation.
          30  +
 *
          31  +
 * This configuration determines which components of a message will be validated
          32  +
 * when checksum validation is enabled.
          33  +
 *
          34  +
 * Valid values:
          35  +
 * - `MESSAGE_ATTRIBUTES` - Validates checksums for message attributes
          36  +
 * - `MESSAGE_SYSTEM_ATTRIBUTES` - Validates checksums for message system attributes
          37  +
 *   (Note: Not available for ReceiveMessage operations as SQS does not calculate
          38  +
 *   checksums for system attributes during message receipt)
          39  +
 * - `MESSAGE_BODY` - Validates checksums for the message body
          40  +
 *
          41  +
 * Default: All scopes enabled
          42  +
 */
          43  +
public enum class ValidationScope {
          44  +
    MESSAGE_ATTRIBUTES,
          45  +
    MESSAGE_SYSTEM_ATTRIBUTES,
          46  +
    MESSAGE_BODY,
          47  +
}

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

@@ -0,1 +0,240 @@
           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_PREFIX
          13  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.buildSendMessageBatchRequestEntry
          14  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.deleteQueueAndAllMessages
          15  +
import aws.sdk.kotlin.e2etest.SqsTestUtils.getTestQueueUrl
          16  +
import aws.sdk.kotlin.services.sqs.SqsClient
          17  +
import aws.sdk.kotlin.services.sqs.internal.ValidationEnabled
          18  +
import aws.sdk.kotlin.services.sqs.model.*
          19  +
import aws.smithy.kotlin.runtime.client.ResponseInterceptorContext
          20  +
import aws.smithy.kotlin.runtime.collections.AttributeKey
          21  +
import aws.smithy.kotlin.runtime.collections.get
          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  +
import org.junit.jupiter.api.Assertions.assertNotNull
          30  +
          31  +
/**
          32  +
 * Tests for Sqs MD5 checksum validation
          33  +
 */
          34  +
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
          35  +
class SqsMd5ChecksumValidationTest {
          36  +
    // An interceptor that set wrong md5 checksums in SQS response
          37  +
    @OptIn(ExperimentalStdlibApi::class)
          38  +
    private val wrongChecksumInterceptor = object : HttpInterceptor {
          39  +
        override suspend fun modifyBeforeCompletion(
          40  +
            context: ResponseInterceptorContext<Any, Any, HttpRequest?, HttpResponse?>,
          41  +
        ): Result<Any> {
          42  +
            val wrongMd5ofMessageBody = "wrong message md5".encodeToByteArray().md5().toHexString()
          43  +
            val wrongMd5ofMessageAttribute = "wrong attribute md5".encodeToByteArray().md5().toHexString()
          44  +
            val wrongMd5ofMessageSystemAttribute = "wrong system attribute md5".encodeToByteArray().md5().toHexString()
          45  +
          46  +
            when (val response = context.response.getOrNull()) {
          47  +
                is SendMessageResponse -> {
          48  +
                    val modifiedResponse = response.copy {
          49  +
                        md5OfMessageBody = wrongMd5ofMessageBody
          50  +
                        md5OfMessageAttributes = wrongMd5ofMessageAttribute
          51  +
                        md5OfMessageSystemAttributes = wrongMd5ofMessageSystemAttribute
          52  +
                    }
          53  +
                    return Result.success(modifiedResponse)
          54  +
                }
          55  +
                is ReceiveMessageResponse -> {
          56  +
                    val modifiedMessages = response.messages?.map { message ->
          57  +
                        message.copy {
          58  +
                            md5OfBody = wrongMd5ofMessageBody
          59  +
                            md5OfMessageAttributes = wrongMd5ofMessageAttribute
          60  +
                        }
          61  +
                    }
          62  +
          63  +
                    val modifiedResponse = ReceiveMessageResponse {
          64  +
                        messages = modifiedMessages
          65  +
                    }
          66  +
                    return Result.success(modifiedResponse)
          67  +
                }
          68  +
                is SendMessageBatchResponse -> {
          69  +
                    val modifiedEntries = response.successful.map { entry ->
          70  +
                        entry.copy {
          71  +
                            md5OfMessageBody = wrongMd5ofMessageBody
          72  +
                            md5OfMessageAttributes = wrongMd5ofMessageAttribute
          73  +
                            md5OfMessageSystemAttributes = wrongMd5ofMessageSystemAttribute
          74  +
                        }
          75  +
                    }
          76  +
          77  +
                    val modifiedResponse = SendMessageBatchResponse {
          78  +
                        successful = modifiedEntries
          79  +
                        failed = response.failed
          80  +
                    }
          81  +
                    return Result.success(modifiedResponse)
          82  +
                }
          83  +
            }
          84  +
            return context.response
          85  +
        }
          86  +
    }
          87  +
          88  +
    // An interceptor that checks if the SQS md5 checksum was validated
          89  +
    private val checksumValidationAssertionInterceptor = object : HttpInterceptor {
          90  +
        private val supportedOperations = setOf(
          91  +
            "SendMessage",
          92  +
            "SendMessageBatch",
          93  +
            "ReceiveMessage",
          94  +
        )
          95  +
          96  +
        override fun readAfterExecution(context: ResponseInterceptorContext<Any, Any, HttpRequest?, HttpResponse?>) {
          97  +
            val operationName = context.executionContext.attributes[AttributeKey("aws.smithy.kotlin#OperationName")] as String
          98  +
          99  +
            if (operationName !in supportedOperations) {
         100  +
                return
         101  +
            }
         102  +
         103  +
            assertNotNull(context.executionContext.attributes[AttributeKey("checksumValidated")])
         104  +
         105  +
            val isChecksumValidated = context.executionContext.attributes[AttributeKey("checksumValidated")] as Boolean
         106  +
         107  +
            assert(isChecksumValidated)
         108  +
        }
         109  +
    }
         110  +
         111  +
    private lateinit var correctChecksumClient: SqsClient
         112  +
         113  +
    private lateinit var wrongChecksumClient: SqsClient
         114  +
         115  +
    private lateinit var testQueueUrl: String
         116  +
         117  +
    @BeforeAll
         118  +
    private fun setUp(): Unit = runBlocking {
         119  +
        correctChecksumClient = SqsClient.fromEnvironment {
         120  +
            region = DEFAULT_REGION
         121  +
            checksumValidationEnabled = ValidationEnabled.ALWAYS
         122  +
            interceptors += checksumValidationAssertionInterceptor
         123  +
        }
         124  +
        wrongChecksumClient = SqsClient.fromEnvironment {
         125  +
            region = DEFAULT_REGION
         126  +
            checksumValidationEnabled = ValidationEnabled.ALWAYS
         127  +
            interceptors += wrongChecksumInterceptor
         128  +
        }
         129  +
        testQueueUrl = getTestQueueUrl(correctChecksumClient, TEST_QUEUE_PREFIX)
         130  +
    }
         131  +
         132  +
    @AfterAll
         133  +
    private fun cleanUp(): Unit = runBlocking {
         134  +
        deleteQueueAndAllMessages(correctChecksumClient, testQueueUrl)
         135  +
        correctChecksumClient.close()
         136  +
        wrongChecksumClient.close()
         137  +
    }
         138  +
         139  +
    @Test
         140  +
    fun testSendMessage(): Unit = runBlocking {
         141  +
        correctChecksumClient.sendMessage(
         142  +
            SendMessageRequest {
         143  +
                queueUrl = testQueueUrl
         144  +
                messageBody = TEST_MESSAGE_BODY
         145  +
                messageAttributes = mapOf(
         146  +
                    TEST_MESSAGE_ATTRIBUTES_NAME to MessageAttributeValue {
         147  +
                        dataType = "String"
         148  +
                        stringValue = TEST_MESSAGE_ATTRIBUTES_VALUE
         149  +
                    },
         150  +
                )
         151  +
                messageSystemAttributes = mapOf(
         152  +
                    MessageSystemAttributeNameForSends.AwsTraceHeader to MessageSystemAttributeValue {
         153  +
                        dataType = "String"
         154  +
                        stringValue = TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE
         155  +
                    },
         156  +
                )
         157  +
            },
         158  +
        )
         159  +
    }
         160  +
         161  +
    @Test
         162  +
    fun testReceiveMessage(): Unit = runBlocking {
         163  +
        correctChecksumClient.receiveMessage(
         164  +
            ReceiveMessageRequest {
         165  +
                queueUrl = testQueueUrl
         166  +
                maxNumberOfMessages = 1
         167  +
                messageAttributeNames = listOf(TEST_MESSAGE_ATTRIBUTES_NAME)
         168  +
                messageSystemAttributeNames = listOf(MessageSystemAttributeName.AwsTraceHeader)
         169  +
            },
         170  +
        )
         171  +
    }
         172  +
         173  +
    @Test
         174  +
    fun testSendMessageBatch(): Unit = runBlocking {
         175  +
        val entries = (1..5).map { batchId ->
         176  +
            buildSendMessageBatchRequestEntry(batchId)
         177  +
        }
         178  +
         179  +
        correctChecksumClient.sendMessageBatch(
         180  +
            SendMessageBatchRequest {
         181  +
                queueUrl = testQueueUrl
         182  +
                this.entries = entries
         183  +
            },
         184  +
        )
         185  +
    }
         186  +
         187  +
    @Test
         188  +
    fun testSendMessageWithWrongChecksum(): Unit = runBlocking {
         189  +
        assertThrows<ChecksumMismatchException> {
         190  +
            wrongChecksumClient.sendMessage(
         191  +
                SendMessageRequest {
         192  +
                    queueUrl = testQueueUrl
         193  +
                    messageBody = TEST_MESSAGE_BODY
         194  +
                    messageAttributes = mapOf(
         195  +
                        TEST_MESSAGE_ATTRIBUTES_NAME to MessageAttributeValue {
         196  +
                            dataType = "String"
         197  +
                            stringValue = TEST_MESSAGE_ATTRIBUTES_VALUE
         198  +
                        },
         199  +
                    )
         200  +
                    messageSystemAttributes = mapOf(
         201  +
                        MessageSystemAttributeNameForSends.AwsTraceHeader to MessageSystemAttributeValue {
         202  +
                            dataType = "String"
         203  +
                            stringValue = TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE
         204  +
                        },
         205  +
                    )
         206  +
                },
         207  +
            )
         208  +
        }
         209  +
    }
         210  +
         211  +
    @Test
         212  +
    fun testReceiveMessageWithWrongChecksum(): Unit = runBlocking {
         213  +
        assertThrows<ChecksumMismatchException> {
         214  +
            wrongChecksumClient.receiveMessage(
         215  +
                ReceiveMessageRequest {
         216  +
                    queueUrl = testQueueUrl
         217  +
                    maxNumberOfMessages = 1
         218  +
                    messageAttributeNames = listOf(TEST_MESSAGE_ATTRIBUTES_NAME)
         219  +
                    messageSystemAttributeNames = listOf(MessageSystemAttributeName.AwsTraceHeader)
         220  +
                },
         221  +
            )
         222  +
        }
         223  +
    }
         224  +
         225  +
    @Test
         226  +
    fun testSendMessageBatchWithWrongChecksum(): Unit = runBlocking {
         227  +
        val entries = (1..5).map { batchId ->
         228  +
            buildSendMessageBatchRequestEntry(batchId)
         229  +
        }
         230  +
         231  +
        assertThrows<ChecksumMismatchException> {
         232  +
            wrongChecksumClient.sendMessageBatch(
         233  +
                SendMessageBatchRequest {
         234  +
                    queueUrl = testQueueUrl
         235  +
                    this.entries = entries
         236  +
                },
         237  +
            )
         238  +
        }
         239  +
    }
         240  +
}

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

@@ -0,1 +0,92 @@
           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_PREFIX = "sqs-test-queue-"
          21  +
          22  +
    const val TEST_MESSAGE_BODY = "Hello World"
          23  +
    const val TEST_MESSAGE_ATTRIBUTES_NAME = "TestAttribute"
          24  +
    const val TEST_MESSAGE_ATTRIBUTES_VALUE = "TestAttributeValue"
          25  +
    const val TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE = "TestSystemAttributeValue"
          26  +
          27  +
    suspend fun getTestQueueUrl(client: SqsClient, prefix: String): String =
          28  +
        getQueueUrlWithPrefix(client, prefix)
          29  +
          30  +
    private suspend fun getQueueUrlWithPrefix(client: SqsClient, prefix: String): String = withTimeout(60.seconds) {
          31  +
        var matchingQueueUrl = client
          32  +
            .listQueuesPaginated { queueNamePrefix = prefix }
          33  +
            .queueUrls()
          34  +
            .firstOrNull()
          35  +
          36  +
        if (matchingQueueUrl == null) {
          37  +
            matchingQueueUrl = prefix + UUID.randomUUID()
          38  +
            println("Creating SQS queue: $matchingQueueUrl")
          39  +
          40  +
            client.createQueue {
          41  +
                queueName = matchingQueueUrl
          42  +
            }
          43  +
        } else {
          44  +
            println("Using existing SQS queue: $matchingQueueUrl")
          45  +
        }
          46  +
          47  +
        matchingQueueUrl
          48  +
    }
          49  +
          50  +
    suspend fun deleteQueueAndAllMessages(client: SqsClient, queueUrl: String) {
          51  +
        try {
          52  +
            println("Purging SQS queue: $queueUrl")
          53  +
          54  +
            client.purgeQueue(
          55  +
                PurgeQueueRequest {
          56  +
                    this.queueUrl = queueUrl
          57  +
                },
          58  +
            )
          59  +
          60  +
            println("Queue purged successfully.")
          61  +
          62  +
            println("Deleting Sqs queue: $queueUrl")
          63  +
          64  +
            client.deleteQueue(
          65  +
                DeleteQueueRequest {
          66  +
                    this.queueUrl = queueUrl
          67  +
                },
          68  +
            )
          69  +
          70  +
            println("Queue deleted successfully.")
          71  +
        } catch (e: SqsException) {
          72  +
            println("Error during delete SQS queue: ${e.message}")
          73  +
        }
          74  +
    }
          75  +
          76  +
    fun buildSendMessageBatchRequestEntry(batchId: Int): SendMessageBatchRequestEntry = SendMessageBatchRequestEntry {
          77  +
        id = batchId.toString()
          78  +
        messageBody = TEST_MESSAGE_BODY + batchId
          79  +
        messageAttributes = mapOf(
          80  +
            TEST_MESSAGE_ATTRIBUTES_NAME to MessageAttributeValue {
          81  +
                dataType = "String"
          82  +
                stringValue = TEST_MESSAGE_ATTRIBUTES_VALUE + batchId
          83  +
            },
          84  +
        )
          85  +
        messageSystemAttributes = mapOf(
          86  +
            MessageSystemAttributeNameForSends.AwsTraceHeader to MessageSystemAttributeValue {
          87  +
                dataType = "String"
          88  +
                stringValue = TEST_MESSAGE_SYSTEM_ATTRIBUTES_VALUE + batchId
          89  +
            },
          90  +
        )
          91  +
    }
          92  +
}

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.11-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.11-SNAPSHOT")
   12         -
                implementation("aws.smithy.kotlin:aws-signing-common:1.4.11-SNAPSHOT")
   13         -
                implementation("aws.smithy.kotlin:aws-signing-default:1.4.11-SNAPSHOT")
   14         -
                implementation("aws.smithy.kotlin:aws-xml-protocols:1.4.11-SNAPSHOT")
   15         -
                implementation("aws.smithy.kotlin:http:1.4.11-SNAPSHOT")
   16         -
                implementation("aws.smithy.kotlin:http-auth:1.4.11-SNAPSHOT")
   17         -
                implementation("aws.smithy.kotlin:http-auth-aws:1.4.11-SNAPSHOT")
   18         -
                implementation("aws.smithy.kotlin:http-client-engine-default:1.4.11-SNAPSHOT")
   19         -
                implementation("aws.smithy.kotlin:identity-api:1.4.11-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.11-SNAPSHOT")
   22         -
                implementation("aws.smithy.kotlin:serde-form-url:1.4.11-SNAPSHOT")
   23         -
                implementation("aws.smithy.kotlin:serde-xml:1.4.11-SNAPSHOT")
   24         -
                implementation("aws.smithy.kotlin:telemetry-defaults:1.4.11-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.11-SNAPSHOT")
   29         -
                api("aws.smithy.kotlin:runtime-core:1.4.11-SNAPSHOT")
   30         -
                api("aws.smithy.kotlin:smithy-client:1.4.11-SNAPSHOT")
   31         -
                api("aws.smithy.kotlin:telemetry-api:1.4.11-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   
}