Skip to content

Commit 3853646

Browse files
committed
add comment
1 parent fb61495 commit 3853646

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/EnvironmentBearerTokenCustomization.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,13 @@ class EnvironmentBearerTokenCustomization : KotlinIntegration {
8080
serviceSymbol,
8181
RuntimeTypes.Core.Utils.PlatformProvider,
8282
) {
83+
// The customization do nothing if environment variable is not set
8384
write("if (provider.getenv(#S) == null) { return }", envVarName)
8485

86+
// Configure auth scheme preference if customer hasn't specify one
8587
write("builder.config.authSchemePreference = builder.config.authSchemePreference ?: listOf(#T.HttpBearer)", authSchemeId)
8688

89+
// Promote HttpBearer to first position in auth scheme preference list
8790
withBlock("val filteredSchemes = builder.config.authSchemePreference?.filterNot {", "} ?: emptyList()") {
8891
write("it == #T.HttpBearer", authSchemeId)
8992
}

0 commit comments

Comments
 (0)