Skip to content

Commit 3124d1a

Browse files
committed
Merge remote-tracking branch 'origin/smithy-rs-release-1.x.y' into merge-smithy-rs-release-1.x.y-to-main
2 parents 9587dbc + cd6baa9 commit 3124d1a

File tree

27 files changed

+303
-278
lines changed

27 files changed

+303
-278
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<!-- Do not manually edit this file. Use the `changelogger` tool. -->
2+
December 1st, 2023
3+
==================
4+
**New this release:**
5+
- (client, [smithy-rs#3278](https://github.com/smithy-lang/smithy-rs/issues/3278)) `RuntimeComponentsBuilder::push_identity_resolver` is now deprecated since it does not replace the existing identity resolver of a given auth scheme ID. Use `RuntimeComponentsBuilder::set_identity_resolver` instead.
6+
7+
28
November 27th, 2023
39
===================
410
**New this release:**

aws/SDK_CHANGELOG.next.json

Lines changed: 28 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -6,159 +6,90 @@
66
"smithy-rs": [],
77
"aws-sdk-rust": [
88
{
9-
"message": "Add configurable stalled-stream protection for downloads.\n\nWhen making HTTP calls,\nit's possible for a connection to 'stall out' and emit no more data due to server-side issues.\nIn the event this happens, it's desirable for the stream to error out as quickly as possible.\nWhile timeouts can protect you from this issue, they aren't adaptive to the amount of data\nbeing sent and so must be configured specifically for each use case. When enabled, stalled-stream\nprotection will ensure that bad streams error out quickly, regardless of the amount of data being\ndownloaded.\n\nProtection is enabled by default for all clients but can be configured or disabled.\nSee [this discussion](https://github.com/awslabs/aws-sdk-rust/discussions/956) for more details.\n",
10-
"meta": {
11-
"bug": false,
12-
"breaking": true,
13-
"tada": true
14-
},
15-
"author": "Velfi",
16-
"references": [
17-
"smithy-rs#3202"
18-
],
19-
"since-commit": "f66f9246bccc376462ef47aec5707569fca214f5",
20-
"age": 5
21-
},
22-
{
23-
"message": "Make certain types for EMR Serverless optional. Previously, they defaulted to 0, but this created invalid requests.",
9+
"message": "Make properties of S3Control PublicAccessBlockConfiguration optional. Previously, they defaulted to false, but this created invalid requests.",
2410
"meta": {
2511
"bug": true,
2612
"breaking": true,
2713
"tada": false
2814
},
2915
"author": "milesziemer",
3016
"references": [
31-
"smithy-rs#3217"
17+
"smithy-rs#3246"
3218
],
33-
"since-commit": "f66f9246bccc376462ef47aec5707569fca214f5",
19+
"since-commit": "e155c3048b9989fe406ef575d461ea01dfaf294c",
3420
"age": 5
3521
},
3622
{
37-
"message": "Prevent multiplication overflow in backoff computation",
23+
"message": "Allow `--` to be used in bucket names for S3",
3824
"meta": {
3925
"bug": true,
4026
"breaking": false,
4127
"tada": false
4228
},
4329
"author": "rcoh",
4430
"references": [
45-
"smithy-rs#3229",
46-
"aws-sdk-rust#960"
47-
],
48-
"since-commit": "f66f9246bccc376462ef47aec5707569fca214f5",
49-
"age": 5
50-
},
51-
{
52-
"message": "Make some types for various services optional. Previously, they defaulted to 0, but this created invalid requests.",
53-
"meta": {
54-
"bug": true,
55-
"breaking": true,
56-
"tada": false
57-
},
58-
"author": "milesziemer",
59-
"references": [
60-
"smithy-rs#3228"
61-
],
62-
"since-commit": "f66f9246bccc376462ef47aec5707569fca214f5",
63-
"age": 5
64-
},
65-
{
66-
"message": "Types/functions that were deprecated in previous releases were removed. Unfortunately, some of these deprecations\nwere ignored by the Rust compiler (we found out later that `#[deprecated]` on `pub use` doesn't work). See\nthe [deprecations removal list](https://github.com/smithy-lang/smithy-rs/discussions/3223) for more details.\n",
67-
"meta": {
68-
"bug": false,
69-
"breaking": true,
70-
"tada": false
71-
},
72-
"author": "jdisanti",
73-
"references": [
74-
"smithy-rs#3222"
75-
],
76-
"since-commit": "f66f9246bccc376462ef47aec5707569fca214f5",
77-
"age": 5
78-
},
79-
{
80-
"message": "Add `Display` impl for `DateTime`.",
81-
"meta": {
82-
"bug": false,
83-
"breaking": false,
84-
"tada": true
85-
},
86-
"author": "HakanVardarr",
87-
"references": [
88-
"smithy-rs#3183"
31+
"smithy-rs#3253"
8932
],
90-
"since-commit": "f66f9246bccc376462ef47aec5707569fca214f5",
91-
"age": 5
33+
"since-commit": "48e3c95a3f10eebd5a637f8e7670c4232cdabbe4",
34+
"age": 4
9235
},
9336
{
94-
"message": "Types/functions that were previously `#[doc(hidden)]` in `aws-config`, `aws-inlineable`, `aws-types`, and the SDK crates are now visible. For those that are not intended to be used directly, they are called out in their docs as such.",
37+
"message": "Retry additional classes of H2 errors (H2 GoAway & H2 ResetStream)",
9538
"meta": {
9639
"bug": false,
9740
"breaking": false,
9841
"tada": false
9942
},
100-
"author": "ysaito1001",
43+
"author": "rcoh",
10144
"references": [
102-
"smithy-rs#3226"
45+
"aws-sdk-rust#738",
46+
"aws-sdk-rust#858"
10347
],
104-
"since-commit": "f66f9246bccc376462ef47aec5707569fca214f5",
105-
"age": 5
48+
"since-commit": "88970ba88ef45266aade152c7c1da8e90b24c0d7",
49+
"age": 2
10650
},
10751
{
108-
"message": "Make properties of S3Control PublicAccessBlockConfiguration optional. Previously, they defaulted to false, but this created invalid requests.",
52+
"message": "Make some properties for IoT types optional. Previously, they defaulted to false, but that isn't how the service actual works.",
10953
"meta": {
11054
"bug": true,
11155
"breaking": true,
11256
"tada": false
11357
},
11458
"author": "milesziemer",
11559
"references": [
116-
"smithy-rs#3246"
60+
"smithy-rs#3256"
11761
],
118-
"since-commit": "e155c3048b9989fe406ef575d461ea01dfaf294c",
119-
"age": 4
62+
"since-commit": "88970ba88ef45266aade152c7c1da8e90b24c0d7",
63+
"age": 2
12064
},
12165
{
122-
"message": "Allow `--` to be used in bucket names for S3",
66+
"message": "Fix `config::Builder::set_credentials_provider` to override a credentials provider previously set.",
12367
"meta": {
12468
"bug": true,
12569
"breaking": false,
12670
"tada": false
12771
},
128-
"author": "rcoh",
72+
"author": "ysaito1001",
12973
"references": [
130-
"smithy-rs#3253"
74+
"aws-sdk-rust#973",
75+
"smithy-rs#3278"
13176
],
132-
"since-commit": "48e3c95a3f10eebd5a637f8e7670c4232cdabbe4",
133-
"age": 3
77+
"since-commit": "529b3f03e2b945ea2e5e879183ccfd8e74b7377c",
78+
"age": 1
13479
},
13580
{
136-
"message": "Retry additional classes of H2 errors (H2 GoAway & H2 ResetStream)",
81+
"message": "`config::Config::credentials_provider` has been broken since `release-2023-11-15` and is now marked as `deprecated` explicitly.",
13782
"meta": {
13883
"bug": false,
13984
"breaking": false,
14085
"tada": false
14186
},
142-
"author": "rcoh",
143-
"references": [
144-
"aws-sdk-rust#738",
145-
"aws-sdk-rust#858"
146-
],
147-
"since-commit": "88970ba88ef45266aade152c7c1da8e90b24c0d7",
148-
"age": 1
149-
},
150-
{
151-
"message": "Make some properties for IoT types optional. Previously, they defaulted to false, but that isn't how the service actual works.",
152-
"meta": {
153-
"bug": true,
154-
"breaking": true,
155-
"tada": false
156-
},
157-
"author": "milesziemer",
87+
"author": "ysaito1001",
15888
"references": [
159-
"smithy-rs#3256"
89+
"smithy-rs#3251",
90+
"smithy-rs#3278"
16091
],
161-
"since-commit": "88970ba88ef45266aade152c7c1da8e90b24c0d7",
92+
"since-commit": "529b3f03e2b945ea2e5e879183ccfd8e74b7377c",
16293
"age": 1
16394
}
16495
],

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCargoDependency.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.RuntimeConfig
1010
import software.amazon.smithy.rust.codegen.core.smithy.crateLocation
1111

1212
fun RuntimeConfig.awsRuntimeCrate(name: String, features: Set<String> = setOf()): CargoDependency =
13-
CargoDependency(name, awsRoot().crateLocation(null), features = features)
13+
CargoDependency(name, awsRoot().crateLocation(name), features = features)
1414

1515
object AwsCargoDependency {
1616
fun awsConfig(runtimeConfig: RuntimeConfig) = runtimeConfig.awsRuntimeCrate("aws-config")

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/CredentialProviders.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ class CredentialProviderConfig(private val codegenContext: ClientCodegenContext)
8181
ServiceConfig.ConfigImpl -> {
8282
rustTemplate(
8383
"""
84-
/// Returns the credentials provider for this service
84+
/// This function was intended to be removed, and has been broken since release-2023-11-15 as it always returns a `None`. Do not use.
85+
##[deprecated(note = "This function was intended to be removed, and has been broken since release-2023-11-15 as it always returns a `None`. Do not use.")]
8586
pub fn credentials_provider(&self) -> Option<#{SharedCredentialsProvider}> {
86-
self.config.load::<#{SharedCredentialsProvider}>().cloned()
87+
#{None}
8788
}
8889
""",
8990
*codegenScope,
@@ -118,13 +119,13 @@ class CredentialProviderConfig(private val codegenContext: ClientCodegenContext)
118119
if (codegenContext.serviceShape.supportedAuthSchemes().contains("sigv4a")) {
119120
featureGateBlock("sigv4a") {
120121
rustTemplate(
121-
"self.runtime_components.push_identity_resolver(#{SIGV4A_SCHEME_ID}, credentials_provider.clone());",
122+
"self.runtime_components.set_identity_resolver(#{SIGV4A_SCHEME_ID}, credentials_provider.clone());",
122123
*codegenScope,
123124
)
124125
}
125126
}
126127
rustTemplate(
127-
"self.runtime_components.push_identity_resolver(#{SIGV4_SCHEME_ID}, credentials_provider);",
128+
"self.runtime_components.set_identity_resolver(#{SIGV4_SCHEME_ID}, credentials_provider);",
128129
*codegenScope,
129130
)
130131
}

aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/CredentialProviderConfigTest.kt

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal class CredentialProviderConfigTest {
3030
val moduleName = ctx.moduleUseName()
3131
rustTemplate(
3232
"""
33-
let (http_client, _rx) = #{capture_request}(None);
33+
let (http_client, _rx) = #{capture_request}(#{None});
3434
let client_config = $moduleName::Config::builder()
3535
.http_client(http_client)
3636
.build();
@@ -62,4 +62,71 @@ internal class CredentialProviderConfigTest {
6262
}
6363
}
6464
}
65+
66+
@Test
67+
fun `configuring credentials provider on builder should replace what was previously set`() {
68+
awsSdkIntegrationTest(SdkCodegenIntegrationTest.model) { ctx, rustCrate ->
69+
val rc = ctx.runtimeConfig
70+
val codegenScope = arrayOf(
71+
*RuntimeType.preludeScope,
72+
"capture_request" to RuntimeType.captureRequest(rc),
73+
"Credentials" to AwsRuntimeType.awsCredentialTypesTestUtil(rc)
74+
.resolve("Credentials"),
75+
"Region" to AwsRuntimeType.awsTypes(rc).resolve("region::Region"),
76+
"SdkConfig" to AwsRuntimeType.awsTypes(rc).resolve("sdk_config::SdkConfig"),
77+
"SharedCredentialsProvider" to AwsRuntimeType.awsCredentialTypes(rc)
78+
.resolve("provider::SharedCredentialsProvider"),
79+
)
80+
rustCrate.integrationTest("credentials_provider") {
81+
// per https://github.com/awslabs/aws-sdk-rust/issues/973
82+
tokioTest("configuring_credentials_provider_on_builder_should_replace_what_was_previously_set") {
83+
val moduleName = ctx.moduleUseName()
84+
rustTemplate(
85+
"""
86+
let (http_client, rx) = #{capture_request}(#{None});
87+
88+
let replace_me = #{Credentials}::new(
89+
"replace_me",
90+
"replace_me",
91+
#{None},
92+
#{None},
93+
"replace_me",
94+
);
95+
let sdk_config = #{SdkConfig}::builder()
96+
.credentials_provider(
97+
#{SharedCredentialsProvider}::new(replace_me),
98+
)
99+
.region(#{Region}::new("us-west-2"))
100+
.build();
101+
102+
let expected = #{Credentials}::new(
103+
"expected_credential",
104+
"expected_credential",
105+
#{None},
106+
#{None},
107+
"expected_credential",
108+
);
109+
let conf = $moduleName::config::Builder::from(&sdk_config)
110+
.http_client(http_client)
111+
.credentials_provider(expected)
112+
.build();
113+
114+
let client = $moduleName::Client::from_conf(conf);
115+
116+
let _ = client
117+
.some_operation()
118+
.send()
119+
.await
120+
.expect("success");
121+
122+
let req = rx.expect_request();
123+
let auth_header = req.headers().get("AUTHORIZATION").unwrap();
124+
assert!(auth_header.contains("expected_credential"), "{auth_header}");
125+
""",
126+
*codegenScope,
127+
)
128+
}
129+
}
130+
}
131+
}
65132
}

aws/sdk/integration-tests/kms/tests/integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async fn generate_random() {
5252
.header("content-type", "application/x-amz-json-1.1")
5353
.header("x-amz-target", "TrentService.GenerateRandom")
5454
.header("content-length", "20")
55-
.header("authorization", "AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-east-1/kms/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target;x-amz-user-agent, Signature=703f72fe50c310e3ee1a7a106df947b980cb91bc8bad7a4a603b057096603aed")
55+
.header("authorization", "AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-east-1/kms/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-target;x-amz-user-agent, Signature=53dcf70f6f852cb576185dcabef5aaa3d068704cf1b7ea7dc644efeaa46674d7")
5656
.header("x-amz-date", "20090213T233130Z")
5757
.header("user-agent", "aws-sdk-rust/0.123.test os/windows/XPSP3 lang/rust/1.50.0")
5858
.header("x-amz-user-agent", "aws-sdk-rust/0.123.test api/test-service/0.123 os/windows/XPSP3 lang/rust/1.50.0")

aws/sdk/integration-tests/qldbsession/tests/integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async fn signv4_use_correct_service_name() {
2020
.header("content-type", "application/x-amz-json-1.0")
2121
.header("x-amz-target", "QLDBSession.SendCommand")
2222
.header("content-length", "49")
23-
.header("authorization", "AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-east-1/qldb/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target;x-amz-user-agent, Signature=e8d50282fa369adf05f33a5b32e3ce2a7582edc902312c59de311001a97426d9")
23+
.header("authorization", "AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-east-1/qldb/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-target;x-amz-user-agent, Signature=9a07c60550504d015fb9a2b0f1b175a4d906651f9dd4ee44bebb32a802d03815")
2424
// qldbsession uses the signing name 'qldb' in signature _________________________^^^^
2525
.header("x-amz-date", "20090213T233130Z")
2626
.header("user-agent", "aws-sdk-rust/0.123.test os/windows/XPSP3 lang/rust/1.50.0")

aws/sdk/integration-tests/s3/tests/naughty-string-metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async fn test_s3_signer_with_naughty_string_metadata() {
8888

8989
// This is a snapshot test taken from a known working test result
9090
let snapshot_signature =
91-
"Signature=733dba2f1ca3c9a39f4eef3a6750a71eff00297cd765408ad3cef5dcdc44d642";
91+
"Signature=a5115604df66219874a9e5a8eab4c9f7a28c992ab2d918037a285756c019f3b2";
9292
assert!(
9393
auth_header .contains(snapshot_signature),
9494
"authorization header signature did not match expected signature: got {}, expected it to contain {}",

aws/sdk/integration-tests/s3/tests/normalize-uri-path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async fn test_operation_should_not_normalize_uri_path() {
4141
let expected_uri = "https://test-bucket-ad7c9f01-7f7b-4669-b550-75cc6d4df0f1.s3.us-east-1.amazonaws.com/a/.././b.txt?x-id=PutObject";
4242
assert_eq!(actual_uri, expected_uri);
4343

44-
let expected_sig = "Signature=404fb9502378c8f46fb83544848c42d29d55610a14b4bed9577542e49e549d08";
44+
let expected_sig = "Signature=2ac540538c84dc2616d92fb51d4fc6146ccd9ccc1ee85f518a1a686c5ef97b86";
4545
assert!(
4646
actual_auth.contains(expected_sig),
4747
"authorization header signature did not match expected signature: expected {} but not found in {}",

aws/sdk/integration-tests/s3/tests/query-strings-are-correctly-encoded.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async fn test_s3_signer_query_string_with_all_valid_chars() {
4545

4646
// This is a snapshot test taken from a known working test result
4747
let snapshot_signature =
48-
"Signature=740feb1de3968a643e68fb1a17c415d98dd6a1cc28782fb1ef6157586548c747";
48+
"Signature=9a931d20606f93fa4e5553602866a9b5ccac2cd42b54ae5a4b17e4614fb443ce";
4949
assert!(
5050
auth_header
5151
.contains(snapshot_signature),

0 commit comments

Comments
 (0)