diff --git a/.changes/c0f971d2-3b76-4f9a-9c76-dc89fe395c86.json b/.changes/c0f971d2-3b76-4f9a-9c76-dc89fe395c86.json new file mode 100644 index 00000000000..d16f65661f0 --- /dev/null +++ b/.changes/c0f971d2-3b76-4f9a-9c76-dc89fe395c86.json @@ -0,0 +1,8 @@ +{ + "id": "c0f971d2-3b76-4f9a-9c76-dc89fe395c86", + "type": "bugfix", + "description": "Correctly presign S3 requests when `forcePathStyle = true`", + "issues": [ + "awslabs/aws-sdk-kotlin#1173" + ] +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 54a2b215e36..daac61c8d86 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,8 +9,8 @@ coroutines-version = "1.7.3" atomicfu-version = "0.23.1" # smithy-kotlin codegen and runtime are versioned separately -smithy-kotlin-runtime-version = "1.0.7" -smithy-kotlin-codegen-version = "0.30.8" +smithy-kotlin-runtime-version = "1.0.8-SNAPSHOT" +smithy-kotlin-codegen-version = "0.30.9-SNAPSHOT" # codegen smithy-version = "1.42.0" diff --git a/services/s3/e2eTest/src/S3PresignerTest.kt b/services/s3/e2eTest/src/S3PresignerTest.kt index 8cde9c6151e..38e8a39ee65 100644 --- a/services/s3/e2eTest/src/S3PresignerTest.kt +++ b/services/s3/e2eTest/src/S3PresignerTest.kt @@ -16,6 +16,7 @@ import aws.smithy.kotlin.runtime.http.SdkHttpClient import aws.smithy.kotlin.runtime.http.complete import aws.smithy.kotlin.runtime.http.toByteStream import kotlinx.coroutines.* +import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.TestInstance @@ -42,8 +43,7 @@ class S3PresignerTest { client.close() } - @Test - fun testPresign() = runBlocking { + private suspend fun testPresign(client: S3Client) { val contents = "presign-test" val keyName = "foo$PRINTABLE_CHARS" @@ -71,4 +71,19 @@ class S3PresignerTest { assertEquals(contents, body) } } + + @Test + fun testPresignNormal() = runTest { + S3Client { + region = S3TestUtils.DEFAULT_REGION + }.use { testPresign(it) } + } + + @Test + fun testPresignWithForcePathStyle() = runBlocking { + S3Client { + region = S3TestUtils.DEFAULT_REGION + forcePathStyle = true + }.use { testPresign(it) } + } }