Skip to content

Commit 97c0636

Browse files
Merge pull request #2332 from aws/staging/75906e71-438e-4286-88ad-6604908f570d
Pull request: release <- staging/75906e71-438e-4286-88ad-6604908f570d
2 parents fb19712 + 5853b3c commit 97c0636

File tree

413 files changed

+1222
-1183
lines changed

Some content is hidden

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

413 files changed

+1222
-1183
lines changed

.changes/2.19.19.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.19.19",
3+
"date": "2023-01-18",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "AWS WAFV2",
8+
"contributor": "",
9+
"description": "Improved the visibility of the guidance for updating AWS WAF resources, such as web ACLs and rule groups."
10+
},
11+
{
12+
"type": "feature",
13+
"category": "Amazon CloudWatch",
14+
"contributor": "",
15+
"description": "Enable cross-account streams in CloudWatch Metric Streams via Observability Access Manager."
16+
},
17+
{
18+
"type": "feature",
19+
"category": "Amazon Elastic File System",
20+
"contributor": "",
21+
"description": "Documentation updates for EFS access points limit increase"
22+
},
23+
{
24+
"type": "feature",
25+
"category": "Amazon Interactive Video Service Chat",
26+
"contributor": "",
27+
"description": "Updates the range for a Chat Room's maximumMessageRatePerSecond field."
28+
},
29+
{
30+
"type": "feature",
31+
"category": "AWS SDK for Java v2",
32+
"contributor": "",
33+
"description": "Updated endpoint and partition metadata."
34+
}
35+
]
36+
}

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# __2.19.19__ __2023-01-18__
2+
## __AWS SDK for Java v2__
3+
- ### Features
4+
- Updated endpoint and partition metadata.
5+
6+
## __AWS WAFV2__
7+
- ### Features
8+
- Improved the visibility of the guidance for updating AWS WAF resources, such as web ACLs and rule groups.
9+
10+
## __Amazon CloudWatch__
11+
- ### Features
12+
- Enable cross-account streams in CloudWatch Metric Streams via Observability Access Manager.
13+
14+
## __Amazon Elastic File System__
15+
- ### Features
16+
- Documentation updates for EFS access points limit increase
17+
18+
## __Amazon Interactive Video Service Chat__
19+
- ### Features
20+
- Updates the range for a Chat Room's maximumMessageRatePerSecond field.
21+
122
# __2.19.18__ __2023-01-17__
223
## __AWS Cloud9__
324
- ### Features

README.md

