Skip to content

Commit f985986

Browse files
committed
Merge branch 'v1.4' of github.com:awslabs/aws-sdk-kotlin into misc-kotlin-2.1.0
2 parents 98e652f + 31dca75 commit f985986

File tree

57 files changed

+1193
-188
lines changed

Some content is hidden

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

57 files changed

+1193
-188
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "0b5b53ab-70c0-4c1b-a445-8663ae86d6d1",
3+
"type": "misc",
4+
"description": "The order of credentials resolution in config files has been updated to: static credentials, assume role with source profile OR assume role with named provider, web identity token, SSO session, legacy SSO, process",
5+
"requiresMinorVersionBump": true
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "99a099e1-26c1-4ba1-b0d3-435609ea4e94",
3+
"type": "misc",
4+
"description": "The order of credentials resolution in the credentials provider chain has been updated to: system properties, environment variables, web identity tokens, profile, ECS, EC2",
5+
"requiresMinorVersionBump": true
6+
}

aws-runtime/aws-config/api/aws-config.api

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/DefaultChainCredentia
5151
public final fun getProfileName ()Ljava/lang/String;
5252
public final fun getRegion ()Ljava/lang/String;
5353
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
54+
public fun toString ()Ljava/lang/String;
5455
}
5556

5657
public final class aws/sdk/kotlin/runtime/auth/credentials/EcsCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
@@ -62,6 +63,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/EcsCredentialsProvide
6263
public fun close ()V
6364
public final fun getPlatformProvider ()Laws/smithy/kotlin/runtime/util/PlatformProvider;
6465
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
66+
public fun toString ()Ljava/lang/String;
6567
}
6668

6769
public final class aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider {
@@ -70,6 +72,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredential
7072
public synthetic fun <init> (Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
7173
public final fun getGetEnv ()Lkotlin/jvm/functions/Function1;
7274
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
75+
public fun toString ()Ljava/lang/String;
7376
}
7477

7578
public final class aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
@@ -81,6 +84,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvid
8184
public final fun getPlatformProvider ()Laws/smithy/kotlin/runtime/util/PlatformEnvironProvider;
8285
public final fun getProfileOverride ()Ljava/lang/String;
8386
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
87+
public fun toString ()Ljava/lang/String;
8488
}
8589

8690
public final class aws/sdk/kotlin/runtime/auth/credentials/InvalidJsonCredentialsException : aws/sdk/kotlin/runtime/ClientException {
@@ -97,6 +101,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/ProcessCredentialsPro
97101
public fun <init> (Ljava/lang/String;Laws/smithy/kotlin/runtime/util/PlatformProvider;JJ)V
98102
public synthetic fun <init> (Ljava/lang/String;Laws/smithy/kotlin/runtime/util/PlatformProvider;JJILkotlin/jvm/internal/DefaultConstructorMarker;)V
99103
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
104+
public fun toString ()Ljava/lang/String;
100105
}
101106

102107
public final class aws/sdk/kotlin/runtime/auth/credentials/ProfileCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
@@ -112,6 +117,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/ProfileCredentialsPro
112117
public final fun getProfileName ()Ljava/lang/String;
113118
public final fun getRegion ()Ljava/lang/String;
114119
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
120+
public fun toString ()Ljava/lang/String;
115121
}
116122

117123
public final class aws/sdk/kotlin/runtime/auth/credentials/ProviderConfigurationException : aws/sdk/kotlin/runtime/ConfigurationException {
@@ -130,6 +136,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/SsoCredentialsProvide
130136
public final fun getSsoSessionName ()Ljava/lang/String;
131137
public final fun getStartUrl ()Ljava/lang/String;
132138
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
139+
public fun toString ()Ljava/lang/String;
133140
}
134141

135142
public final class aws/sdk/kotlin/runtime/auth/credentials/SsoTokenProvider : aws/smithy/kotlin/runtime/http/auth/BearerTokenProvider {
@@ -150,6 +157,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/StaticCredentialsProv
150157
public fun <init> (Laws/smithy/kotlin/runtime/auth/awscredentials/Credentials;)V
151158
public final fun getCredentials ()Laws/smithy/kotlin/runtime/auth/awscredentials/Credentials;
152159
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
160+
public fun toString ()Ljava/lang/String;
153161
}
154162

