Skip to content

Commit 701faca

Browse files
authored
misc: merge v1.4 into main (#1500)
1 parent b1f8711 commit 701faca

File tree

105 files changed

+2725
-853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+2725
-853
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "0833e425-f3e6-4bea-a4ce-c2b73f7f39b6",
3+
"type": "misc",
4+
"description": "⚠️ **IMPORTANT**: Upgrade to Kotlin 2.1.0",
5+
"requiresMinorVersionBump": true
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "0b5b53ab-70c0-4c1b-a445-8663ae86d6d1",
3+
"type": "misc",
4+
"description": "The order of credentials resolution in config files has been updated to: static credentials, assume role with source profile OR assume role with named provider, web identity token, SSO session, legacy SSO, process",
5+
"requiresMinorVersionBump": true
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "3339e5cc-978c-4941-a975-6c0c82d6426f",
3+
"type": "feature",
4+
"description": "⚠\uFE0F **IMPORTANT**: S3 client behavior is updated to always calculate a checksum by default for operations that support it (such as PutObject or UploadPart), or require it (such as DeleteObjects). The checksum algorithm used by default varies by SDK (CRC32 or CRC64, CRC32 for the Kotlin SDK). Checksum calculation behavior can be configured using `when_supported` and `when_required` options - in code using requestChecksumCalculation, in shared config using request_checksum_calculation, or as env variable using AWS_REQUEST_CHECKSUM_CALCULATION. The S3 client attempts to validate response checksums for all S3 API operations that support checksums. However, if the SDK has not implemented the specified checksum algorithm then this validation is skipped. Checksum validation behavior can be configured using `when_supported` and `when_required` options - in code using responseChecksumValidation, in shared config using response_checksum_validation, or as env variable using AWS_RESPONSE_CHECKSUM_VALIDATION.",
5+
"requiresMinorVersionBump": true
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "99a099e1-26c1-4ba1-b0d3-435609ea4e94",
3+
"type": "misc",
4+
"description": "The order of credentials resolution in the credentials provider chain has been updated to: system properties, environment variables, web identity tokens, profile, ECS, EC2",
5+
"requiresMinorVersionBump": true
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "ab40d3c7-4701-47ee-87f5-985d68db8b7f",
3+
"type": "bugfix",
4+
"description": "Include more information when retry strategy halts early due to token bucket capacity errors",
5+
"issues": [
6+
"awslabs/aws-sdk-kotlin#1321"
7+
]
8+
}

.github/workflows/continuous-integration.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ jobs:
4040
pwd
4141
ls -lsa
4242
./gradlew -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace
43+
- name: Save Test Reports
44+
if: failure()
45+
uses: actions/upload-artifact@v3
46+
with:
47+
name: test-reports
48+
path: '**/build/reports'
4349

4450
all-platforms:
4551
runs-on: ${{ matrix.os }}

aws-runtime/aws-config/api/aws-config.api

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/DefaultChainCredentia
5151
public final fun getProfileName ()Ljava/lang/String;
5252
public final fun getRegion ()Ljava/lang/String;
5353
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
54+
public fun toString ()Ljava/lang/String;
5455
}
5556

5657
public final class aws/sdk/kotlin/runtime/auth/credentials/EcsCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
@@ -62,6 +63,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/EcsCredentialsProvide
6263
public fun close ()V
6364
public final fun getPlatformProvider ()Laws/smithy/kotlin/runtime/util/PlatformProvider;
6465
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
66+
public fun toString ()Ljava/lang/String;
6567
}
6668

6769
public final class aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider {
@@ -70,6 +72,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredential
7072
public synthetic fun <init> (Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
7173
public final fun getGetEnv ()Lkotlin/jvm/functions/Function1;
7274
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
75+
public fun toString ()Ljava/lang/String;
7376
}
7477

7578
public final class aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
@@ -81,6 +84,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/ImdsCredentialsProvid
8184
public final fun getPlatformProvider ()Laws/smithy/kotlin/runtime/util/PlatformEnvironProvider;
8285
public final fun getProfileOverride ()Ljava/lang/String;
8386
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
87+
public fun toString ()Ljava/lang/String;
8488
}
8589

