Skip to content

Commit 4271fe0

Browse files
authored
refactor: track upstream runtime changes (#827)
1 parent 2494f59 commit 4271fe0

File tree

42 files changed

+79
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+79
-82
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "5b2586c6-7776-477c-abff-ea9f8b12e2c9",
3+
"type": "misc",
4+
"description": "Refactor: track upstream module refactoring"
5+
}

aws-runtime/aws-config/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ kotlin {
3636
dependencies {
3737
api(project(":aws-runtime:aws-core"))
3838
implementation("aws.smithy.kotlin:logging:$smithyKotlinVersion")
39-
implementation("aws.smithy.kotlin:hashing:$smithyKotlinVersion")
4039
implementation("aws.smithy.kotlin:http:$smithyKotlinVersion")
4140
implementation("aws.smithy.kotlin:tracing-core:$smithyKotlinVersion")
42-
implementation("aws.smithy.kotlin:utils:$smithyKotlinVersion")
4341
implementation("aws.smithy.kotlin:http-client-engine-default:$smithyKotlinVersion")
4442
implementation(project(":aws-runtime:aws-http"))
4543

@@ -79,7 +77,7 @@ kotlin {
7977
}
8078

8179
all {
82-
languageSettings.optIn("aws.smithy.kotlin.runtime.util.InternalApi")
80+
languageSettings.optIn("aws.smithy.kotlin.runtime.InternalApi")
8381
languageSettings.optIn("aws.sdk.kotlin.runtime.InternalSdkApi")
8482
}
8583
}

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/DefaultChainCredentialsProvider.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import aws.smithy.kotlin.runtime.http.engine.DefaultHttpEngine
1313
import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
1414
import aws.smithy.kotlin.runtime.io.Closeable
1515
import aws.smithy.kotlin.runtime.io.closeIfCloseable
16-
import aws.smithy.kotlin.runtime.util.Platform
1716
import aws.smithy.kotlin.runtime.util.PlatformProvider
1817

1918
/**
@@ -41,7 +40,7 @@ import aws.smithy.kotlin.runtime.util.PlatformProvider
4140
*/
4241
public class DefaultChainCredentialsProvider constructor(
4342
private val profileName: String? = null,
44-
private val platformProvider: PlatformProvider = Platform,
43+
private val platformProvider: PlatformProvider = PlatformProvider.System,
4544
httpClientEngine: HttpClientEngine? = null,
4645
region: String? = null,
4746
) : CloseableCredentialsProvider {

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/EcsCredentialsProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import aws.smithy.kotlin.runtime.retries.policy.RetryErrorType
2828
import aws.smithy.kotlin.runtime.retries.policy.RetryPolicy
2929
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
3030
import aws.smithy.kotlin.runtime.time.TimestampFormat
31-
import aws.smithy.kotlin.runtime.util.Platform
3231
import aws.smithy.kotlin.runtime.util.PlatformEnvironProvider
32+
import aws.smithy.kotlin.runtime.util.PlatformProvider
3333
import kotlin.coroutines.coroutineContext
3434

3535
/**
@@ -60,7 +60,7 @@ public class EcsCredentialsProvider internal constructor(
6060
httpClientEngine: HttpClientEngine? = null,
6161
) : CloseableCredentialsProvider {
6262

63-
public constructor() : this(Platform)
63+
public constructor() : this(PlatformProvider.System)
6464

6565
private val manageEngine = httpClientEngine == null
6666
private val httpClientEngine = httpClientEngine ?: DefaultHttpEngine()

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import aws.smithy.kotlin.runtime.auth.awscredentials.CloseableCredentialsProvide
1010
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
1111
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
1212
import aws.smithy.kotlin.runtime.tracing.trace
13-
import aws.smithy.kotlin.runtime.util.Platform
13+
import aws.smithy.kotlin.runtime.util.PlatformProvider
1414
import kotlin.coroutines.coroutineContext
1515

1616
private const val PROVIDER_NAME = "Environment"
@@ -24,7 +24,7 @@ private val SESSION_TOKEN = AwsSdkSetting.AwsSessionToken.environmentVariable
2424
*/
2525
public class EnvironmentCredentialsProvider
2626
public constructor(private val getEnv: (String) -> String?) : CloseableCredentialsProvider {
27-
public constructor() : this(Platform::getenv)
27+
public constructor() : this(PlatformProvider.System::getenv)
2828

2929
private fun requireEnv(variable: String): String =
3030
getEnv(variable) ?: throw ProviderConfigurationException("Missing value for environment variable `$variable`")

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import aws.smithy.kotlin.runtime.time.Clock
1919
import aws.smithy.kotlin.runtime.time.Instant
2020
import aws.smithy.kotlin.runtime.tracing.info
2121
import aws.smithy.kotlin.runtime.tracing.warn
22-
import aws.smithy.kotlin.runtime.util.Platform
2322
import aws.smithy.kotlin.runtime.util.PlatformEnvironProvider
23+
import aws.smithy.kotlin.runtime.util.PlatformProvider
2424
import aws.smithy.kotlin.runtime.util.asyncLazy
2525
import kotlinx.coroutines.sync.Mutex
2626
import kotlinx.coroutines.sync.withLock
@@ -51,7 +51,7 @@ internal expect class SdkIOException : Exception // FIXME move this to the prope
5151
public class ImdsCredentialsProvider(
5252
private val profileOverride: String? = null,
5353
private val client: Lazy<InstanceMetadataProvider> = lazy { ImdsClient() },
54-
private val platformProvider: PlatformEnvironProvider = Platform,
54+
private val platformProvider: PlatformEnvironProvider = PlatformProvider.System,
5555
private val clock: Clock = Clock.System,
5656
) : CloseableCredentialsProvider {
5757
private var previousCredentials: Credentials? = null

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/ProcessCredentialsProvider.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import aws.smithy.kotlin.runtime.logging.Logger
66
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
77
import aws.smithy.kotlin.runtime.time.Clock
88
import aws.smithy.kotlin.runtime.time.Instant
9-
import aws.smithy.kotlin.runtime.util.Platform
109
import aws.smithy.kotlin.runtime.util.PlatformProvider
1110

1211
internal expect suspend fun executeCommand(
@@ -38,7 +37,7 @@ private const val PROVIDER_NAME = "Process"
3837
*/
3938
public class ProcessCredentialsProvider(
4039
private val credentialProcess: String,
41-
private val platformProvider: PlatformProvider = Platform,
40+
private val platformProvider: PlatformProvider = PlatformProvider.System,
4241
private val maxOutputLengthBytes: Long = 64 * 1024,
4342
private val timeoutMillis: Long = 60_000,
4443
) : CredentialsProvider {

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/ProfileCredentialsProvider.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import aws.smithy.kotlin.runtime.http.operation.getLogger
2121
import aws.smithy.kotlin.runtime.io.Closeable
2222
import aws.smithy.kotlin.runtime.time.TimestampFormat
2323
import aws.smithy.kotlin.runtime.util.LazyAsyncValue
24-
import aws.smithy.kotlin.runtime.util.Platform
2524
import aws.smithy.kotlin.runtime.util.PlatformProvider
2625
import aws.smithy.kotlin.runtime.util.asyncLazy
2726
import kotlin.coroutines.coroutineContext
@@ -77,7 +76,7 @@ import kotlin.coroutines.coroutineContext
7776
public class ProfileCredentialsProvider(
7877
private val profileName: String? = null,
7978
private val region: String? = null,
80-
private val platformProvider: PlatformProvider = Platform,
79+
private val platformProvider: PlatformProvider = PlatformProvider.System,
8180
private val httpClientEngine: HttpClientEngine? = null,
8281
) : CloseableCredentialsProvider {
8382
private val namedProviders = mapOf(

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/SsoCredentialsProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public class SsoCredentialsProvider public constructor(
8888
/**
8989
* The platform provider
9090
*/
91-
private val platformProvider: PlatformProvider = Platform,
91+
private val platformProvider: PlatformProvider = PlatformProvider.System,
9292

9393
/**
9494
* The source of time for the provider

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/StsAssumeRoleCredentialsProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import aws.smithy.kotlin.runtime.time.Instant
1818
import aws.smithy.kotlin.runtime.time.TimestampFormat
1919
import aws.smithy.kotlin.runtime.time.epochMilliseconds
2020
import aws.smithy.kotlin.runtime.tracing.*
21-
import aws.smithy.kotlin.runtime.util.Platform
2221
import aws.smithy.kotlin.runtime.util.PlatformEnvironProvider
22+
import aws.smithy.kotlin.runtime.util.PlatformProvider
2323
import kotlin.coroutines.coroutineContext
2424
import kotlin.time.Duration
2525
import kotlin.time.Duration.Companion.seconds
@@ -106,5 +106,5 @@ public class StsAssumeRoleCredentialsProvider(
106106
}
107107

108108
// role session name must be provided to assume a role, when the user doesn't provide one we choose a name for them
109-
internal fun defaultSessionName(platformEnvironProvider: PlatformEnvironProvider = Platform): String =
109+
internal fun defaultSessionName(platformEnvironProvider: PlatformEnvironProvider = PlatformProvider.System): String =
110110
AwsSdkSetting.AwsRoleSessionName.resolve(platformEnvironProvider) ?: "aws-sdk-kotlin-${Instant.now().epochMilliseconds}"

0 commit comments

Comments
 (0)