Skip to content

Commit 249384a

Browse files
committed
Use .map(::AuthSchemeId)
1 parent cd1947b commit 249384a

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,7 @@ public suspend fun resolveAuthSchemePreference(platform: PlatformProvider = Plat
1717
?.split(",")
1818
?.map { it.trim() }
1919
?.filter { it.isNotEmpty() }
20-
?.mapNotNull { AUTH_SCHEME_NAME_MAP[it.lowercase()] }
20+
?.map(::AuthSchemeId)
2121
?.toList()
2222
?: emptyList()
23-
}
24-
25-
/**
26-
* Map of lowercase auth scheme _name_ (not namespace) to auth scheme ID
27-
*/
28-
private val AUTH_SCHEME_NAME_MAP = mapOf<String, AuthSchemeId>(
29-
"sigv4" to AuthSchemeId.AwsSigV4,
30-
"sigv4a" to AuthSchemeId.AwsSigV4Asymmetric,
31-
"httpbearerauth" to AuthSchemeId.HttpBearer,
32-
"noauth" to AuthSchemeId.Anonymous,
33-
"httpbasicauth" to AuthSchemeId.HttpBasic,
34-
"httpdigestauth" to AuthSchemeId.HttpDigest,
35-
"httpapikey" to AuthSchemeId.HttpApiKey,
36-
)
23+
}

0 commit comments

Comments
 (0)