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 + | import aws.smithy.kotlin.runtime.auth.awscredentials.SigV4aClientConfig
|
46 47 | import aws.smithy.kotlin.runtime.awsprotocol.ClockSkewInterceptor
|
47 48 | import aws.smithy.kotlin.runtime.client.AbstractSdkClientBuilder
|
48 49 | import aws.smithy.kotlin.runtime.client.AbstractSdkClientFactory
|
49 50 | import aws.smithy.kotlin.runtime.client.LogMode
|
50 51 | import aws.smithy.kotlin.runtime.client.RetryClientConfig
|
51 52 | import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfig
|
52 53 | import aws.smithy.kotlin.runtime.client.RetryStrategyClientConfigImpl
|
53 54 | import aws.smithy.kotlin.runtime.client.SdkClient
|
54 55 | import aws.smithy.kotlin.runtime.client.SdkClientConfig
|
55 56 | import aws.smithy.kotlin.runtime.client.region.RegionProvider
|
56 57 | import aws.smithy.kotlin.runtime.http.auth.AuthScheme
|
57 58 | import aws.smithy.kotlin.runtime.http.auth.HttpAuthConfig
|
58 59 | import aws.smithy.kotlin.runtime.http.config.HttpClientConfig
|
59 60 | import aws.smithy.kotlin.runtime.http.config.HttpEngineConfig
|
60 61 | import aws.smithy.kotlin.runtime.http.config.TimeoutConfig
|
61 62 | import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
|
62 63 | import aws.smithy.kotlin.runtime.http.engine.HttpEngineConfigImpl
|
63 64 | import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
|
64 65 | import aws.smithy.kotlin.runtime.net.url.Url
|
65 66 | import aws.smithy.kotlin.runtime.retries.RetryStrategy
|
66 67 | import aws.smithy.kotlin.runtime.retries.policy.RetryPolicy
|
67 68 | import aws.smithy.kotlin.runtime.telemetry.Global
|
68 69 | import aws.smithy.kotlin.runtime.telemetry.TelemetryConfig
|
69 70 | import aws.smithy.kotlin.runtime.telemetry.TelemetryProvider
|
70 71 | import aws.smithy.kotlin.runtime.util.LazyAsyncValue
|
71 72 | import kotlin.collections.List
|
73 + | import kotlin.collections.Set
|
72 74 | import kotlin.jvm.JvmStatic
|
73 75 | import kotlin.time.Duration
|
74 76 | import kotlinx.coroutines.runBlocking
|
75 77 |
|
76 78 |
|
77 79 | public const val ServiceId: String = "STS"
|
78 - | public const val SdkVersion: String = "1.6.48-SNAPSHOT"
|
80 + | public const val SdkVersion: String = "1.6.60-SNAPSHOT"
|
79 81 | public const val ServiceApiVersion: String = "2011-06-15"
|
80 82 |
|
81 83 | /**
|
82 84 | * # Security Token Service
|
83 85 | * Security Token Service (STS) enables you to request temporary, limited-privilege credentials for users. This guide provides descriptions of the STS API. For more information about using this service, see [Temporary Security Credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html).
|
84 86 | */
|
85 87 | public interface StsClient : SdkClient {
|
86 88 | /**
|
87 89 | * StsClient's configuration
|
88 90 | */
|
89 91 | public override val config: Config
|
90 92 |
|
91 93 | public companion object : AbstractAwsSdkClientFactory<Config, Config.Builder, StsClient, Builder>()
|
92 94 | {
|
93 95 | @JvmStatic
|
94 96 | override fun builder(): Builder = Builder()
|
95 97 |
|
96 98 | override fun finalizeConfig(builder: Builder) {
|
97 99 | super.finalizeConfig(builder)
|
98 100 | builder.config.interceptors.add(0, ClockSkewInterceptor())
|
99 101 | }
|
100 102 |
|
101 103 | override suspend fun finalizeEnvironmentalConfig(builder: Builder, sharedConfig: LazyAsyncValue<AwsSharedConfig>, activeProfile: LazyAsyncValue<AwsProfile>) {
|
102 104 | super.finalizeEnvironmentalConfig(builder, sharedConfig, activeProfile)
|
103 105 | builder.config.endpointUrl = builder.config.endpointUrl ?: resolveEndpointUrl(
|
104 106 | sharedConfig,
|
105 107 | "Sts",
|
106 108 | "STS",
|
107 109 | "sts",
|
108 110 | )
|
109 111 | }
|
110 112 | }
|
111 113 |
|
112 114 | public class Builder internal constructor(): AbstractSdkClientBuilder<Config, Config.Builder, StsClient>() {
|
113 115 | override val config: Config.Builder = Config.Builder()
|
114 116 | override fun newClient(config: Config): StsClient = DefaultStsClient(config)
|
115 117 | }
|
116 118 |
|
117 - | public class Config private constructor(builder: Builder) : AwsSdkClientConfig, CredentialsProviderConfig, HttpAuthConfig, HttpClientConfig, HttpEngineConfig by builder.buildHttpEngineConfig(), RetryClientConfig, RetryStrategyClientConfig by builder.buildRetryStrategyClientConfig(), SdkClientConfig, TelemetryConfig, TimeoutConfig {
|
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 {
|
118 120 | override val clientName: String = builder.clientName
|
119 121 | override val region: String? = (builder.region ?: runBlocking { builder.regionProvider?.getRegion() ?: resolveRegion() })?.let { validateRegion(it) }
|
120 122 | override val regionProvider: RegionProvider = builder.regionProvider ?: DefaultRegionProviderChain()
|
121 123 | override val attemptTimeout: Duration? = builder.attemptTimeout
|
122 124 | override val authSchemePreference: kotlin.collections.List<aws.smithy.kotlin.runtime.auth.AuthSchemeId>? = builder.authSchemePreference
|
123 125 | override val authSchemes: kotlin.collections.List<aws.smithy.kotlin.runtime.http.auth.AuthScheme> = builder.authSchemes
|
124 126 | override val callTimeout: Duration? = builder.callTimeout
|
125 127 | override val credentialsProvider: CredentialsProvider = builder.credentialsProvider ?: DefaultChainCredentialsProvider(httpClient = httpClient, region = region).manage()
|
126 128 | public val endpointProvider: StsEndpointProvider = builder.endpointProvider ?: DefaultStsEndpointProvider()
|
127 129 | public val endpointUrl: Url? = builder.endpointUrl
|
128 130 | override val interceptors: kotlin.collections.List<aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor> = builder.interceptors
|
129 131 | override val logMode: LogMode = builder.logMode ?: LogMode.Default
|
130 132 | override val retryPolicy: RetryPolicy<Any?> = builder.retryPolicy ?: AwsRetryPolicy.Default
|
133 + | override val sigV4aSigningRegionSet: kotlin.collections.Set<kotlin.String>? = builder.sigV4aSigningRegionSet
|
131 134 | override val telemetryProvider: TelemetryProvider = builder.telemetryProvider ?: TelemetryProvider.Global
|
132 135 | override val useDualStack: Boolean = builder.useDualStack ?: false
|
133 136 | override val useFips: Boolean = builder.useFips ?: false
|
134 137 | override val applicationId: String? = builder.applicationId
|
135 138 | public val authSchemeProvider: StsAuthSchemeProvider = builder.authSchemeProvider ?: DefaultStsAuthSchemeProvider(authSchemePreference = authSchemePreference)
|
136 139 | public companion object {
|
137 140 | public inline operator fun invoke(block: Builder.() -> kotlin.Unit): Config = Builder().apply(block).build()
|
138 141 | }
|
139 142 |
|
140 143 | public fun toBuilder(): Builder = Builder().apply {
|
141 144 | clientName = this@Config.clientName
|
142 145 | region = this@Config.region
|
143 146 | regionProvider = this@Config.regionProvider
|
144 147 | attemptTimeout = this@Config.attemptTimeout
|
145 148 | authSchemePreference = this@Config.authSchemePreference
|
146 149 | authSchemes = this@Config.authSchemes
|
147 150 | callTimeout = this@Config.callTimeout
|
148 151 | credentialsProvider = this@Config.credentialsProvider
|
149 152 | endpointProvider = this@Config.endpointProvider
|
150 153 | endpointUrl = this@Config.endpointUrl
|
151 154 | httpClient = this@Config.httpClient
|
152 155 | interceptors = this@Config.interceptors.toMutableList()
|
153 156 | logMode = this@Config.logMode
|
154 157 | retryPolicy = this@Config.retryPolicy
|
155 158 | retryStrategy = this@Config.retryStrategy
|
159 + | sigV4aSigningRegionSet = this@Config.sigV4aSigningRegionSet
|
156 160 | telemetryProvider = this@Config.telemetryProvider
|
157 161 | useDualStack = this@Config.useDualStack
|
158 162 | useFips = this@Config.useFips
|
159 163 | applicationId = this@Config.applicationId
|
160 164 | authSchemeProvider = this@Config.authSchemeProvider
|
161 165 | }
|
162 166 |
|
163 - | 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>, TelemetryConfig.Builder, TimeoutConfig.Builder {
|
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 {
|
164 168 | /**
|
165 169 | * A reader-friendly name for the client.
|
166 170 | */
|
167 171 | override var clientName: String = "STS"
|
168 172 |
|
169 173 | /**
|
170 174 | * The AWS region (e.g. `us-west-2`) to make requests to. See about AWS
|
171 175 | * [global infrastructure](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/) for more information.
|
172 176 | * When specified, this static region configuration takes precedence over other region resolution methods.
|
173 177 | *
|