Skip to content

Commit 02413da

Browse files
authored
fix: correctly presign S3 requests when forcePathStyle = true (#1174)
1 parent e98fd12 commit 02413da

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "c0f971d2-3b76-4f9a-9c76-dc89fe395c86",
3+
"type": "bugfix",
4+
"description": "Correctly presign S3 requests when `forcePathStyle = true`",
5+
"issues": [
6+
"awslabs/aws-sdk-kotlin#1173"
7+
]
8+
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ coroutines-version = "1.7.3"
99
atomicfu-version = "0.23.1"
1010

1111
# smithy-kotlin codegen and runtime are versioned separately
12-
smithy-kotlin-runtime-version = "1.0.7"
13-
smithy-kotlin-codegen-version = "0.30.8"
12+
smithy-kotlin-runtime-version = "1.0.8"
13+
smithy-kotlin-codegen-version = "0.30.9"
1414

1515
# codegen
1616
smithy-version = "1.42.0"

services/s3/e2eTest/src/S3PresignerTest.kt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import aws.smithy.kotlin.runtime.http.SdkHttpClient
1616
import aws.smithy.kotlin.runtime.http.complete
1717
import aws.smithy.kotlin.runtime.http.toByteStream
1818
import kotlinx.coroutines.*
19+
import kotlinx.coroutines.test.runTest
1920
import org.junit.jupiter.api.AfterAll
2021
import org.junit.jupiter.api.BeforeAll
2122
import org.junit.jupiter.api.TestInstance
@@ -42,8 +43,7 @@ class S3PresignerTest {
4243
client.close()
4344
}
4445

45-
@Test
46-
fun testPresign() = runBlocking {
46+
private suspend fun testPresign(client: S3Client) {
4747
val contents = "presign-test"
4848
val keyName = "foo$PRINTABLE_CHARS"
4949

@@ -71,4 +71,19 @@ class S3PresignerTest {
7171
assertEquals(contents, body)
7272
}
7373
}
74+
75+
@Test
76+
fun testPresignNormal() = runTest {
77+
S3Client {
78+
region = S3TestUtils.DEFAULT_REGION
79+
}.use { testPresign(it) }
80+
}
81+
82+
@Test
83+
fun testPresignWithForcePathStyle() = runBlocking {
84+
S3Client {
85+
region = S3TestUtils.DEFAULT_REGION
86+
forcePathStyle = true
87+
}.use { testPresign(it) }
88+
}
7489
}

0 commit comments

Comments
 (0)