+4-4
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.18</version>
55+
<version>2.19.19</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.18</version>
89+
<version>2.19.19</version>
9090
</dependency>
9191
<dependency>
9292
<groupId>software.amazon.awssdk</groupId>
9393
<artifactId>s3</artifactId>
94-
<version>2.19.18</version>
94+
<version>2.19.19</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.18</version>
106+
<version>2.19.19</version>
107107
</dependency>
108108
```
109109

archetypes/archetype-app-quickstart/pom.xml

+1-1
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.18</version>
23+
<version>2.19.19</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

archetypes/archetype-lambda/pom.xml

+1-1
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.18</version>
23+
<version>2.19.19</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetype-lambda</artifactId>

archetypes/archetype-tools/pom.xml

+1-1
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.18</version>
23+
<version>2.19.19</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

archetypes/pom.xml

+1-1
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.18</version>
23+
<version>2.19.19</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetypes</artifactId>

aws-sdk-java/pom.xml

+1-1
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.18</version>
20+
<version>2.19.19</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>aws-sdk-java</artifactId>

bom-internal/pom.xml

+1-1
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.18</version>
23+
<version>2.19.19</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

bom/pom.xml

+1-1
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.18</version>
20+
<version>2.19.19</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>bom</artifactId>

bundle/pom.xml

+1-1
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.18</version>
24+
<version>2.19.19</version>
2525
</parent>
2626
<artifactId>bundle</artifactId>
2727
<packaging>jar</packaging>

codegen-lite-maven-plugin/pom.xml

+1-1
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.18</version>
25+
<version>2.19.19</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite/pom.xml

+1-1
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.18</version>
24+
<version>2.19.19</version>
2525
</parent>
2626
<artifactId>codegen-lite</artifactId>
2727
<name>AWS Java SDK :: Code Generator Lite</name>

codegen-maven-plugin/pom.xml

+1-1
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.18</version>
25+
<version>2.19.19</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-maven-plugin</artifactId>

codegen/pom.xml

+1-1
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.18</version>
24+
<version>2.19.19</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

core/annotations/pom.xml

+1-1
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.18</version>
23+
<version>2.19.19</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/arns/pom.xml

+1-1
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.18</version>
23+
<version>2.19.19</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

core/auth-crt/pom.xml

+1-1
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.18</version>
25+
<version>2.19.19</version>
2626
</parent>
2727

2828
<artifactId>auth-crt</artifactId>

core/auth/pom.xml

+1-1
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.18</version>
25+
<version>2.19.19</version>
2626
</parent>
2727

2828
<artifactId>auth</artifactId>

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

+44-11
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515

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

18-
import static java.util.Collections.unmodifiableSet;
19-
2018
import java.io.IOException;
19+
import java.net.InetAddress;
2120
import java.net.URI;
21+
import java.net.UnknownHostException;
2222
import java.time.Instant;
2323
import java.time.temporal.ChronoUnit;
2424
import java.util.Arrays;
2525
import java.util.HashMap;
26-
import java.util.HashSet;
2726
import java.util.Map;
28-
import java.util.Set;
27+
import java.util.Objects;
28+
import java.util.function.Predicate;
2929
import software.amazon.awssdk.annotations.SdkPublicApi;
3030
import software.amazon.awssdk.auth.credentials.internal.ContainerCredentialsRetryPolicy;
3131
import software.amazon.awssdk.auth.credentials.internal.HttpCredentialsLoader;
@@ -65,7 +65,9 @@
6565
public final class ContainerCredentialsProvider
6666
implements HttpCredentialsProvider,
6767
ToCopyableBuilder<ContainerCredentialsProvider.Builder, ContainerCredentialsProvider> {
68-
private static final Set<String> ALLOWED_HOSTS = unmodifiableSet(new HashSet<>(Arrays.asList("localhost", "127.0.0.1")));
68+
private static final Predicate<InetAddress> IS_LOOPBACK_ADDRESS = InetAddress::isLoopbackAddress;
69+
private static final Predicate<InetAddress> ALLOWED_HOSTS_RULES = IS_LOOPBACK_ADDRESS;
70+
private static final String HTTPS = "https";
6971

7072
private final String endpoint;
7173
private final HttpCredentialsLoader httpCredentialsLoader;
@@ -207,18 +209,49 @@ private URI createUri(String relativeUri) {
207209

208210
private URI createGenericContainerUrl() {
209211
URI uri = URI.create(SdkSystemSetting.AWS_CONTAINER_CREDENTIALS_FULL_URI.getStringValueOrThrow());
210-
if (!ALLOWED_HOSTS.contains(uri.getHost())) {
212+
if (!isHttps(uri) && !isAllowedHost(uri.getHost())) {
211213
String envVarName = SdkSystemSetting.AWS_CONTAINER_CREDENTIALS_FULL_URI.environmentVariable();
212214
throw SdkClientException.builder()
213-
.message(String.format("The full URI (%s) contained within environment " +
214-
"variable %s has an invalid host. Host can only be one of [%s].",
215-
uri,
216-
envVarName,
217-
String.join(",", ALLOWED_HOSTS)))
215+
.message(String.format("The full URI (%s) contained within environment variable " +
216+
"%s has an invalid host. Host should resolve to a loopback " +
217+
"address or have the full URI be HTTPS.",
218+
uri, envVarName))
218219
.build();
219220
}
220221
return uri;
221222
}
223+
224+
private boolean isHttps(URI endpoint) {
225+
return Objects.equals(HTTPS, endpoint.getScheme());
226+
}
227+
228+
/**
229+
* Determines if the addresses for a given host are resolved to a loopback address.
230+
* <p>
231+
* This is a best-effort in determining what address a host will be resolved to. DNS caching might be disabled,
232+
* or could expire between this check and when the API is invoked.
233+
* </p>
234+
* @param host The name or IP address of the host.
235+
* @return A boolean specifying whether the host is allowed as an endpoint for credentials loading.
236+
*/
237+
private boolean isAllowedHost(String host) {
238+
try {
239+
InetAddress[] addresses = InetAddress.getAllByName(host);
240+
241+
return addresses.length > 0 && Arrays.stream(addresses)
242+
.allMatch(this::matchesAllowedHostRules);
243+
244+
} catch (UnknownHostException e) {
245+
throw SdkClientException.builder()
246+
.cause(e)
247+
.message(String.format("host (%s) could not be resolved to an IP address.", host))
248+
.build();
249+
}
250+
}
251+
252+
private boolean matchesAllowedHostRules(InetAddress inetAddress) {
253+
return ALLOWED_HOSTS_RULES.test(inetAddress);
254+
}
222255
}
223256

224257
/**

core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ContainerCredentialsEndpointProviderTest.java

+41-1
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,49 @@ public void theLoopbackAddressIsAlsoAcceptable() throws IOException {
7171
assertThat(sut.endpoint().toString(), equalTo(fullUri));
7272
}
7373

74+
@Test
75+
public void theLoopbackIpv6AddressIsAlsoAcceptable() throws IOException {
76+
String fullUri = "http://[::1]:9851/endpoint";
77+
helper.set(AWS_CONTAINER_CREDENTIALS_FULL_URI.environmentVariable(), fullUri);
78+
79+
assertThat(sut.endpoint().toString(), equalTo(fullUri));
80+
}
81+
82+
@Test
83+
public void anyHttpsAddressIsAlsoAcceptable() throws IOException {
84+
String fullUri = "https://192.168.10.120:9851/endpoint";
85+
helper.set(AWS_CONTAINER_CREDENTIALS_FULL_URI.environmentVariable(), fullUri);
86+
87+
assertThat(sut.endpoint().toString(), equalTo(fullUri));
88+
}
89+
90+
@Test
91+
public void anyHttpsIpv6AddressIsAlsoAcceptable() throws IOException {
92+
String fullUri = "https://[::FFFF:152.16.24.123]/endpoint";
93+
helper.set(AWS_CONTAINER_CREDENTIALS_FULL_URI.environmentVariable(), fullUri);
94+
95+
assertThat(sut.endpoint().toString(), equalTo(fullUri));
96+
}
97+
98+
@Test(expected = SdkClientException.class)
99+
public void nonLoopbackAddressIsNotAcceptable() throws IOException {
100+
String fullUri = "http://192.168.10.120:9851/endpoint";
101+
helper.set(AWS_CONTAINER_CREDENTIALS_FULL_URI.environmentVariable(), fullUri);
102+
103+
assertThat(sut.endpoint().toString(), equalTo(fullUri));
104+
}
105+
106+
@Test(expected = SdkClientException.class)
107+
public void nonLoopbackIpv6AddressIsNotAcceptable() throws IOException {
108+
String fullUri = "http://[::FFFF:152.16.24.123]/endpoint";
109+
helper.set(AWS_CONTAINER_CREDENTIALS_FULL_URI.environmentVariable(), fullUri);
110+
111+
assertThat(sut.endpoint().toString(), equalTo(fullUri));
112+
}
113+
74114
@Test(expected = SdkClientException.class)
75115
public void onlyLocalHostAddressesAreValid() throws IOException {
76-
helper.set(AWS_CONTAINER_CREDENTIALS_FULL_URI.environmentVariable(), "https://google.com/endpoint");
116+
helper.set(AWS_CONTAINER_CREDENTIALS_FULL_URI.environmentVariable(), "http://google.com/endpoint");
77117
sut.endpoint();
78118
}
79119

core/aws-core/pom.xml

+1-1
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.18</version>
25+
<version>2.19.19</version>
2626
</parent>
2727

2828
<artifactId>aws-core</artifactId>

core/endpoints-spi/pom.xml

+1-1
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.18</version>
23+
<version>2.19.19</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

0 commit comments

Comments
 (0)