8690
public final class aws/sdk/kotlin/runtime/auth/credentials/InvalidJsonCredentialsException : aws/sdk/kotlin/runtime/ClientException {
@@ -97,6 +101,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/ProcessCredentialsPro
97101
public fun <init> (Ljava/lang/String;Laws/smithy/kotlin/runtime/util/PlatformProvider;JJ)V
98102
public synthetic fun <init> (Ljava/lang/String;Laws/smithy/kotlin/runtime/util/PlatformProvider;JJILkotlin/jvm/internal/DefaultConstructorMarker;)V
99103
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
104+
public fun toString ()Ljava/lang/String;
100105
}
101106

102107
public final class aws/sdk/kotlin/runtime/auth/credentials/ProfileCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
@@ -112,6 +117,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/ProfileCredentialsPro
112117
public final fun getProfileName ()Ljava/lang/String;
113118
public final fun getRegion ()Ljava/lang/String;
114119
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
120+
public fun toString ()Ljava/lang/String;
115121
}
116122

117123
public final class aws/sdk/kotlin/runtime/auth/credentials/ProviderConfigurationException : aws/sdk/kotlin/runtime/ConfigurationException {
@@ -130,6 +136,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/SsoCredentialsProvide
130136
public final fun getSsoSessionName ()Ljava/lang/String;
131137
public final fun getStartUrl ()Ljava/lang/String;
132138
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
139+
public fun toString ()Ljava/lang/String;
133140
}
134141

135142
public final class aws/sdk/kotlin/runtime/auth/credentials/SsoTokenProvider : aws/smithy/kotlin/runtime/http/auth/BearerTokenProvider {
@@ -150,6 +157,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/StaticCredentialsProv
150157
public fun <init> (Laws/smithy/kotlin/runtime/auth/awscredentials/Credentials;)V
151158
public final fun getCredentials ()Laws/smithy/kotlin/runtime/auth/awscredentials/Credentials;
152159
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
160+
public fun toString ()Ljava/lang/String;
153161
}
154162

155163
public final class aws/sdk/kotlin/runtime/auth/credentials/StaticCredentialsProvider$Builder {
@@ -179,6 +187,7 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/StsAssumeRoleCredenti
179187
public final fun getHttpClient ()Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;
180188
public final fun getRegion ()Ljava/lang/String;
181189
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
190+
public fun toString ()Ljava/lang/String;
182191
}
183192

184193
public final class aws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider {
@@ -192,19 +201,32 @@ public final class aws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredent
192201
public final fun getRegion ()Ljava/lang/String;
193202
public final fun getWebIdentityParameters ()Laws/sdk/kotlin/runtime/auth/credentials/AssumeRoleWithWebIdentityParameters;
194203
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
204+
public fun toString ()Ljava/lang/String;
195205
}
196206

197207
public final class aws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider$Companion {
198208
public final fun fromEnvironment-TUY-ock (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JLaws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;)Laws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider;
199209
public static synthetic fun fromEnvironment-TUY-ock$default (Laws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JLaws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;ILjava/lang/Object;)Laws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityCredentialsProvider;
200210
}
201211