155163
public final class aws/sdk/kotlin/runtime/auth/credentials/StaticCredentialsProvider$Builder {
@@ -179,6 +187,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/StsAssumeRoleCredenti
179187
public final fun getHttpClient ()Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;
180188
public final fun getRegion ()Ljava/lang/String;
181189
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
190+
public fun toString ()Ljava/lang/String;
182191
}
183192

184193
public final class aws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider {
@@ -192,19 +201,32 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredent
192201
public final fun getRegion ()Ljava/lang/String;
193202
public final fun getWebIdentityParameters ()Laws/sdk/kotlin/runtime/auth/credentials/AssumeRoleWithWebIdentityParameters;
194203
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
204+
public fun toString ()Ljava/lang/String;
195205
}
196206

197207
public final class aws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider$Companion {
198208
public final fun fromEnvironment-TUY-ock (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JLaws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;)Laws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider;
199209
public static synthetic fun fromEnvironment-TUY-ock$default (Laws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JLaws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;ILjava/lang/Object;)Laws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider;
200210
}
201211

212+
public final class aws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
213+
public fun <init> ()V
214+
public fun <init> (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;Ljava/lang/String;)V
215+
public synthetic fun <init> (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
216+
public fun close ()V
217+
public final fun getHttpClient ()Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;
218+
public final fun getPlatformProvider ()Laws/smithy/kotlin/runtime/util/PlatformProvider;
219+
public final fun getRegion ()Ljava/lang/String;
220+
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
221+
}
222+
202223
public final class aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider {
203224
public fun <init> ()V
204225
public fun <init> (Lkotlin/jvm/functions/Function1;)V
205226
public synthetic fun <init> (Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
206227
public final fun getGetProperty ()Lkotlin/jvm/functions/Function1;
207228
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
229+
public fun toString ()Ljava/lang/String;
208230
}
209231

210232
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/ManagedBearerTokenProviderKt {

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

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ package aws.sdk.kotlin.runtime.auth.credentials
77

88
import aws.sdk.kotlin.runtime.config.AwsSdkSetting
99
import aws.sdk.kotlin.runtime.config.imds.ImdsClient
10-
import aws.smithy.kotlin.runtime.auth.awscredentials.CachedCredentialsProvider
11-
import aws.smithy.kotlin.runtime.auth.awscredentials.CloseableCredentialsProvider
12-
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
13-
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderChain
10+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
11+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.withBusinessMetric
12+
import aws.smithy.kotlin.runtime.auth.awscredentials.*
1413
import aws.smithy.kotlin.runtime.collections.Attributes
1514
import aws.smithy.kotlin.runtime.http.engine.DefaultHttpEngine
1615
import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
@@ -23,11 +22,12 @@ import aws.smithy.kotlin.runtime.util.PlatformProvider
2322
*
2423
* Resolution order:
2524
*
26-
* 1. Environment variables ([EnvironmentCredentialsProvider])
27-
* 2. Profile ([ProfileCredentialsProvider])
25+
* 1. System properties ([SystemPropertyCredentialsProvider])
26+
* 2. Environment variables ([EnvironmentCredentialsProvider])
2827
* 3. Web Identity Tokens ([StsWebIdentityCredentialsProvider]]
29-
* 4. ECS (IAM roles for tasks) ([EcsCredentialsProvider])
30-
* 5. EC2 Instance Metadata (IMDSv2) ([ImdsCredentialsProvider])
28+
* 4. Profile ([ProfileCredentialsProvider])
29+
* 5. ECS (IAM roles for tasks) ([EcsCredentialsProvider])
30+
* 6. EC2 Instance Metadata (IMDSv2) ([ImdsCredentialsProvider])
3131
*
3232
* The chain is decorated with a [CachedCredentialsProvider].
3333
*
@@ -54,9 +54,9 @@ public class DefaultChainCredentialsProvider constructor(
5454
private val chain = CredentialsProviderChain(
5555
SystemPropertyCredentialsProvider(platformProvider::getProperty),
5656
EnvironmentCredentialsProvider(platformProvider::getenv),
57-
ProfileCredentialsProvider(profileName = profileName, platformProvider = platformProvider, httpClient = engine, region = region),
5857
// STS web identity provider can be constructed from either the profile OR 100% from the environment
5958
StsWebIdentityProvider(platformProvider = platformProvider, httpClient = engine, region = region),
59+
ProfileCredentialsProvider(profileName = profileName, platformProvider = platformProvider, httpClient = engine, region = region),
6060
EcsCredentialsProvider(platformProvider, engine),
6161
ImdsCredentialsProvider(
6262
client = lazy {
@@ -79,20 +79,22 @@ public class DefaultChainCredentialsProvider constructor(
7979
engine.closeIfCloseable()
8080
}
8181
}
82+
83+
override fun toString(): String = this.simpleClassName + ": " + this.chain
8284
}
8385

8486
/**
8587
* Wrapper around [StsWebIdentityCredentialsProvider] that delays any exceptions until [resolve] is invoked.
8688
* This allows it to be part of the default chain and any failures result in the chain to move onto the next provider.
8789
*/
88-
private class StsWebIdentityProvider(
89-
val platformProvider: PlatformProvider = PlatformProvider.System,
90-
val httpClient: HttpClientEngine? = null,
91-
val region: String? = null,
90+
public class StsWebIdentityProvider(
91+
public val platformProvider: PlatformProvider = PlatformProvider.System,
92+
public val httpClient: HttpClientEngine? = null,
93+
public val region: String? = null,
9294
) : CloseableCredentialsProvider {
9395
override suspend fun resolve(attributes: Attributes): Credentials {
9496
val wrapped = StsWebIdentityCredentialsProvider.fromEnvironment(platformProvider = platformProvider, httpClient = httpClient, region = region)
95-
return wrapped.resolve(attributes)
97+
return wrapped.resolve(attributes).withBusinessMetric(AwsBusinessMetric.Credentials.CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN)
9698
}
9799

98100
override fun close() { }

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ package aws.sdk.kotlin.runtime.auth.credentials
77

88
import aws.sdk.kotlin.runtime.auth.credentials.internal.credentials
99
import aws.sdk.kotlin.runtime.config.AwsSdkSetting
10+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
11+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.withBusinessMetric
1012
import aws.smithy.kotlin.runtime.ErrorMetadata
11-
import aws.smithy.kotlin.runtime.auth.awscredentials.CloseableCredentialsProvider
12-
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
13-
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
14-
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderException
13+
import aws.smithy.kotlin.runtime.auth.awscredentials.*
1514
import aws.smithy.kotlin.runtime.client.endpoints.Endpoint
1615
import aws.smithy.kotlin.runtime.collections.Attributes
1716
import aws.smithy.kotlin.runtime.config.resolve
@@ -79,6 +78,7 @@ public class EcsCredentialsProvider(
7978

8079
override suspend fun resolve(attributes: Attributes): Credentials {
8180
val logger = coroutineContext.logger<EcsCredentialsProvider>()
81+
8282
val authToken = loadAuthToken()
8383
val relativeUri = AwsSdkSetting.AwsContainerCredentialsRelativeUri.resolve(platformProvider)
8484
val fullUri = AwsSdkSetting.AwsContainerCredentialsFullUri.resolve(platformProvider)
@@ -113,7 +113,7 @@ public class EcsCredentialsProvider(
113113

114114
logger.debug { "obtained credentials from container metadata service; expiration=${creds.expiration?.format(TimestampFormat.ISO_8601)}" }
115115

116-
return creds
116+
return creds.withBusinessMetric(AwsBusinessMetric.Credentials.CREDENTIALS_HTTP)
117117
}
118118

119119
private suspend fun loadAuthToken(): String? {
@@ -197,6 +197,8 @@ public class EcsCredentialsProvider(
197197
httpClient.closeIfCloseable()
198198
}
199199
}
200+
201+
override fun toString(): String = this.simpleClassName
200202
}
201203

202204
private class EcsCredentialsDeserializer : HttpDeserialize<Credentials> {

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ package aws.sdk.kotlin.runtime.auth.credentials
77

88
import aws.sdk.kotlin.runtime.auth.credentials.internal.credentials
99
import aws.sdk.kotlin.runtime.config.AwsSdkSetting
10+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
11+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.withBusinessMetric
1012
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
1113
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
14+
import aws.smithy.kotlin.runtime.auth.awscredentials.simpleClassName
1215
import aws.smithy.kotlin.runtime.collections.Attributes
1316
import aws.smithy.kotlin.runtime.telemetry.logging.trace
1417
import aws.smithy.kotlin.runtime.util.PlatformProvider
@@ -35,12 +38,15 @@ public class EnvironmentCredentialsProvider(
3538
coroutineContext.trace<EnvironmentCredentialsProvider> {
3639
"Attempting to load credentials from env vars $ACCESS_KEY_ID/$SECRET_ACCESS_KEY/$SESSION_TOKEN"
3740
}
41+
3842
return credentials(
3943
accessKeyId = requireEnv(ACCESS_KEY_ID),
4044
secretAccessKey = requireEnv(SECRET_ACCESS_KEY),
4145
sessionToken = getEnv(SESSION_TOKEN),
4246
providerName = PROVIDER_NAME,
4347
accountId = getEnv(ACCOUNT_ID),
44-
)
48+
).withBusinessMetric(AwsBusinessMetric.Credentials.CREDENTIALS_ENV_VARS)
4549
}
50+
51+
override fun toString(): String = this.simpleClassName
4652
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import aws.sdk.kotlin.runtime.config.AwsSdkSetting
99
import aws.sdk.kotlin.runtime.config.imds.EC2MetadataError
1010
import aws.sdk.kotlin.runtime.config.imds.ImdsClient
1111
import aws.sdk.kotlin.runtime.config.imds.InstanceMetadataProvider
12-
import aws.smithy.kotlin.runtime.auth.awscredentials.CloseableCredentialsProvider
13-
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
14-
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
15-
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderException
16-
import aws.smithy.kotlin.runtime.auth.awscredentials.DEFAULT_CREDENTIALS_REFRESH_SECONDS
12+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
13+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.withBusinessMetric
14+
import aws.smithy.kotlin.runtime.auth.awscredentials.*
1715
import aws.smithy.kotlin.runtime.collections.Attributes
1816
import aws.smithy.kotlin.runtime.config.resolve
1917
import aws.smithy.kotlin.runtime.http.HttpStatusCode
@@ -110,7 +108,7 @@ public class ImdsCredentialsProvider(
110108
resp.sessionToken,
111109
resp.expiration,
112110
PROVIDER_NAME,
113-
)
111+
).withBusinessMetric(AwsBusinessMetric.Credentials.CREDENTIALS_IMDS)
114112

115113
creds.also {
116114
mu.withLock { previousCredentials = it }
@@ -151,4 +149,6 @@ public class ImdsCredentialsProvider(
151149
}
152150
else -> null
153151
}
152+
153+
override fun toString(): String = this.simpleClassName
154154
}

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
package aws.sdk.kotlin.runtime.auth.credentials
66

77
import aws.sdk.kotlin.runtime.auth.credentials.internal.credentials
8-
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
9-
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
10-
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderException
8+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
9+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.withBusinessMetric
10+
import aws.smithy.kotlin.runtime.auth.awscredentials.*
1111
import aws.smithy.kotlin.runtime.collections.Attributes
1212
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
1313
import aws.smithy.kotlin.runtime.telemetry.logging.logger
@@ -67,15 +67,19 @@ public class ProcessCredentialsProvider(
6767
val deserializer = JsonDeserializer(payload)
6868

6969
return when (val resp = deserializeJsonProcessCredentials(deserializer)) {
70-
is JsonCredentialsResponse.SessionCredentials -> credentials(
71-
resp.accessKeyId,
72-
resp.secretAccessKey,
73-
resp.sessionToken,
74-
resp.expiration ?: Instant.MAX_VALUE,
75-
PROVIDER_NAME,
76-
resp.accountId,
77-
)
70+
is JsonCredentialsResponse.SessionCredentials -> {
71+
credentials(
72+
resp.accessKeyId,
73+
resp.secretAccessKey,
74+
resp.sessionToken,
75+
resp.expiration ?: Instant.MAX_VALUE,
76+
PROVIDER_NAME,
77+
resp.accountId,
78+
).withBusinessMetric(AwsBusinessMetric.Credentials.CREDENTIALS_PROCESS)
79+
}
7880
else -> throw CredentialsProviderException("Credentials response was not of expected format")
7981
}
8082
}
83+
84+
override fun toString(): String = this.simpleClassName
8185
}

0 commit comments

Comments
 (0)