Skip to content

Commit 69a3dfd

Browse files
authored
feat(rt): ECS credential provider (#353)
1 parent b442cd6 commit 69a3dfd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
package aws.sdk.kotlin.runtime.auth.credentials
7+
8+
import aws.sdk.kotlin.crt.auth.credentials.build
9+
import aws.sdk.kotlin.runtime.crt.SdkDefaultIO
10+
import aws.sdk.kotlin.crt.auth.credentials.EcsCredentialsProvider as EcsCredentialsProviderCrt
11+
12+
/**
13+
* A provider that gets credentials from an ECS environment
14+
*
15+
* @param host The host component of the URL to query credentials from
16+
* @param pathAndQuery The path and query components of the URI, concatenated, to query credentials from
17+
* @param authToken The token to pass to ECS credential service
18+
*/
19+
public class EcsCredentialsProvider public constructor(
20+
host: String? = null,
21+
pathAndQuery: String? = null,
22+
authToken: String? = null,
23+
) : CrtCredentialsProvider {
24+
override val crtProvider: EcsCredentialsProviderCrt = EcsCredentialsProviderCrt.build {
25+
clientBootstrap = SdkDefaultIO.ClientBootstrap
26+
tlsContext = SdkDefaultIO.TlsContext
27+
this.host = host
28+
this.pathAndQuery = pathAndQuery
29+
this.authToken = authToken
30+
}
31+
}

0 commit comments

Comments
 (0)