Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

package aws.sdk.kotlin.runtime.auth.credentials

import aws.sdk.kotlin.crt.auth.credentials.build
import aws.sdk.kotlin.runtime.crt.SdkDefaultIO
import aws.sdk.kotlin.crt.auth.credentials.EcsCredentialsProvider as EcsCredentialsProviderCrt

/**
* A provider that gets credentials from an ECS environment
*
* @param host The host component of the URL to query credentials from
* @param pathAndQuery The path and query components of the URI, concatenated, to query credentials from
* @param authToken The token to pass to ECS credential service
*/
public class EcsCredentialsProvider public constructor(
host: String? = null,
pathAndQuery: String? = null,
authToken: String? = null,
) : CrtCredentialsProvider {
override val crtProvider: EcsCredentialsProviderCrt = EcsCredentialsProviderCrt.build {
clientBootstrap = SdkDefaultIO.ClientBootstrap
tlsContext = SdkDefaultIO.TlsContext
this.host = host
this.pathAndQuery = pathAndQuery
this.authToken = authToken
}
}