Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/7b7a67c4-a9eb-4d4e-aee4-d12e56535e20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "7b7a67c4-a9eb-4d4e-aee4-d12e56535e20",
"type": "misc",
"description": "**Breaking**: Update Kotlin version from 2.3.21 to 2.4.0",
"requiresMinorVersionBump": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import aws.smithy.kotlin.runtime.net.url.Url
import aws.smithy.kotlin.runtime.retries.StandardRetryStrategy
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import aws.smithy.kotlin.runtime.util.TestFile
import aws.smithy.kotlin.runtime.util.TestPlatformProvider
import io.kotest.matchers.string.shouldContain
import kotlinx.coroutines.test.runTest
Expand Down Expand Up @@ -111,7 +112,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative?foo=bar"),
)

Expand All @@ -131,7 +132,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -146,7 +147,7 @@ class EcsCredentialsProviderTest {
val uri = "http://amazonaws.com/full"
val engine = TestConnection()

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -166,7 +167,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -181,7 +182,7 @@ class EcsCredentialsProviderTest {
val uri = "http://amazonaws.net/full"
val engine = TestConnection()

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -201,7 +202,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -221,7 +222,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -241,7 +242,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -261,7 +262,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -276,7 +277,7 @@ class EcsCredentialsProviderTest {
val uri = "http://192.168.1.1/full"
val engine = TestConnection()

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -291,7 +292,7 @@ class EcsCredentialsProviderTest {
val uri = "http://[fd00:0:ec2::23]/full"
val engine = TestConnection()

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsFullUri.envVar to uri),
)

Expand All @@ -304,7 +305,7 @@ class EcsCredentialsProviderTest {
@Test
fun testNoUri() = runTest {
val engine = TestConnection()
val testPlatform = TestPlatformProvider()
val testPlatform = TestPlatformProvider.of()

val provider = EcsCredentialsProvider(testPlatform, engine)
assertFailsWith<ProviderConfigurationException> {
Expand All @@ -322,7 +323,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(
AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative",
AwsSdkSetting.AwsContainerAuthorizationToken.envVar to token,
Expand All @@ -347,14 +348,14 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(
AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative",
AwsSdkSetting.AwsContainerAuthorizationTokenFile.envVar to tokenFile,
AwsSdkSetting.AwsContainerAuthorizationToken.envVar to staticToken, // should be ignored
),
fs = mapOf(
tokenFile to token,
tokenFile to TestFile(token),
),
)

Expand All @@ -369,7 +370,7 @@ class EcsCredentialsProviderTest {
val tokenFile = "/path/to/token"
val engine = TestConnection()

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(
AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative",
AwsSdkSetting.AwsContainerAuthorizationTokenFile.envVar to tokenFile,
Expand All @@ -388,7 +389,7 @@ class EcsCredentialsProviderTest {
val token = "auth\r\ntoken"
val engine = TestConnection()

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(
AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative",
AwsSdkSetting.AwsContainerAuthorizationToken.envVar to token,
Expand All @@ -407,13 +408,13 @@ class EcsCredentialsProviderTest {
val token = "auth\r\ntoken"
val engine = TestConnection()

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(
AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative",
AwsSdkSetting.AwsContainerAuthorizationTokenFile.envVar to tokenFile,
),
fs = mapOf(
tokenFile to token,
tokenFile to TestFile(token),
),
)

Expand All @@ -432,7 +433,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative"),
)

Expand All @@ -455,7 +456,7 @@ class EcsCredentialsProviderTest {
}
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative"),
)

Expand Down Expand Up @@ -485,7 +486,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative"),
)

Expand Down Expand Up @@ -517,7 +518,7 @@ class EcsCredentialsProviderTest {
}
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative"),
)

Expand All @@ -542,7 +543,7 @@ class EcsCredentialsProviderTest {
}
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative"),
)

Expand All @@ -563,7 +564,7 @@ class EcsCredentialsProviderTest {
)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsContainerCredentialsRelativeUri.envVar to "/relative?foo=bar"),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import kotlin.time.Duration.Companion.seconds

class ImdsCredentialsProviderTest {

private val ec2MetadataDisabledPlatform = TestPlatformProvider(
private val ec2MetadataDisabledPlatform = TestPlatformProvider.of(
env = mapOf(AwsSdkSetting.AwsEc2MetadataDisabled.envVar to "true"),
)
private val ec2MetadataEnabledPlatform = TestPlatformProvider()
private val ec2MetadataEnabledPlatform = TestPlatformProvider.of()

@Test
fun testImdsDisabled() = runTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import aws.smithy.kotlin.runtime.httptest.TestConnection
import aws.smithy.kotlin.runtime.httptest.buildTestConnection
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.ManualClock
import aws.smithy.kotlin.runtime.util.TestFile
import aws.smithy.kotlin.runtime.util.TestPlatformProvider
import io.kotest.matchers.string.shouldMatch
import kotlinx.coroutines.test.runTest
Expand Down Expand Up @@ -64,9 +65,9 @@ class LoginCredentialsProviderTest {

val key = getLoginCacheFilename("arn:aws:iam::0123456789012:user/Admin")

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf("HOME" to "/home"),
fs = mapOf("/home/.aws/login/cache/$key" to contents),
fs = mapOf("/home/.aws/login/cache/$key" to TestFile(contents)),
)

val provider = LoginCredentialsProvider(
Expand Down Expand Up @@ -125,9 +126,9 @@ class LoginCredentialsProviderTest {

val key = getLoginCacheFilename("arn:aws:iam::123456789:user/TestUser")

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf("HOME" to "/home"),
fs = mapOf("/home/.aws/login/cache/$key" to contents),
fs = mapOf("/home/.aws/login/cache/$key" to TestFile(contents)),
)

val provider = LoginCredentialsProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import aws.smithy.kotlin.runtime.httptest.TestConnection
import aws.smithy.kotlin.runtime.httptest.buildTestConnection
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.ManualClock
import aws.smithy.kotlin.runtime.util.TestFile
import aws.smithy.kotlin.runtime.util.TestPlatformProvider
import kotlinx.coroutines.test.runTest
import kotlinx.serialization.json.*
Expand Down Expand Up @@ -110,12 +111,12 @@ class LoginTokenProviderTest {
val loginSessionName = "arn:aws:sts::012345678910:assumed-role/Admin/admin"

// Setup filesystem with cache files
val fs = mutableMapOf<String, String>()
val fs = mutableMapOf<String, TestFile>()
testCase.cacheContents.forEach { (filename, content) ->
fs["/home/.aws/login/cache/$filename"] = content
fs["/home/.aws/login/cache/$filename"] = TestFile(content)
}

val testPlatform = TestPlatformProvider(
val testPlatform = TestPlatformProvider.of(
env = mapOf("HOME" to "/home"),
fs = fs,
)
Expand Down
Loading
Loading