Skip to content

Commit b39d470

Browse files
authored
feature: add sub-property support to config parser (#854)
1 parent d29e9e4 commit b39d470

File tree

31 files changed

+695
-626
lines changed

31 files changed

+695
-626
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "eac80a26-c648-4ff5-a606-87bfc11ce665",
3+
"type": "feature",
4+
"description": "Add sub-property support for AWS config."
5+
}

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

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ public abstract interface class aws/sdk/kotlin/runtime/auth/credentials/internal
129129
public static fun builder ()Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$Builder;
130130
public abstract fun getConfig ()Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$Config;
131131
public abstract fun getRoleCredentials (Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/model/GetRoleCredentialsRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
132-
public abstract fun getServiceName ()Ljava/lang/String;
133132
}
134133

135134
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$Builder : aws/smithy/kotlin/runtime/client/AbstractSdkClientBuilder {
@@ -146,6 +145,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClien
146145
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$Config : aws/sdk/kotlin/runtime/client/AwsSdkClientConfig, aws/smithy/kotlin/runtime/client/SdkClientConfig, aws/smithy/kotlin/runtime/http/config/HttpClientConfig, aws/smithy/kotlin/runtime/tracing/TracingClientConfig {
147146
public static final field Companion Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$Config$Companion;
148147
public synthetic fun <init> (Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$Config$Builder;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
148+
public fun getClientName ()Ljava/lang/String;
149149
public final fun getCredentialsProvider ()Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;
150150
public final fun getEndpointProvider ()Laws/smithy/kotlin/runtime/client/endpoints/EndpointProvider;
151151
public final fun getEndpointUrl ()Laws/smithy/kotlin/runtime/net/Url;
@@ -166,6 +166,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClien
166166
public fun <init> ()V
167167
public fun build ()Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$Config;
168168
public synthetic fun build ()Ljava/lang/Object;
169+
public fun getClientName ()Ljava/lang/String;
169170
public final fun getCredentialsProvider ()Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;
170171
public final fun getEndpointProvider ()Laws/smithy/kotlin/runtime/client/endpoints/EndpointProvider;
171172
public final fun getEndpointUrl ()Laws/smithy/kotlin/runtime/net/Url;
@@ -179,6 +180,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClien
179180
public fun getTracer ()Laws/smithy/kotlin/runtime/tracing/Tracer;
180181
public final fun getUseDualStack ()Z
181182
public final fun getUseFips ()Z
183+
public fun setClientName (Ljava/lang/String;)V
182184
public final fun setCredentialsProvider (Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;)V
183185
public final fun setEndpointProvider (Laws/smithy/kotlin/runtime/client/endpoints/EndpointProvider;)V
184186
public final fun setEndpointUrl (Laws/smithy/kotlin/runtime/net/Url;)V
@@ -198,10 +200,6 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClien
198200
public final fun invoke (Lkotlin/jvm/functions/Function1;)Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$Config;
199201
}
200202

201-
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient$DefaultImpls {
202-
public static fun getServiceName (Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient;)Ljava/lang/String;
203-
}
204-
205203
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClientKt {
206204
public static final fun getRoleCredentials (Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
207205
public static final fun withConfig (Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient;Lkotlin/jvm/functions/Function1;)Laws/sdk/kotlin/runtime/auth/credentials/internal/sso/SsoClient;
@@ -440,7 +438,6 @@ public abstract interface class aws/sdk/kotlin/runtime/auth/credentials/internal
440438
public abstract fun assumeRoleWithWebIdentity (Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/model/AssumeRoleWithWebIdentityRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
441439
public static fun builder ()Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$Builder;
442440
public abstract fun getConfig ()Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$Config;
443-
public abstract fun getServiceName ()Ljava/lang/String;
444441
}
445442

446443
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$Builder : aws/smithy/kotlin/runtime/client/AbstractSdkClientBuilder {
@@ -457,6 +454,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClien
457454
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$Config : aws/sdk/kotlin/runtime/client/AwsSdkClientConfig, aws/smithy/kotlin/runtime/client/SdkClientConfig, aws/smithy/kotlin/runtime/http/config/HttpClientConfig, aws/smithy/kotlin/runtime/tracing/TracingClientConfig {
458455
public static final field Companion Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$Config$Companion;
459456
public synthetic fun <init> (Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$Config$Builder;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
457+
public fun getClientName ()Ljava/lang/String;
460458
public final fun getCredentialsProvider ()Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;
461459
public final fun getEndpointProvider ()Laws/smithy/kotlin/runtime/client/endpoints/EndpointProvider;
462460
public final fun getEndpointUrl ()Laws/smithy/kotlin/runtime/net/Url;
@@ -477,6 +475,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClien
477475
public fun <init> ()V
478476
public fun build ()Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$Config;
479477
public synthetic fun build ()Ljava/lang/Object;
478+
public fun getClientName ()Ljava/lang/String;
480479
public final fun getCredentialsProvider ()Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;
481480
public final fun getEndpointProvider ()Laws/smithy/kotlin/runtime/client/endpoints/EndpointProvider;
482481
public final fun getEndpointUrl ()Laws/smithy/kotlin/runtime/net/Url;
@@ -490,6 +489,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClien
490489
public fun getTracer ()Laws/smithy/kotlin/runtime/tracing/Tracer;
491490
public final fun getUseDualStack ()Z
492491
public final fun getUseFips ()Z
492+
public fun setClientName (Ljava/lang/String;)V
493493
public final fun setCredentialsProvider (Laws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider;)V
494494
public final fun setEndpointProvider (Laws/smithy/kotlin/runtime/client/endpoints/EndpointProvider;)V
495495
public final fun setEndpointUrl (Laws/smithy/kotlin/runtime/net/Url;)V
@@ -509,10 +509,6 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClien
509509
public final fun invoke (Lkotlin/jvm/functions/Function1;)Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$Config;
510510
}
511511

512-
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient$DefaultImpls {
513-
public static fun getServiceName (Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient;)Ljava/lang/String;
514-
}
515-
516512
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClientKt {
517513
public static final fun assumeRole (Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
518514
public static final fun assumeRoleWithWebIdentity (Laws/sdk/kotlin/runtime/auth/credentials/internal/sts/StsClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@@ -1165,14 +1161,14 @@ public abstract interface class aws/sdk/kotlin/runtime/config/imds/InstanceMetad
11651161
public final class aws/sdk/kotlin/runtime/config/profile/AwsConfigLoaderKt {
11661162
}
11671163

1168-
public class aws/sdk/kotlin/runtime/config/profile/AwsConfigParseException : aws/sdk/kotlin/runtime/ConfigurationException {
1169-
public fun <init> (Ljava/lang/String;)V
1164+
public final class aws/sdk/kotlin/runtime/config/profile/AwsConfigParseException : aws/sdk/kotlin/runtime/ConfigurationException {
1165+
public fun <init> (Ljava/lang/String;I)V
11701166
}
11711167

1172-
public final class aws/sdk/kotlin/runtime/config/profile/AwsProfile : java/util/Map, kotlin/jvm/internal/markers/KMappedMarker {
1173-
public fun <init> (Ljava/lang/String;Ljava/util/Map;)V
1168+
public final class aws/sdk/kotlin/runtime/config/profile/AwsConfigValue$Map : aws/sdk/kotlin/runtime/config/profile/AwsConfigValue, java/util/Map, kotlin/jvm/internal/markers/KMappedMarker {
1169+
public fun <init> (Ljava/util/Map;)V
11741170
public fun clear ()V
1175-
public final fun component1 ()Ljava/lang/String;
1171+
public final fun component1 ()Ljava/util/Map;
11761172
public synthetic fun compute (Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
11771173
public fun compute (Ljava/lang/String;Ljava/util/function/BiFunction;)Ljava/lang/String;
11781174
public synthetic fun computeIfAbsent (Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;
@@ -1183,17 +1179,17 @@ public final class aws/sdk/kotlin/runtime/config/profile/AwsProfile : java/util/
11831179
public fun containsKey (Ljava/lang/String;)Z
11841180
public final fun containsValue (Ljava/lang/Object;)Z
11851181
public fun containsValue (Ljava/lang/String;)Z
1186-
public final fun copy (Ljava/lang/String;Ljava/util/Map;)Laws/sdk/kotlin/runtime/config/profile/AwsProfile;
1187-
public static synthetic fun copy$default (Laws/sdk/kotlin/runtime/config/profile/AwsProfile;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)Laws/sdk/kotlin/runtime/config/profile/AwsProfile;
1182+
public final fun copy (Ljava/util/Map;)Laws/sdk/kotlin/runtime/config/profile/AwsConfigValue$Map;
1183+
public static synthetic fun copy$default (Laws/sdk/kotlin/runtime/config/profile/AwsConfigValue$Map;Ljava/util/Map;ILjava/lang/Object;)Laws/sdk/kotlin/runtime/config/profile/AwsConfigValue$Map;
11881184
public final fun entrySet ()Ljava/util/Set;
11891185
public fun equals (Ljava/lang/Object;)Z
11901186
public final synthetic fun get (Ljava/lang/Object;)Ljava/lang/Object;
11911187
public final fun get (Ljava/lang/Object;)Ljava/lang/String;
11921188
public fun get (Ljava/lang/String;)Ljava/lang/String;
11931189
public fun getEntries ()Ljava/util/Set;
11941190
public fun getKeys ()Ljava/util/Set;
1195-
public final fun getName ()Ljava/lang/String;
11961191
public fun getSize ()I
1192+
public final fun getValue ()Ljava/util/Map;
11971193
public fun getValues ()Ljava/util/Collection;
11981194
public fun hashCode ()I
11991195
public fun isEmpty ()Z
@@ -1218,6 +1214,17 @@ public final class aws/sdk/kotlin/runtime/config/profile/AwsProfile : java/util/
12181214
public final fun values ()Ljava/util/Collection;
12191215
}
12201216

1217+
public final class aws/sdk/kotlin/runtime/config/profile/AwsConfigValue$String : aws/sdk/kotlin/runtime/config/profile/AwsConfigValue {
1218+
public fun <init> (Ljava/lang/String;)V
1219+
public final fun component1 ()Ljava/lang/String;
1220+
public final fun copy (Ljava/lang/String;)Laws/sdk/kotlin/runtime/config/profile/AwsConfigValue$String;
1221+
public static synthetic fun copy$default (Laws/sdk/kotlin/runtime/config/profile/AwsConfigValue$String;Ljava/lang/String;ILjava/lang/Object;)Laws/sdk/kotlin/runtime/config/profile/AwsConfigValue$String;
1222+
public fun equals (Ljava/lang/Object;)Z
1223+
public final fun getValue ()Ljava/lang/String;
1224+
public fun hashCode ()I
1225+
public fun toString ()Ljava/lang/String;
1226+
}
1227+
12211228
public final class aws/sdk/kotlin/runtime/config/profile/AwsProfileKt {
12221229
public static final fun getAwsAccessKeyId (Laws/sdk/kotlin/runtime/config/profile/AwsProfile;)Ljava/lang/String;
12231230
public static final fun getAwsSecretAccessKey (Laws/sdk/kotlin/runtime/config/profile/AwsProfile;)Ljava/lang/String;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public class EcsCredentialsProvider internal constructor(
8484
deserializer = EcsCredentialsDeserializer()
8585
context {
8686
operationName = "EcsCredentialsProvider"
87-
service = "n/a"
8887
}
8988
}
9089
op.execution.retryPolicy = EcsCredentialsRetryPolicy()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public class ProfileCredentialsProvider(
103103

104104
// if profile is overridden for this provider, attempt to resolve it from there first
105105
val profileOverride = profileName?.let { profiles[it] }
106-
val region = asyncLazy { region ?: profileOverride?.get("region") ?: resolveRegion(platformProvider) }
106+
val region = asyncLazy { region ?: profileOverride?.getOrNull("region") ?: resolveRegion(platformProvider) }
107107

108108
val leaf = chain.leaf.toCredentialsProvider(region)
109109
logger.debug { "Resolving credentials from ${chain.leaf.description()}" }

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

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package aws.sdk.kotlin.runtime.auth.credentials.profile
88
import aws.sdk.kotlin.runtime.auth.credentials.ProviderConfigurationException
99
import aws.sdk.kotlin.runtime.auth.credentials.profile.LeafProviderResult.Err
1010
import aws.sdk.kotlin.runtime.config.profile.AwsProfile
11-
import aws.sdk.kotlin.runtime.config.profile.ProfileMap
11+
import aws.sdk.kotlin.runtime.config.profile.AwsProfiles
1212
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
1313

1414
/**
@@ -33,7 +33,7 @@ internal data class ProfileChain(
3333
val roles: List<RoleArn>,
3434
) {
3535
companion object {
36-
internal fun resolve(profiles: ProfileMap, profileName: String): ProfileChain {
36+
internal fun resolve(profiles: AwsProfiles, profileName: String): ProfileChain {
3737
val visited = mutableSetOf<String>()
3838
val chain = mutableListOf<RoleArn>()
3939
var sourceProfileName = profileName
@@ -86,10 +86,8 @@ internal data class ProfileChain(
8686
}
8787
}
8888

89-
private inline fun ProfileMap.getOrThrow(name: String, lazyMessage: () -> String): AwsProfile {
90-
val props = get(name) ?: throw ProviderConfigurationException(lazyMessage())
91-
return AwsProfile(name, props)
92-
}
89+
private inline fun AwsProfiles.getOrThrow(name: String, lazyMessage: () -> String): AwsProfile =
90+
get(name) ?: throw ProviderConfigurationException(lazyMessage())
9391

9492
/**
9593
* A profile that specifies a role to assume
@@ -135,12 +133,12 @@ private fun AwsProfile.roleArnOrNull(): RoleArn? {
135133
// web identity tokens are leaf providers, not chained roles
136134
if (contains(WEB_IDENTITY_TOKEN_FILE)) return null
137135

138-
val roleArn = get(ROLE_ARN) ?: return null
136+
val roleArn = getOrNull(ROLE_ARN) ?: return null
139137

140138
return RoleArn(
141139
roleArn,
142-
sessionName = get(ROLE_SESSION_NAME),
143-
externalId = get(EXTERNAL_ID),
140+
sessionName = getOrNull(ROLE_SESSION_NAME),
141+
externalId = getOrNull(EXTERNAL_ID),
144142
)
145143
}
146144

@@ -185,9 +183,9 @@ private inline fun LeafProviderResult?.orElse(fn: () -> LeafProviderResult?): Le
185183
* does not contain a web identity token provider
186184
*/
187185
private fun AwsProfile.webIdentityTokenCreds(): LeafProviderResult? {
188-
val roleArn = get(ROLE_ARN)
189-
val tokenFile = get(WEB_IDENTITY_TOKEN_FILE)
190-
val sessionName = get(ROLE_SESSION_NAME)
186+
val roleArn = getOrNull(ROLE_ARN)
187+
val tokenFile = getOrNull(WEB_IDENTITY_TOKEN_FILE)
188+
val sessionName = getOrNull(ROLE_SESSION_NAME)
191189
return when {
192190
tokenFile == null -> null
193191
roleArn == null -> LeafProviderResult.Err("profile ($name) missing `$ROLE_ARN`")
@@ -203,10 +201,10 @@ private fun AwsProfile.ssoCreds(): LeafProviderResult? {
203201
if (!contains(SSO_START_URL) && !contains(SSO_REGION) && !contains(SSO_ACCOUNT_ID) && !contains(SSO_ROLE_NAME)) return null
204202

205203
// if one or more of the above configuration values is present the profile MUST be resolved by the SSO credential provider.
206-
val startUrl = get(SSO_START_URL) ?: return LeafProviderResult.Err("profile ($name) missing `$SSO_START_URL`")
207-
val ssoRegion = get(SSO_REGION) ?: return LeafProviderResult.Err("profile ($name) missing `$SSO_REGION`")
208-
val accountId = get(SSO_ACCOUNT_ID) ?: return LeafProviderResult.Err("profile ($name) missing `$SSO_ACCOUNT_ID`")
209-
val roleName = get(SSO_ROLE_NAME) ?: return LeafProviderResult.Err("profile ($name) missing `$SSO_ROLE_NAME`")
204+
val startUrl = getOrNull(SSO_START_URL) ?: return LeafProviderResult.Err("profile ($name) missing `$SSO_START_URL`")
205+
val ssoRegion = getOrNull(SSO_REGION) ?: return LeafProviderResult.Err("profile ($name) missing `$SSO_REGION`")
206+
val accountId = getOrNull(SSO_ACCOUNT_ID) ?: return LeafProviderResult.Err("profile ($name) missing `$SSO_ACCOUNT_ID`")
207+
val roleName = getOrNull(SSO_ROLE_NAME) ?: return LeafProviderResult.Err("profile ($name) missing `$SSO_ROLE_NAME`")
210208

211209
return LeafProviderResult.Ok(LeafProvider.Sso(startUrl, ssoRegion, accountId, roleName))
212210
}
@@ -218,7 +216,7 @@ private fun AwsProfile.ssoCreds(): LeafProviderResult? {
218216
private fun AwsProfile.processCreds(): LeafProviderResult? {
219217
if (!contains(CREDENTIAL_PROCESS)) return null
220218

221-
val credentialProcess = get(CREDENTIAL_PROCESS) ?: return LeafProviderResult.Err("profile ($name) missing `$CREDENTIAL_PROCESS`")
219+
val credentialProcess = getOrNull(CREDENTIAL_PROCESS) ?: return LeafProviderResult.Err("profile ($name) missing `$CREDENTIAL_PROCESS`")
222220

223221
return LeafProviderResult.Ok(LeafProvider.Process(credentialProcess))
224222
}
@@ -228,14 +226,14 @@ private fun AwsProfile.processCreds(): LeafProviderResult? {
228226
* credentials
229227
*/
230228
private fun AwsProfile.staticCreds(): LeafProviderResult {
231-
val accessKeyId = get(AWS_ACCESS_KEY_ID)
232-
val secretKey = get(AWS_SECRET_ACCESS_KEY)
229+
val accessKeyId = getOrNull(AWS_ACCESS_KEY_ID)
230+
val secretKey = getOrNull(AWS_SECRET_ACCESS_KEY)
233231
return when {
234232
accessKeyId == null && secretKey == null -> LeafProviderResult.Err("profile ($name) did not contain credential information")
235233
accessKeyId == null -> LeafProviderResult.Err("profile ($name) missing `aws_access_key_id`")
236234
secretKey == null -> LeafProviderResult.Err("profile ($name) missing `aws_secret_access_key`")
237235
else -> {
238-
val sessionToken = get(AWS_SESSION_TOKEN)
236+
val sessionToken = getOrNull(AWS_SESSION_TOKEN)
239237
val provider = LeafProvider.AccessKey(Credentials(accessKeyId, secretKey, sessionToken))
240238
LeafProviderResult.Ok(provider)
241239
}
@@ -260,8 +258,8 @@ private sealed class NextProfile {
260258
* Get the next profile name in the chain or the current profile if it specifies an explicit credential source
261259
*/
262260
private fun AwsProfile.chainProvider(): NextProfile {
263-
val sourceProfile = get(SOURCE_PROFILE)
264-
val credSource = get(CREDENTIAL_SOURCE)
261+
val sourceProfile = getOrNull(SOURCE_PROFILE)
262+
val credSource = getOrNull(CREDENTIAL_SOURCE)
265263

266264
return when {
267265
sourceProfile != null && credSource != null -> throw ProviderConfigurationException("profile ($name) contained both `source_profile` and `credential_source`. Only one or the other can be defined.")
@@ -281,7 +279,7 @@ private fun AwsProfile.chainProvider(): NextProfile {
281279
*/
282280
private fun AwsProfile.leafProvider(): LeafProvider {
283281
// profile must define either `credential_source` or explicit access keys
284-
val credSource = get(CREDENTIAL_SOURCE)
282+
val credSource = getOrNull(CREDENTIAL_SOURCE)
285283
if (credSource != null) return LeafProvider.NamedSource(credSource)
286284

287285
// we want to stop on errors in earlier providers to get the right exception message, thus we take the first

0 commit comments

Comments
 (0)