21 21 | import aws.sdk.kotlin.services.sts.model.AssumeRoleRequest
|
22 22 | import aws.sdk.kotlin.services.sts.model.AssumeRoleResponse
|
23 23 | import aws.sdk.kotlin.services.sts.model.AssumeRoleWithSamlRequest
|
24 24 | import aws.sdk.kotlin.services.sts.model.AssumeRoleWithSamlResponse
|
25 25 | import aws.sdk.kotlin.services.sts.model.AssumeRoleWithWebIdentityRequest
|
26 26 | import aws.sdk.kotlin.services.sts.model.AssumeRoleWithWebIdentityResponse
|
27 27 | import aws.sdk.kotlin.services.sts.model.AssumeRootRequest
|
28 28 | import aws.sdk.kotlin.services.sts.model.AssumeRootResponse
|
29 29 | import aws.sdk.kotlin.services.sts.model.DecodeAuthorizationMessageRequest
|
30 30 | import aws.sdk.kotlin.services.sts.model.DecodeAuthorizationMessageResponse
|
31 31 | import aws.sdk.kotlin.services.sts.model.GetAccessKeyInfoRequest
|
32 32 | import aws.sdk.kotlin.services.sts.model.GetAccessKeyInfoResponse
|
33 33 | import aws.sdk.kotlin.services.sts.model.GetCallerIdentityRequest
|
34 34 | import aws.sdk.kotlin.services.sts.model.GetCallerIdentityResponse
|
35 35 | import aws.sdk.kotlin.services.sts.model.GetDelegatedAccessTokenRequest
|
36 36 | import aws.sdk.kotlin.services.sts.model.GetDelegatedAccessTokenResponse
|
37 37 | import aws.sdk.kotlin.services.sts.model.GetFederationTokenRequest
|
38 38 | import aws.sdk.kotlin.services.sts.model.GetFederationTokenResponse
|
39 39 | import aws.sdk.kotlin.services.sts.model.GetSessionTokenRequest
|
40 40 | import aws.sdk.kotlin.services.sts.model.GetSessionTokenResponse
|
41 41 | import aws.sdk.kotlin.services.sts.model.GetWebIdentityTokenRequest
|
42 42 | import aws.sdk.kotlin.services.sts.model.GetWebIdentityTokenResponse
|
43 43 | import aws.smithy.kotlin.runtime.auth.AuthSchemeId
|
44 44 | import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
|
45 45 | import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderConfig
|
46 46 | import aws.smithy.kotlin.runtime.auth.awscredentials.SigV4aClientConfig
|
47 47 | import aws.smithy.kotlin.runtime.awsprotocol.ClockSkewInterceptor
|
48 48 | import aws.smithy.kotlin.runtime.client.AbstractSdkClientBuilder
|
49 49 | import aws.smithy.kotlin.runtime.client.AbstractSdkClientFactory
|
50 50 | import aws.smithy.kotlin.runtime.client.LogMode
|
51 + | import aws.smithy.kotlin.runtime.client.LogRedactionConfig
|
51 52 | import aws.smithy.kotlin.runtime.client.RetryClientConfig
|
52 53 | import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfig
|
53 54 | import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfigImpl
|
54 55 | import aws.smithy.kotlin.runtime.client.SdkClient
|
55 56 | import aws.smithy.kotlin.runtime.client.SdkClientConfig
|
56 57 | import aws.smithy.kotlin.runtime.client.region.RegionProvider
|
57 58 | import aws.smithy.kotlin.runtime.http.auth.AuthScheme
|
58 59 | import aws.smithy.kotlin.runtime.http.auth.HttpAuthConfig
|
59 60 | import aws.smithy.kotlin.runtime.http.config.HttpClientConfig
|
60 61 | import aws.smithy.kotlin.runtime.http.config.HttpEngineConfig
|
61 62 | import aws.smithy.kotlin.runtime.http.config.TimeoutConfig
|
62 63 | import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
|
63 64 | import aws.smithy.kotlin.runtime.http.engine.HttpEngineConfigImpl
|
64 65 | import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
|
65 66 | import aws.smithy.kotlin.runtime.net.url.Url
|
66 67 | import aws.smithy.kotlin.runtime.retries.RetryStrategy
|
67 68 | import aws.smithy.kotlin.runtime.retries.policy.RetryPolicy
|
68 69 | import aws.smithy.kotlin.runtime.telemetry.Global
|
69 70 | import aws.smithy.kotlin.runtime.telemetry.TelemetryConfig
|
70 71 | import aws.smithy.kotlin.runtime.telemetry.TelemetryProvider
|
71 72 | import aws.smithy.kotlin.runtime.util.LazyAsyncValue
|
72 73 | import kotlin.collections.List
|
73 74 | import kotlin.collections.Set
|
74 75 | import kotlin.jvm.JvmStatic
|
75 76 | import kotlin.time.Duration
|
76 77 | import kotlinx.coroutines.runBlocking
|
77 78 |
|
78 79 |
|
79 80 | public const val ServiceId: String = "STS"
|
80 81 | public const val SdkVersion: String = "1.6.108-SNAPSHOT"
|
109 110 | "sts",
|
110 111 | )
|
111 112 | }
|
112 113 | }
|
113 114 |
|
114 115 | public class Builder internal constructor(): AbstractSdkClientBuilder<Config, Config.Builder, StsClient>() {
|
115 116 | override val config: Config.Builder = Config.Builder()
|
116 117 | override fun newClient(config: Config): StsClient = DefaultStsClient(config)
|
117 118 | }
|
118 119 |
|
119 - | public class Config private constructor(builder: Builder) : AwsSdkClientConfig, CredentialsProviderConfig, HttpAuthConfig, HttpClientConfig, HttpEngineConfig by builder.buildHttpEngineConfig(), RetryClientConfig, RetryStrategyClientConfig by builder.buildRetryStrategyClientConfig(), SdkClientConfig, SigV4aClientConfig, TelemetryConfig, TimeoutConfig {
|
120 + | public class Config private constructor(builder: Builder) : AwsSdkClientConfig, CredentialsProviderConfig, HttpAuthConfig, HttpClientConfig, HttpEngineConfig by builder.buildHttpEngineConfig(), LogRedactionConfig, RetryClientConfig, RetryStrategyClientConfig by builder.buildRetryStrategyClientConfig(), SdkClientConfig, SigV4aClientConfig, TelemetryConfig, TimeoutConfig {
|
120 121 | override val clientName: String = builder.clientName
|
121 122 | override val region: String? = (builder.region ?: runBlocking { builder.regionProvider?.getRegion() ?: resolveRegion() })?.let { validateRegion(it) }
|
122 123 | override val regionProvider: RegionProvider = builder.regionProvider ?: DefaultRegionProviderChain()
|
123 124 | override val attemptTimeout: Duration? = builder.attemptTimeout
|
124 125 | override val authSchemePreference: kotlin.collections.List<aws.smithy.kotlin.runtime.auth.AuthSchemeId>? = builder.authSchemePreference
|
125 126 | override val authSchemes: kotlin.collections.List<aws.smithy.kotlin.runtime.http.auth.AuthScheme> = builder.authSchemes
|
126 127 | override val callTimeout: Duration? = builder.callTimeout
|
127 128 | override val credentialsProvider: CredentialsProvider = builder.credentialsProvider ?: DefaultChainCredentialsProvider(httpClient = httpClient, region = region).manage()
|
128 129 | public val endpointProvider: StsEndpointProvider = builder.endpointProvider ?: DefaultStsEndpointProvider()
|
129 130 | public val endpointUrl: Url? = builder.endpointUrl
|
130 131 | override val interceptors: kotlin.collections.List<aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor> = builder.interceptors
|
131 132 | override val logMode: LogMode = builder.logMode ?: LogMode.Default
|
133 + | override val logRedactedHeaders: kotlin.collections.Set<kotlin.String> = builder.logRedactedHeaders
|
132 134 | override val retryPolicy: RetryPolicy<Any?> = builder.retryPolicy ?: AwsRetryPolicy.Default
|
133 135 | override val sigV4aSigningRegionSet: kotlin.collections.Set<kotlin.String>? = builder.sigV4aSigningRegionSet
|
134 136 | override val telemetryProvider: TelemetryProvider = builder.telemetryProvider ?: TelemetryProvider.Global
|
135 137 | override val useDualStack: Boolean = builder.useDualStack ?: false
|
136 138 | override val useFips: Boolean = builder.useFips ?: false
|
137 139 | override val applicationId: String? = builder.applicationId
|
138 140 | public val authSchemeProvider: StsAuthSchemeProvider = builder.authSchemeProvider ?: DefaultStsAuthSchemeProvider(authSchemePreference = authSchemePreference)
|
139 141 | public companion object {
|
140 142 | public inline operator fun invoke(block: Builder.() -> kotlin.Unit): Config = Builder().apply(block).build()
|
141 143 | }
|
142 144 |
|
143 145 | public fun toBuilder(): Builder = Builder().apply {
|
144 146 | clientName = this@Config.clientName
|
145 147 | region = this@Config.region
|
146 148 | regionProvider = this@Config.regionProvider
|
147 149 | attemptTimeout = this@Config.attemptTimeout
|
148 150 | authSchemePreference = this@Config.authSchemePreference
|
149 151 | authSchemes = this@Config.authSchemes
|
150 152 | callTimeout = this@Config.callTimeout
|
151 153 | credentialsProvider = this@Config.credentialsProvider
|
152 154 | endpointProvider = this@Config.endpointProvider
|
153 155 | endpointUrl = this@Config.endpointUrl
|
154 156 | httpClient = this@Config.httpClient
|
155 157 | interceptors = this@Config.interceptors.toMutableList()
|
156 158 | logMode = this@Config.logMode
|
159 + | logRedactedHeaders = this@Config.logRedactedHeaders.toMutableSet()
|
157 160 | retryPolicy = this@Config.retryPolicy
|
158 161 | retryStrategy = this@Config.retryStrategy
|
159 162 | sigV4aSigningRegionSet = this@Config.sigV4aSigningRegionSet
|
160 163 | telemetryProvider = this@Config.telemetryProvider
|
161 164 | useDualStack = this@Config.useDualStack
|
162 165 | useFips = this@Config.useFips
|
163 166 | applicationId = this@Config.applicationId
|
164 167 | authSchemeProvider = this@Config.authSchemeProvider
|
165 168 | }
|
166 169 |
|
167 - | public class Builder : AwsSdkClientConfig.Builder, CredentialsProviderConfig.Builder, HttpAuthConfig.Builder, HttpClientConfig.Builder, HttpEngineConfig.Builder by HttpEngineConfigImpl.BuilderImpl(), RetryClientConfig.Builder, RetryStrategyClientConfig.Builder by RetryStrategyClientConfigImpl.BuilderImpl(), SdkClientConfig.Builder<Config>, SigV4aClientConfig.Builder, TelemetryConfig.Builder, TimeoutConfig.Builder {
|
170 + | public class Builder : AwsSdkClientConfig.Builder, CredentialsProviderConfig.Builder, HttpAuthConfig.Builder, HttpClientConfig.Builder, HttpEngineConfig.Builder by HttpEngineConfigImpl.BuilderImpl(), LogRedactionConfig.Builder, RetryClientConfig.Builder, RetryStrategyClientConfig.Builder by RetryStrategyClientConfigImpl.BuilderImpl(), SdkClientConfig.Builder<Config>, SigV4aClientConfig.Builder, TelemetryConfig.Builder, TimeoutConfig.Builder {
|
168 171 | /**
|
169 172 | * A reader-friendly name for the client.
|
170 173 | */
|
171 174 | override var clientName: String = "STS"
|
172 175 |
|
173 176 | /**
|
174 177 | * The AWS region (e.g. `us-west-2`) to make requests to. See about AWS
|
175 178 | * [global infrastructure](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/) for more information.
|
176 179 | * When specified, this static region configuration takes precedence over other region resolution methods.
|
177 180 | *
|
261 264 | * raw requests or responses. Use this setting to opt-in to additional debug logging.
|
262 265 | *
|
263 266 | * This can be used to configure logging of requests, responses, retries, etc of SDK clients.
|
264 267 | *
|
265 268 | * **NOTE**: Logging of raw requests or responses may leak sensitive information! It may also have
|
266 269 | * performance considerations when dumping the request/response body. This is primarily a tool for
|
267 270 | * debug purposes.
|
268 271 | */
|
269 272 | override var logMode: LogMode? = null
|
270 273 |
|
274 + | /**
|
275 + | * Set of HTTP header names whose values will be replaced with "*** Sensitive Data Redacted ***" in
|
276 + | * request/response debug logging. Matching is case-insensitive. Empty by default
|
277 + | * (no headers are redacted). See [PotentiallySensitiveHeaders][aws.smithy.kotlin.runtime.http.PotentiallySensitiveHeaders] for
|
278 + | * a pre-built set of commonly-sensitive headers.
|
279 + | */
|
280 + | override var logRedactedHeaders: kotlin.collections.MutableSet<kotlin.String> = kotlin.collections.mutableSetOf()
|
281 + |
|
271 282 | /**
|
272 283 | * The policy to use for evaluating operation results and determining whether/how to retry.
|
273 284 | */
|
274 285 | override var retryPolicy: RetryPolicy<Any?>? = null
|
275 286 |
|
276 287 | /**
|
277 288 | * The set of regions to use when signing a request with SigV4a. If not provided this will automatically be set by the SDK.
|
278 289 | */
|
279 290 | override var sigV4aSigningRegionSet: kotlin.collections.Set<kotlin.String>? = null
|
280 291 |
|