Skip to content

Commit 2daae0f

Browse files
Merge pull request #2369 from aws/staging/e36af4f7-601d-4337-8357-91266eece763
Pull request: release <- staging/e36af4f7-601d-4337-8357-91266eece763
2 parents f3eac0e + 8066bb2 commit 2daae0f

File tree

469 files changed

+3598
-1962
lines changed

Some content is hidden

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

469 files changed

+3598
-1962
lines changed

.changes/2.19.33.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "2.19.33",
3+
"date": "2023-02-07",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "AWS SDK for Java v2",
8+
"contributor": "",
9+
"description": "- ProfileCredentialsProvider and ProfileTokenProvider can reload credentials when disk profile changes\n- Updated DefaultCredentialsProvider chain for reloading credentials\n- Service support classes store ProfileFile as a Supplier interface\n- SdkClientOption and SdkExecutionAttributes constants for PROFILE_FILE have been deprecated in favor of PROFILE_FILE_SUPPLIER"
10+
},
11+
{
12+
"type": "feature",
13+
"category": "AWS Transfer Family",
14+
"contributor": "",
15+
"description": "Updated the documentation for the ImportCertificate API call, and added examples."
16+
},
17+
{
18+
"type": "feature",
19+
"category": "AWS SDK for Java v2",
20+
"contributor": "",
21+
"description": "Updated endpoint and partition metadata."
22+
}
23+
]
24+
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# __2.19.33__ __2023-02-07__
2+
## __AWS SDK for Java v2__
3+
- ### Features
4+
- - ProfileCredentialsProvider and ProfileTokenProvider can reload credentials when disk profile changes
5+
- Updated DefaultCredentialsProvider chain for reloading credentials
6+
- Service support classes store ProfileFile as a Supplier interface
7+
- SdkClientOption and SdkExecutionAttributes constants for PROFILE_FILE have been deprecated in favor of PROFILE_FILE_SUPPLIER
8+
- Updated endpoint and partition metadata.
9+
10+
## __AWS Transfer Family__
11+
- ### Features
12+
- Updated the documentation for the ImportCertificate API call, and added examples.
13+
114
# __2.19.32__ __2023-02-06__
215
## __AWS CRT-based S3 Client__
316
- ### Bugfixes

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To automatically manage module versions (currently all modules have the same ver
5252
<dependency>
5353
<groupId>software.amazon.awssdk</groupId>
5454
<artifactId>bom</artifactId>
55-
<version>2.19.32</version>
55+
<version>2.19.33</version>
5656
<type>pom</type>
5757
<scope>import</scope>
5858
</dependency>
@@ -86,12 +86,12 @@ Alternatively you can add dependencies for the specific services you use only:
8686
<dependency>
8787
<groupId>software.amazon.awssdk</groupId>
8888
<artifactId>ec2</artifactId>
89-
<version>2.19.32</version>
89+
<version>2.19.33</version>
9090
</dependency>
9191
<dependency>
9292
<groupId>software.amazon.awssdk</groupId>
9393
<artifactId>s3</artifactId>
94-
<version>2.19.32</version>
94+
<version>2.19.33</version>
9595
</dependency>
9696
```
9797

@@ -103,7 +103,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
103103
<dependency>
104104
<groupId>software.amazon.awssdk</groupId>
105105
<artifactId>aws-sdk-java</artifactId>
106-
<version>2.19.32</version>
106+
<version>2.19.33</version>
107107
</dependency>
108108
```
109109

archetypes/archetype-app-quickstart/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.19.32</version>
23+
<version>2.19.33</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

archetypes/archetype-lambda/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.19.32</version>
23+
<version>2.19.33</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetype-lambda</artifactId>

archetypes/archetype-tools/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.19.32</version>
23+
<version>2.19.33</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

archetypes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.19.32</version>
23+
<version>2.19.33</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetypes</artifactId>

aws-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.19.32</version>
20+
<version>2.19.33</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>aws-sdk-java</artifactId>

bom-internal/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.19.32</version>
23+
<version>2.19.33</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.19.32</version>
20+
<version>2.19.33</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>bom</artifactId>

bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.19.32</version>
24+
<version>2.19.33</version>
2525
</parent>
2626
<artifactId>bundle</artifactId>
2727
<packaging>jar</packaging>

codegen-lite-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.19.32</version>
25+
<version>2.19.33</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.19.32</version>
24+
<version>2.19.33</version>
2525
</parent>
2626
<artifactId>codegen-lite</artifactId>
2727
<name>AWS Java SDK :: Code Generator Lite</name>

codegen-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.19.32</version>
25+
<version>2.19.33</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-maven-plugin</artifactId>

codegen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.19.32</version>
24+
<version>2.19.33</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

codegen/src/main/java/software/amazon/awssdk/codegen/poet/builder/BaseClientBuilderClass.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,13 @@ private MethodSpec finalizeServiceConfigurationMethod() {
362362

363363
private void mergeServiceConfiguration(MethodSpec.Builder builder, String clientConfigClassName) {
364364
ClassName clientConfigClass = ClassName.bestGuess(clientConfigClassName);
365-
builder.addCode("$1T.Builder serviceConfigBuilder = (($1T) config.option($2T.SERVICE_CONFIGURATION)).toBuilder();" +
366-
"serviceConfigBuilder.profileFile(serviceConfigBuilder.profileFile() "
367-
+ "!= null ? serviceConfigBuilder.profileFile() : config.option($2T.PROFILE_FILE));" +
368-
"serviceConfigBuilder.profileName(serviceConfigBuilder.profileName() "
365+
builder.addCode("$1T.Builder serviceConfigBuilder = (($1T) config.option($2T.SERVICE_CONFIGURATION)).toBuilder();"
366+
+ "serviceConfigBuilder.profileFile(serviceConfigBuilder.profileFileSupplier() != null ? "
367+
+ "serviceConfigBuilder.profileFileSupplier() : config.option($2T.PROFILE_FILE_SUPPLIER));"
368+
+ "serviceConfigBuilder.profileName(serviceConfigBuilder.profileName() "
369369
+ "!= null ? serviceConfigBuilder.profileName() : config.option($2T.PROFILE_NAME));",
370370
clientConfigClass, SdkClientOption.class);
371371

372-
373-
374372
if (model.getCustomizationConfig().getServiceConfig().hasDualstackProperty()) {
375373
builder.addCode("if (serviceConfigBuilder.dualstackEnabled() != null) {")
376374
.addCode(" $T.validState(config.option($T.DUALSTACK_ENDPOINT_ENABLED) == null, \"Dualstack has been "

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-client-builder-class.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientCon
6868
interceptors = CollectionUtils.mergeLists(interceptors, config.option(SdkClientOption.EXECUTION_INTERCEPTORS));
6969
ServiceConfiguration.Builder serviceConfigBuilder = ((ServiceConfiguration) config
7070
.option(SdkClientOption.SERVICE_CONFIGURATION)).toBuilder();
71-
serviceConfigBuilder.profileFile(serviceConfigBuilder.profileFile() != null ? serviceConfigBuilder.profileFile() : config
72-
.option(SdkClientOption.PROFILE_FILE));
71+
serviceConfigBuilder.profileFile(serviceConfigBuilder.profileFileSupplier() != null ?
72+
serviceConfigBuilder.profileFileSupplier() :
73+
config.option(SdkClientOption.PROFILE_FILE_SUPPLIER));
7374
serviceConfigBuilder.profileName(serviceConfigBuilder.profileName() != null ? serviceConfigBuilder.profileName() : config
7475
.option(SdkClientOption.PROFILE_NAME));
7576
if (serviceConfigBuilder.dualstackEnabled() != null) {

core/annotations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>core</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.19.32</version>
23+
<version>2.19.33</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/arns/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>core</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.19.32</version>
23+
<version>2.19.33</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/auth-crt/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>core</artifactId>
25-
<version>2.19.32</version>
25+
<version>2.19.33</version>
2626
</parent>
2727

2828
<artifactId>auth-crt</artifactId>

core/auth/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>core</artifactId>
25-
<version>2.19.32</version>
25+
<version>2.19.33</version>
2626
</parent>
2727

2828
<artifactId>auth</artifactId>
@@ -152,6 +152,12 @@
152152
<artifactId>commons-lang3</artifactId>
153153
<scope>test</scope>
154154
</dependency>
155+
<dependency>
156+
<groupId>com.google.jimfs</groupId>
157+
<artifactId>jimfs</artifactId>
158+
<version>${jimfs.version}</version>
159+
<scope>test</scope>
160+
</dependency>
155161
</dependencies>
156162
<build>
157163
<plugins>

core/auth/src/main/java/software/amazon/awssdk/auth/credentials/AwsCredentialsProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
public interface AwsCredentialsProvider {
3131
/**
3232
* Returns {@link AwsCredentials} that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider
33-
* can chose its own strategy for loading credentials. For example, an implementation might load credentials from an existing
33+
* can choose its own strategy for loading credentials. For example, an implementation might load credentials from an existing
3434
* key management system, or load new credentials when credentials are rotated.
3535
*
3636
* <p>If an error occurs during the loading of credentials or credentials could not be found, a runtime exception will be

core/auth/src/main/java/software/amazon/awssdk/auth/credentials/DefaultCredentialsProvider.java

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515

1616
package software.amazon.awssdk.auth.credentials;
1717

18+
import java.util.Optional;
19+
import java.util.function.Supplier;
1820
import software.amazon.awssdk.annotations.SdkPublicApi;
1921
import software.amazon.awssdk.auth.credentials.internal.LazyAwsCredentialsProvider;
2022
import software.amazon.awssdk.profiles.ProfileFile;
23+
import software.amazon.awssdk.profiles.ProfileFileSupplier;
2124
import software.amazon.awssdk.utils.SdkAutoCloseable;
2225
import software.amazon.awssdk.utils.ToString;
2326
import software.amazon.awssdk.utils.builder.CopyableBuilder;
@@ -26,8 +29,8 @@
2629
/**
2730
* AWS credentials provider chain that looks for credentials in this order:
2831
* <ol>
29-
* <li>Java System Properties - <code>aws.accessKeyId</code> and <code>aws.secretAccessKey</code></li>
30-
* <li>Environment Variables - <code>AWS_ACCESS_KEY_ID</code> and <code>AWS_SECRET_ACCESS_KEY</code></li>
32+
* <li>Java System Properties - {@code aws.accessKeyId} and {@code aws.secretAccessKey}</li>
33+
* <li>Environment Variables - {@code AWS_ACCESS_KEY_ID} and {@code AWS_SECRET_ACCESS_KEY}</li>
3134
* <li>Web Identity Token credentials from system properties or environment variables</li>
3235
* <li>Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI</li>
3336
* <li>Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" environment
@@ -51,7 +54,7 @@ public final class DefaultCredentialsProvider
5154

5255
private final LazyAwsCredentialsProvider providerChain;
5356

54-
private final ProfileFile profileFile;
57+
private final Supplier<ProfileFile> profileFile;
5558

5659
private final String profileName;
5760

@@ -87,21 +90,21 @@ private static LazyAwsCredentialsProvider createChain(Builder builder) {
8790

8891
return LazyAwsCredentialsProvider.create(() -> {
8992
AwsCredentialsProvider[] credentialsProviders = new AwsCredentialsProvider[] {
90-
SystemPropertyCredentialsProvider.create(),
91-
EnvironmentVariableCredentialsProvider.create(),
92-
WebIdentityTokenFileCredentialsProvider.create(),
93-
ProfileCredentialsProvider.builder()
94-
.profileFile(builder.profileFile)
95-
.profileName(builder.profileName)
96-
.build(),
97-
ContainerCredentialsProvider.builder()
98-
.asyncCredentialUpdateEnabled(asyncCredentialUpdateEnabled)
99-
.build(),
100-
InstanceProfileCredentialsProvider.builder()
101-
.asyncCredentialUpdateEnabled(asyncCredentialUpdateEnabled)
102-
.profileFile(builder.profileFile)
103-
.profileName(builder.profileName)
104-
.build()
93+
SystemPropertyCredentialsProvider.create(),
94+
EnvironmentVariableCredentialsProvider.create(),
95+
WebIdentityTokenFileCredentialsProvider.create(),
96+
ProfileCredentialsProvider.builder()
97+
.profileFile(builder.profileFile)
98+
.profileName(builder.profileName)
99+
.build(),
100+
ContainerCredentialsProvider.builder()
101+
.asyncCredentialUpdateEnabled(asyncCredentialUpdateEnabled)
102+
.build(),
103+
InstanceProfileCredentialsProvider.builder()
104+
.asyncCredentialUpdateEnabled(asyncCredentialUpdateEnabled)
105+
.profileFile(builder.profileFile)
106+
.profileName(builder.profileName)
107+
.build()
105108
};
106109

107110
return AwsCredentialsProviderChain.builder()
@@ -144,7 +147,7 @@ public Builder toBuilder() {
144147
* Configuration that defines the {@link DefaultCredentialsProvider}'s behavior.
145148
*/
146149
public static final class Builder implements CopyableBuilder<Builder, DefaultCredentialsProvider> {
147-
private ProfileFile profileFile;
150+
private Supplier<ProfileFile> profileFile;
148151
private String profileName;
149152
private Boolean reuseLastProviderEnabled = true;
150153
private Boolean asyncCredentialUpdateEnabled = false;
@@ -163,7 +166,13 @@ private Builder(DefaultCredentialsProvider credentialsProvider) {
163166
}
164167

165168
public Builder profileFile(ProfileFile profileFile) {
166-
this.profileFile = profileFile;
169+
return profileFile(Optional.ofNullable(profileFile)
170+
.map(ProfileFileSupplier::fixedProfileFile)
171+
.orElse(null));
172+
}
173+
174+
public Builder profileFile(Supplier<ProfileFile> profileFileSupplier) {
175+
this.profileFile = profileFileSupplier;
167176
return this;
168177
}
169178

@@ -198,6 +207,7 @@ public Builder asyncCredentialUpdateEnabled(Boolean asyncCredentialUpdateEnabled
198207
/**
199208
* Create a {@link DefaultCredentialsProvider} using the configuration defined in this builder.
200209
*/
210+
@Override
201211
public DefaultCredentialsProvider build() {
202212
return new DefaultCredentialsProvider(this);
203213
}

0 commit comments

Comments
 (0)