212+
public final class aws/sdk/kotlin/runtime/auth/credentials/StsWebIdentityProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CloseableCredentialsProvider {
213+
public fun <init> ()V
214+
public fun <init> (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;Ljava/lang/String;)V
215+
public synthetic fun <init> (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
216+
public fun close ()V
217+
public final fun getHttpClient ()Laws/smithy/kotlin/runtime/http/engine/HttpClientEngine;
218+
public final fun getPlatformProvider ()Laws/smithy/kotlin/runtime/util/PlatformProvider;
219+
public final fun getRegion ()Ljava/lang/String;
220+
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
221+
}
222+
202223
public final class aws/sdk/kotlin/runtime/auth/credentials/SystemPropertyCredentialsProvider : aws/smithy/kotlin/runtime/auth/awscredentials/CredentialsProvider {
203224
public fun <init> ()V
204225
public fun <init> (Lkotlin/jvm/functions/Function1;)V
205226
public synthetic fun <init> (Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
206227
public final fun getGetProperty ()Lkotlin/jvm/functions/Function1;
207228
public fun resolve (Laws/smithy/kotlin/runtime/collections/Attributes;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
229+
public fun toString ()Ljava/lang/String;
208230
}
209231

210232
public final class aws/sdk/kotlin/runtime/auth/credentials/internal/ManagedBearerTokenProviderKt {
@@ -243,7 +265,9 @@ public final class aws/sdk/kotlin/runtime/config/AwsSdkSetting {
243265
public final fun getAwsMaxAttempts ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
244266
public final fun getAwsProfile ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
245267
public final fun getAwsRegion ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
268+
public final fun getAwsRequestChecksumCalculation ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
246269
public final fun getAwsRequestMinCompressionSizeBytes ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
270+
public final fun getAwsResponseChecksumValidation ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
247271
public final fun getAwsRetryMode ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
248272
public final fun getAwsRoleArn ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
249273
public final fun getAwsRoleSessionName ()Laws/smithy/kotlin/runtime/config/EnvironmentSetting;
@@ -260,6 +284,13 @@ public final class aws/sdk/kotlin/runtime/config/AwsSdkSettingKt {
260284
public static final fun resolveEndpointUrl (Laws/sdk/kotlin/runtime/config/AwsSdkSetting;Laws/smithy/kotlin/runtime/util/PlatformProvider;Ljava/lang/String;Ljava/lang/String;)Laws/smithy/kotlin/runtime/net/url/Url;
261285
}
262286

287+
public final class aws/sdk/kotlin/runtime/config/checksums/ResolveFlexibleChecksumsConfigKt {
288+
public static final fun resolveRequestChecksumCalculation (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
289+
public static synthetic fun resolveRequestChecksumCalculation$default (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
290+
public static final fun resolveResponseChecksumValidation (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
291+
public static synthetic fun resolveResponseChecksumValidation$default (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
292+
}
293+
263294
public final class aws/sdk/kotlin/runtime/config/compression/RequestCompressionResolversKt {
264295
public static final fun resolveDisableRequestCompression (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
265296
public static synthetic fun resolveDisableRequestCompression$default (Laws/smithy/kotlin/runtime/util/PlatformProvider;Laws/smithy/kotlin/runtime/util/LazyAsyncValue;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
@@ -467,7 +498,9 @@ public final class aws/sdk/kotlin/runtime/config/profile/AwsProfileKt {
467498
public static synthetic fun getLongOrNull$default (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/Long;
468499
public static final fun getMaxAttempts (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Integer;
469500
public static final fun getRegion (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/String;
501+
public static final fun getRequestChecksumCalculation (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Laws/smithy/kotlin/runtime/client/config/RequestHttpChecksumConfig;
470502
public static final fun getRequestMinCompressionSizeBytes (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/Long;
503+
public static final fun getResponseChecksumValidation (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Laws/smithy/kotlin/runtime/client/config/ResponseHttpChecksumConfig;
471504
public static final fun getRetryMode (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Laws/smithy/kotlin/runtime/client/config/RetryMode;
472505
public static final fun getRoleArn (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/String;
473506
public static final fun getSdkUserAgentAppId (Laws/sdk/kotlin/runtime/config/profile/ConfigSection;)Ljava/lang/String;

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/DefaultChainCredentialsProvider.kt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ package aws.sdk.kotlin.runtime.auth.credentials
77

88
import aws.sdk.kotlin.runtime.config.AwsSdkSetting
99
import aws.sdk.kotlin.runtime.config.imds.ImdsClient
10-
import aws.smithy.kotlin.runtime.auth.awscredentials.CachedCredentialsProvider
11-
import aws.smithy.kotlin.runtime.auth.awscredentials.CloseableCredentialsProvider
12-
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
13-
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderChain
10+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
11+
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.withBusinessMetric
12+
import aws.smithy.kotlin.runtime.auth.awscredentials.*
1413
import aws.smithy.kotlin.runtime.collections.Attributes
1514
import aws.smithy.kotlin.runtime.http.engine.DefaultHttpEngine
1615
import aws.smithy.kotlin.runtime.http.engine.HttpClientEngine
@@ -23,11 +22,12 @@ import aws.smithy.kotlin.runtime.util.PlatformProvider
2322
*
2423
* Resolution order:
2524
*
26-
* 1. Environment variables ([EnvironmentCredentialsProvider])
27-
* 2. Profile ([ProfileCredentialsProvider])
25+
* 1. System properties ([SystemPropertyCredentialsProvider])
26+
* 2. Environment variables ([EnvironmentCredentialsProvider])
2827
* 3. Web Identity Tokens ([StsWebIdentityCredentialsProvider]]
29-
* 4. ECS (IAM roles for tasks) ([EcsCredentialsProvider])
30-
* 5. EC2 Instance Metadata (IMDSv2) ([ImdsCredentialsProvider])
28+
* 4. Profile ([ProfileCredentialsProvider])
29+
* 5. ECS (IAM roles for tasks) ([EcsCredentialsProvider])
30+
* 6. EC2 Instance Metadata (IMDSv2) ([ImdsCredentialsProvider])
3131
*
3232
* The chain is decorated with a [CachedCredentialsProvider].
3333
*
@@ -54,9 +54,9 @@ public class DefaultChainCredentialsProvider constructor(
5454
private val chain = CredentialsProviderChain(
5555
SystemPropertyCredentialsProvider(platformProvider::getProperty),
5656
EnvironmentCredentialsProvider(platformProvider::getenv),
57-
ProfileCredentialsProvider(profileName = profileName, platformProvider = platformProvider, httpClient = engine, region = region),
5857
// STS web identity provider can be constructed from either the profile OR 100% from the environment
5958
StsWebIdentityProvider(platformProvider = platformProvider, httpClient = engine, region = region),
59+
ProfileCredentialsProvider(profileName = profileName, platformProvider = platformProvider, httpClient = engine, region = region),
6060
EcsCredentialsProvider(platformProvider, engine),
6161
ImdsCredentialsProvider(
6262
client = lazy {
@@ -79,20 +79,22 @@ public class DefaultChainCredentialsProvider constructor(
7979
engine.closeIfCloseable()
8080
}
8181
}
82+
83+
override fun toString(): String = this.simpleClassName + ": " + this.chain
8284
}
8385

8486
/**
8587
* Wrapper around [StsWebIdentityCredentialsProvider] that delays any exceptions until [resolve] is invoked.
8688
* This allows it to be part of the default chain and any failures result in the chain to move onto the next provider.
8789
*/
88-
private class StsWebIdentityProvider(
89-
val platformProvider: PlatformProvider = PlatformProvider.System,
90-
val httpClient: HttpClientEngine? = null,
91-
val region: String? = null,
90+
public class StsWebIdentityProvider(
91+
public val platformProvider: PlatformProvider = PlatformProvider.System,
92+
public val httpClient: HttpClientEngine? = null,
93+
public val region: String? = null,
9294
) : CloseableCredentialsProvider {
9395
override suspend fun resolve(attributes: Attributes): Credentials {
9496
val wrapped = StsWebIdentityCredentialsProvider.fromEnvironment(platformProvider = platformProvider, httpClient = httpClient, region = region)
95-
return wrapped.resolve(attributes)
97+
return wrapped.resolve(attributes).withBusinessMetric(AwsBusinessMetric.Credentials.CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN)
9698
}
9799

98100
override fun close() { }

0 commit comments

Comments
 (0)