From 8e8101a75a65d9b7fd5fee691e9ca3827884815b Mon Sep 17 00:00:00 2001 From: AWS SDK Rust Bot <97246200+aws-sdk-rust-ci@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:34:10 -0500 Subject: [PATCH 1/5] Run `cargo update` on the runtime lockfiles and the SDK lockfile (#3878) If CI fails, commit the necessary fixes to this PR until all checks pass. If required, update entries in [crateNameToLastKnownWorkingVersions](https://github.com/smithy-lang/smithy-rs/blob/6b42eb5ca00a2dc9c46562452e495a2ec2e43d0f/aws/sdk/build.gradle.kts#L503-L504). --- aws/rust-runtime/Cargo.lock | 51 +++----- aws/rust-runtime/aws-config/Cargo.lock | 10 +- aws/sdk/Cargo.lock | 174 +++++++++++-------------- rust-runtime/Cargo.lock | 161 +++++++++++------------ 4 files changed, 176 insertions(+), 220 deletions(-) diff --git a/aws/rust-runtime/Cargo.lock b/aws/rust-runtime/Cargo.lock index eb07c31c3b..986f38dba7 100644 --- a/aws/rust-runtime/Cargo.lock +++ b/aws/rust-runtime/Cargo.lock @@ -17,18 +17,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -121,7 +109,6 @@ version = "0.60.3" name = "aws-inlineable" version = "0.1.0" dependencies = [ - "ahash", "aws-credential-types", "aws-runtime", "aws-sigv4", @@ -303,7 +290,7 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.3" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -520,9 +507,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", @@ -1118,9 +1105,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -1214,9 +1201,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2463,9 +2450,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -2474,9 +2461,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -2489,9 +2476,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2499,9 +2486,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -2512,15 +2499,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/aws/rust-runtime/aws-config/Cargo.lock b/aws/rust-runtime/aws-config/Cargo.lock index 8e41568bc3..979c59de51 100644 --- a/aws/rust-runtime/aws-config/Cargo.lock +++ b/aws/rust-runtime/aws-config/Cargo.lock @@ -253,7 +253,7 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.3" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -428,9 +428,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "shlex", ] @@ -787,9 +787,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", diff --git a/aws/sdk/Cargo.lock b/aws/sdk/Cargo.lock index fcbf38209e..4898abb11b 100644 --- a/aws/sdk/Cargo.lock +++ b/aws/sdk/Cargo.lock @@ -339,7 +339,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -402,11 +402,12 @@ version = "0.60.3" [[package]] name = "aws-lc-fips-sys" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4795bbabc13643a8b3532184041ab41dec5740046aa15734428219cb9a0bfc" +checksum = "bf12b67bc9c5168f68655aadb2a12081689a58f1d9b1484705e4d1810ed6e4ac" dependencies = [ "bindgen", + "cc", "cmake", "dunce", "fs_extra", @@ -453,7 +454,7 @@ dependencies = [ "aws-smithy-eventstream 0.60.5", "aws-smithy-http 0.60.11", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -491,7 +492,7 @@ dependencies = [ "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime 1.7.1", + "aws-smithy-runtime 1.7.2", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "aws-types 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -521,7 +522,7 @@ dependencies = [ "aws-smithy-eventstream 0.60.5", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -544,7 +545,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -570,7 +571,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -594,7 +595,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -623,7 +624,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", "aws-smithy-query", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9", @@ -649,7 +650,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -674,7 +675,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -705,7 +706,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", "aws-smithy-query", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9", @@ -731,7 +732,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -758,7 +759,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -785,7 +786,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -813,7 +814,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -838,7 +839,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9", @@ -856,7 +857,6 @@ dependencies = [ name = "aws-sdk-s3" version = "0.0.0-local" dependencies = [ - "ahash", "async-std", "aws-config", "aws-credential-types 1.2.1", @@ -869,7 +869,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9", @@ -904,9 +904,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.54.0" +version = "1.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2f2a62020f3e06f9b352b2a23547f6e1d110b6bf1e18a6b588ae36114eaf6e2" +checksum = "cecd672c8d4265fd4fbecacd4a479180e616881bbe639250cf81ddb604e4c301" dependencies = [ "ahash", "aws-credential-types 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -917,7 +917,7 @@ dependencies = [ "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-json 0.60.7 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime 1.7.1", + "aws-smithy-runtime 1.7.2", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-xml 0.60.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -948,7 +948,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9", @@ -975,7 +975,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -996,7 +996,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -1019,7 +1019,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", "aws-smithy-query", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9", @@ -1045,7 +1045,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -1071,7 +1071,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -1098,7 +1098,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-types 1.3.3", @@ -1107,7 +1107,7 @@ dependencies = [ "futures-util", "hound", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "once_cell", "regex-lite", "serde_json", @@ -1313,12 +1313,12 @@ name = "aws-smithy-experimental" version = "0.1.4" dependencies = [ "aws-smithy-async 1.2.1", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "h2 0.4.6", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-util", "once_cell", @@ -1343,7 +1343,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "once_cell", "percent-encoding", "pin-project-lite", @@ -1404,7 +1404,7 @@ dependencies = [ name = "aws-smithy-mocks-experimental" version = "0.2.1" dependencies = [ - "aws-sdk-s3 1.54.0", + "aws-sdk-s3 1.56.0", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "tokio", @@ -1412,19 +1412,17 @@ dependencies = [ [[package]] name = "aws-smithy-protocol-test" -version = "0.62.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495c940cd5c7232ac3f0945ff559096deadd2fc73e4418a0e98fe5836788bb39" +version = "0.63.0" dependencies = [ "assert-json-diff", - "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime-api 1.7.2", "base64-simd", "cbor-diag", + "ciborium", "http 0.2.12", "pretty_assertions", "regex-lite", "roxmltree", - "serde_cbor", "serde_json", "thiserror", ] @@ -1432,9 +1430,11 @@ dependencies = [ [[package]] name = "aws-smithy-protocol-test" version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b92b62199921f10685c6b588fdbeb81168ae4e7950ae3e5f50145a01bb5f1ad" dependencies = [ "assert-json-diff", - "aws-smithy-runtime-api 1.7.2", + "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "base64-simd", "cbor-diag", "ciborium", @@ -1456,13 +1456,13 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1ce695746394772e7000b39fe073095db6d45a862d0767dd5ad0ac0d7f8eb87" +checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" dependencies = [ "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-protocol-test 0.62.0", + "aws-smithy-protocol-test 0.63.0 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes", @@ -1472,7 +1472,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "indexmap", "once_cell", @@ -1488,7 +1488,7 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.2" +version = "1.7.3" dependencies = [ "approx", "aws-smithy-async 1.2.1", @@ -1505,7 +1505,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "indexmap", "once_cell", @@ -1570,7 +1570,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "http-body-util", - "hyper 0.14.30", + "hyper 0.14.31", "itoa", "lazy_static", "num-integer", @@ -1663,7 +1663,7 @@ version = "1.3.3" dependencies = [ "aws-credential-types 1.2.1", "aws-smithy-async 1.2.1", - "aws-smithy-runtime 1.7.2", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "http 0.2.12", @@ -1862,7 +1862,7 @@ dependencies = [ "bs58", "chrono", "data-encoding", - "half 2.4.1", + "half", "nom", "num-bigint", "num-rational", @@ -1874,9 +1874,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", @@ -1931,7 +1931,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", - "half 2.4.1", + "half", ] [[package]] @@ -2559,12 +2559,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" - [[package]] name = "half" version = "2.4.1" @@ -2718,9 +2712,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -2742,9 +2736,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -2768,7 +2762,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -2785,7 +2779,7 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "rustls 0.23.14", "rustls-native-certs 0.8.0", @@ -2806,7 +2800,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2 0.5.7", "tokio", @@ -2901,9 +2895,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -3033,7 +3027,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f8e213c36148d828083ae01948eed271d03f95f7e72571fa242d78184029af2" dependencies = [ - "half 2.4.1", + "half", "minicbor-derive", ] @@ -3706,9 +3700,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -3842,16 +3836,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half 1.8.3", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.210" @@ -4494,9 +4478,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4505,9 +4489,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -4520,9 +4504,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4532,9 +4516,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4542,9 +4526,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -4555,15 +4539,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/rust-runtime/Cargo.lock b/rust-runtime/Cargo.lock index d660ae5dee..1b609232bf 100644 --- a/rust-runtime/Cargo.lock +++ b/rust-runtime/Cargo.lock @@ -152,11 +152,12 @@ dependencies = [ [[package]] name = "aws-lc-fips-sys" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4795bbabc13643a8b3532184041ab41dec5740046aa15734428219cb9a0bfc" +checksum = "bf12b67bc9c5168f68655aadb2a12081689a58f1d9b1484705e4d1810ed6e4ac" dependencies = [ "bindgen", + "cc", "cmake", "dunce", "fs_extra", @@ -203,7 +204,7 @@ dependencies = [ "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime 1.7.2", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "aws-types", @@ -220,9 +221,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.54.0" +version = "1.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2f2a62020f3e06f9b352b2a23547f6e1d110b6bf1e18a6b588ae36114eaf6e2" +checksum = "cecd672c8d4265fd4fbecacd4a479180e616881bbe639250cf81ddb604e4c301" dependencies = [ "ahash", "aws-credential-types", @@ -233,7 +234,7 @@ dependencies = [ "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-json 0.60.7 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime 1.7.2", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-xml 0.60.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -410,12 +411,12 @@ name = "aws-smithy-experimental" version = "0.1.4" dependencies = [ "aws-smithy-async 1.2.1", - "aws-smithy-runtime 1.7.1", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "h2 0.4.6", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-util", "once_cell", @@ -440,7 +441,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "once_cell", "percent-encoding", "pin-project-lite", @@ -489,7 +490,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "lambda_http", "mime", "nom", @@ -519,7 +520,7 @@ dependencies = [ "futures", "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "lambda_http", "num_cpus", @@ -579,19 +580,17 @@ dependencies = [ [[package]] name = "aws-smithy-protocol-test" -version = "0.62.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495c940cd5c7232ac3f0945ff559096deadd2fc73e4418a0e98fe5836788bb39" +version = "0.63.0" dependencies = [ "assert-json-diff", - "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime-api 1.7.2", "base64-simd", "cbor-diag", + "ciborium", "http 0.2.12", "pretty_assertions", "regex-lite", "roxmltree", - "serde_cbor", "serde_json", "thiserror", ] @@ -599,9 +598,11 @@ dependencies = [ [[package]] name = "aws-smithy-protocol-test" version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b92b62199921f10685c6b588fdbeb81168ae4e7950ae3e5f50145a01bb5f1ad" dependencies = [ "assert-json-diff", - "aws-smithy-runtime-api 1.7.2", + "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "base64-simd", "cbor-diag", "ciborium", @@ -623,69 +624,69 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" dependencies = [ - "approx", - "aws-smithy-async 1.2.1", - "aws-smithy-http 0.60.11", - "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-protocol-test 0.63.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes", "fastrand", - "futures-util", "h2 0.3.26", "http 0.2.12", - "http 1.1.0", "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "indexmap 2.6.0", "once_cell", "pin-project-lite", "pin-utils", - "pretty_assertions", "rustls 0.21.12", "serde", "serde_json", "tokio", "tracing", "tracing-subscriber", - "tracing-test", ] [[package]] name = "aws-smithy-runtime" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1ce695746394772e7000b39fe073095db6d45a862d0767dd5ad0ac0d7f8eb87" +version = "1.7.3" dependencies = [ - "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-protocol-test 0.62.0", - "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "approx", + "aws-smithy-async 1.2.1", + "aws-smithy-http 0.60.11", + "aws-smithy-protocol-test 0.63.0", + "aws-smithy-runtime-api 1.7.2", + "aws-smithy-types 1.2.7", "bytes", "fastrand", + "futures-util", "h2 0.3.26", "http 0.2.12", + "http 1.1.0", "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "indexmap 2.6.0", "once_cell", "pin-project-lite", "pin-utils", + "pretty_assertions", "rustls 0.21.12", "serde", "serde_json", "tokio", "tracing", "tracing-subscriber", + "tracing-test", ] [[package]] @@ -737,7 +738,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "http-body-util", - "hyper 0.14.30", + "hyper 0.14.31", "itoa", "lazy_static", "num-integer", @@ -1023,7 +1024,7 @@ dependencies = [ "bs58", "chrono", "data-encoding", - "half 2.4.1", + "half", "nom", "num-bigint", "num-rational", @@ -1035,9 +1036,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", @@ -1092,7 +1093,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", - "half 2.4.1", + "half", ] [[package]] @@ -1694,12 +1695,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" - [[package]] name = "half" version = "2.4.1" @@ -1858,9 +1853,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -1882,9 +1877,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -1908,7 +1903,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -1924,7 +1919,7 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "rustls 0.23.14", "rustls-native-certs 0.8.0", @@ -1945,7 +1940,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", @@ -1998,7 +1993,7 @@ dependencies = [ "aws-smithy-compression", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.7.1", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9", @@ -2070,9 +2065,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2090,7 +2085,7 @@ dependencies = [ "futures", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "lambda_runtime", "mime", "percent-encoding", @@ -2114,7 +2109,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "http-serde", - "hyper 0.14.30", + "hyper 0.14.31", "lambda_runtime_api_client", "serde", "serde_json", @@ -2132,7 +2127,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "690c5ae01f3acac8c9c3348b556fc443054e9b7f1deaf53e9ebab716282bf0ed" dependencies = [ "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "tokio", "tower-service", ] @@ -2248,7 +2243,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f8e213c36148d828083ae01948eed271d03f95f7e72571fa242d78184029af2" dependencies = [ - "half 2.4.1", + "half", "minicbor-derive", ] @@ -3030,9 +3025,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -3166,16 +3161,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half 1.8.3", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.210" @@ -3497,7 +3482,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81294c017957a1a69794f506723519255879e15a870507faf45dfed288b763dd" dependencies = [ "futures-util", - "hyper 0.14.30", + "hyper 0.14.31", "pin-project-lite", "thiserror", "tokio", @@ -3906,9 +3891,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -3917,9 +3902,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -3932,9 +3917,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3942,9 +3927,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -3955,15 +3940,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", From ef07c88707128f9b82d4e1a597cf0db8e0037367 Mon Sep 17 00:00:00 2001 From: Andrew Jewell <107044381+ajewellamz@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:47:39 -0400 Subject: [PATCH 2/5] chore: add Into conversions for Blob to [u8] (#3877) ## Motivation and Context Often I have a &[u8] or a Vec, but the sdk function takes a Blob. It would be convenient to pass the my_vec instead of aws_smithy_types::Blob::new(my_vec) ## Description In blob.rs I added Into> for Blob Into for Vec Into for &[u8] ## Testing Added a test to blob.rs to test the various scenarios. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- rust-runtime/aws-smithy-types/Cargo.toml | 2 +- rust-runtime/aws-smithy-types/src/blob.rs | 37 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/rust-runtime/aws-smithy-types/Cargo.toml b/rust-runtime/aws-smithy-types/Cargo.toml index 7b52b8b6d8..3fd9186d0f 100644 --- a/rust-runtime/aws-smithy-types/Cargo.toml +++ b/rust-runtime/aws-smithy-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-types" -version = "1.2.7" +version = "1.2.8" authors = [ "AWS Rust SDK Team ", "Russell Cohen ", diff --git a/rust-runtime/aws-smithy-types/src/blob.rs b/rust-runtime/aws-smithy-types/src/blob.rs index 7f76a45df3..f6ba16fda4 100644 --- a/rust-runtime/aws-smithy-types/src/blob.rs +++ b/rust-runtime/aws-smithy-types/src/blob.rs @@ -31,6 +31,24 @@ impl AsRef<[u8]> for Blob { } } +impl From> for Blob { + fn from(value: Vec) -> Self { + Blob::new(value) + } +} + +impl From for Vec { + fn from(value: Blob) -> Self { + value.into_inner() + } +} + +impl From<&[u8]> for Blob { + fn from(value: &[u8]) -> Self { + Blob::new(value) + } +} + #[cfg(all(aws_sdk_unstable, feature = "serde-serialize"))] mod serde_serialize { use super::*; @@ -103,6 +121,25 @@ mod serde_deserialize { } #[cfg(test)] +mod test { + use crate::Blob; + + #[test] + fn blob_conversion() { + let my_bytes: &[u8] = &[1u8, 2u8, 3u8]; + let my_vec = vec![1u8, 2u8, 3u8]; + let orig_vec = my_vec.clone(); + + let blob1: Blob = my_bytes.into(); + let vec1: Vec = blob1.into(); + assert_eq!(orig_vec, vec1); + + let blob2: Blob = my_vec.into(); + let vec2: Vec = blob2.into(); + assert_eq!(orig_vec, vec2); + } +} + #[cfg(all( aws_sdk_unstable, feature = "serde-serialize", From eb482614898d6a78c732d0d902b8a3acb4eefcef Mon Sep 17 00:00:00 2001 From: david-perez Date: Thu, 17 Oct 2024 17:50:28 +0200 Subject: [PATCH 3/5] `codegen-serde`: traverse operations of resources (#3882) The current implementation doesn't traverse a resource's operations if the serialization root is a service shape; the added test fails without this fix. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- .../codegen/serde/SerializeImplGenerator.kt | 6 ++- .../rust/codegen/serde/SerdeDecoratorTest.kt | 52 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt b/codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt index b7c6c862d0..3db8d0086c 100644 --- a/codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt +++ b/codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt @@ -6,6 +6,7 @@ package software.amazon.smithy.rust.codegen.serde import software.amazon.smithy.codegen.core.Symbol +import software.amazon.smithy.model.knowledge.TopDownIndex import software.amazon.smithy.model.shapes.BlobShape import software.amazon.smithy.model.shapes.BooleanShape import software.amazon.smithy.model.shapes.CollectionShape @@ -61,6 +62,7 @@ import software.amazon.smithy.rust.codegen.server.smithy.hasConstraintTrait class SerializeImplGenerator(private val codegenContext: CodegenContext) { private val model = codegenContext.model + private val topIndex = TopDownIndex.of(model) fun generateRootSerializerForShape(shape: Shape): Writable = serializerFn(shape, null) @@ -78,7 +80,9 @@ class SerializeImplGenerator(private val codegenContext: CodegenContext) { applyTo: Writable?, ): Writable { if (shape is ServiceShape) { - return shape.operations.map { serializerFn(model.expectShape(it), null) }.join("\n") + return topIndex.getContainedOperations(shape).map { + serializerFn(it, null) + }.join("\n") } else if (shape is OperationShape) { if (shape.isEventStream(model)) { // Don't generate serializers for event streams diff --git a/codegen-serde/src/test/kotlin/software/amazon/smithy/rust/codegen/serde/SerdeDecoratorTest.kt b/codegen-serde/src/test/kotlin/software/amazon/smithy/rust/codegen/serde/SerdeDecoratorTest.kt index 1e419a3c76..4a1dc3a520 100644 --- a/codegen-serde/src/test/kotlin/software/amazon/smithy/rust/codegen/serde/SerdeDecoratorTest.kt +++ b/codegen-serde/src/test/kotlin/software/amazon/smithy/rust/codegen/serde/SerdeDecoratorTest.kt @@ -179,6 +179,58 @@ class SerdeDecoratorTest { structure NotSerde {} """.asSmithyModel(smithyVersion = "2") + @Test + fun `decorator should traverse resources`() { + val model = + """ + namespace com.example + use smithy.rust#serde + use aws.protocols#awsJson1_0 + + @awsJson1_0 + @serde + service MyResourceService { + resources: [MyResource] + } + + resource MyResource { + read: ReadMyResource + } + + @readonly + operation ReadMyResource { + input := { } + } + """.asSmithyModel(smithyVersion = "2") + + val params = + IntegrationTestParams(cargoCommand = "cargo test --all-features", service = "com.example#MyResourceService") + serverIntegrationTest(model, params = params) { ctx, crate -> + val codegenScope = + arrayOf( + "crate" to RustType.Opaque(ctx.moduleUseName()), + "serde_json" to CargoDependency("serde_json", CratesIo("1")).toDevDependency().toType(), + // we need the derive feature + "serde" to CargoDependency.Serde.toDevDependency().toType(), + ) + + crate.integrationTest("test_serde") { + unitTest("input_serialized") { + rustTemplate( + """ + use #{crate}::input::ReadMyResourceInput; + use #{crate}::serde::*; + let input = ReadMyResourceInput { }; + let settings = SerializationSettings::default(); + let _serialized = #{serde_json}::to_string(&input.serialize_ref(&settings)).expect("failed to serialize"); + """, + *codegenScope, + ) + } + } + } + } + @Test fun generateSerializersThatWorkServer() { serverIntegrationTest(simpleModel, params = params) { ctx, crate -> From c8c610f1e1a50a2d209f12cf50fca103b97a7ac9 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 17 Oct 2024 10:52:40 -0500 Subject: [PATCH 4/5] Add RDS URL signer (#3867) ## Motivation and Context [aws-sdk-rust/951](https://github.com/awslabs/aws-sdk-rust/issues/951) ## Description Adds a struct for generating signed URLs for logging in to RDS. See [this doc](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.html) for more info. ## Testing I wrote a test. ## Checklist - [ ] For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "client," "server," or both in the `applies_to` key. - [ ] For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "aws-sdk-rust" in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- aws/rust-runtime/Cargo.lock | 6 +- aws/rust-runtime/aws-config/Cargo.lock | 2 +- aws/rust-runtime/aws-inlineable/Cargo.toml | 3 + .../aws-inlineable/external-types.toml | 3 +- aws/rust-runtime/aws-inlineable/src/lib.rs | 2 + .../aws-inlineable/src/rds_auth_token.rs | 314 ++++++++++++++++++ aws/rust-runtime/aws-sigv4/Cargo.toml | 2 +- .../aws-sigv4/src/http_request/sign.rs | 7 + .../smithy/rustsdk/AwsCodegenDecorator.kt | 2 + .../rustsdk/customize/rds/RdsDecorator.kt | 45 +++ rust-runtime/Cargo.lock | 24 +- rust-runtime/aws-smithy-checksums/Cargo.toml | 2 +- 12 files changed, 394 insertions(+), 18 deletions(-) create mode 100644 aws/rust-runtime/aws-inlineable/src/rds_auth_token.rs create mode 100644 aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/rds/RdsDecorator.kt diff --git a/aws/rust-runtime/Cargo.lock b/aws/rust-runtime/Cargo.lock index 986f38dba7..1cd58e0136 100644 --- a/aws/rust-runtime/Cargo.lock +++ b/aws/rust-runtime/Cargo.lock @@ -118,6 +118,7 @@ dependencies = [ "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", + "aws-types", "bytes", "fastrand", "hex", @@ -132,6 +133,7 @@ dependencies = [ "tempfile", "tokio", "tracing", + "url", ] [[package]] @@ -182,7 +184,7 @@ version = "0.60.3" [[package]] name = "aws-sigv4" -version = "1.2.4" +version = "1.2.5" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -227,7 +229,7 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.12" +version = "0.60.13" dependencies = [ "aws-smithy-http", "aws-smithy-types", diff --git a/aws/rust-runtime/aws-config/Cargo.lock b/aws/rust-runtime/aws-config/Cargo.lock index 979c59de51..5a1aa2a578 100644 --- a/aws/rust-runtime/aws-config/Cargo.lock +++ b/aws/rust-runtime/aws-config/Cargo.lock @@ -173,7 +173,7 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.4" +version = "1.2.5" dependencies = [ "aws-credential-types", "aws-smithy-http", diff --git a/aws/rust-runtime/aws-inlineable/Cargo.toml b/aws/rust-runtime/aws-inlineable/Cargo.toml index 054d41123c..07a00c99a1 100644 --- a/aws/rust-runtime/aws-inlineable/Cargo.toml +++ b/aws/rust-runtime/aws-inlineable/Cargo.toml @@ -18,6 +18,7 @@ http_1x = ["dep:http-1x", "dep:http-body-1x", "aws-smithy-runtime-api/http-1x"] aws-credential-types = { path = "../aws-credential-types" } aws-runtime = { path = "../aws-runtime", features = ["http-02x"] } aws-sigv4 = { path = "../aws-sigv4" } +aws-types = { path = "../aws-types" } aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async", features = ["rt-tokio"] } aws-smithy-checksums = { path = "../../../rust-runtime/aws-smithy-checksums" } aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" } @@ -37,8 +38,10 @@ ring = "0.17.5" sha2 = "0.10" tokio = "1.23.1" tracing = "0.1" +url = "2.5.2" [dev-dependencies] +aws-credential-types = { path = "../aws-credential-types", features = ["test-util"] } aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async", features = ["test-util"] } aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http", features = ["rt-tokio"] } aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["test-util"] } diff --git a/aws/rust-runtime/aws-inlineable/external-types.toml b/aws/rust-runtime/aws-inlineable/external-types.toml index 0e15e561d4..e2ff3ff6c1 100644 --- a/aws/rust-runtime/aws-inlineable/external-types.toml +++ b/aws/rust-runtime/aws-inlineable/external-types.toml @@ -1,5 +1,6 @@ allowed_external_types = [ - "aws_credential_types::provider::credentials::ProvideCredentials", + "aws_types::*", + "aws_credential_types::*", "aws_smithy_http::*", "aws_smithy_runtime_api::*", diff --git a/aws/rust-runtime/aws-inlineable/src/lib.rs b/aws/rust-runtime/aws-inlineable/src/lib.rs index 8fdbaf88b8..3a07c16b56 100644 --- a/aws/rust-runtime/aws-inlineable/src/lib.rs +++ b/aws/rust-runtime/aws-inlineable/src/lib.rs @@ -65,3 +65,5 @@ pub mod s3_expires_interceptor; /// allow docs to work #[derive(Debug)] pub struct Client; + +pub mod rds_auth_token; diff --git a/aws/rust-runtime/aws-inlineable/src/rds_auth_token.rs b/aws/rust-runtime/aws-inlineable/src/rds_auth_token.rs new file mode 100644 index 0000000000..8a85aea547 --- /dev/null +++ b/aws/rust-runtime/aws-inlineable/src/rds_auth_token.rs @@ -0,0 +1,314 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +//! Code related to creating signed URLs for logging in to RDS. +//! +//! For more information, see + +use aws_credential_types::provider::{ProvideCredentials, SharedCredentialsProvider}; +use aws_sigv4::http_request; +use aws_sigv4::http_request::{SignableBody, SignableRequest, SigningSettings}; +use aws_sigv4::sign::v4; +use aws_smithy_runtime_api::box_error::BoxError; +use aws_smithy_runtime_api::client::identity::Identity; +use aws_types::region::Region; +use std::fmt; +use std::fmt::Debug; +use std::time::Duration; + +const ACTION: &str = "connect"; +const SERVICE: &str = "rds-db"; + +/// A signer that generates an auth token for a database. +/// +/// ## Example +/// +/// ```ignore +/// use crate::auth_token::{AuthTokenGenerator, Config}; +/// +/// #[tokio::main] +/// async fn main() { +/// let cfg = aws_config::load_defaults(BehaviorVersion::latest()).await; +/// let generator = AuthTokenGenerator::new( +/// Config::builder() +/// .hostname("zhessler-test-db.cp7a4mblr2ig.us-east-1.rds.amazonaws.com") +/// .port(5432) +/// .username("zhessler") +/// .build() +/// .expect("cfg is valid"), +/// ); +/// let token = generator.auth_token(&cfg).await.unwrap(); +/// println!("{token}"); +/// } +/// ``` +#[derive(Debug)] +pub struct AuthTokenGenerator { + config: Config, +} + +/// An auth token usable as a password for an RDS database. +/// +/// This struct can be converted into a `&str` using the `Deref` trait or by calling `to_string()`. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct AuthToken { + inner: String, +} + +impl AuthToken { + /// Return the auth token as a `&str`. + #[must_use] + pub fn as_str(&self) -> &str { + &self.inner + } +} + +impl fmt::Display for AuthToken { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.inner) + } +} + +impl AuthTokenGenerator { + /// Given a `Config`, create a new RDS database login URL signer. + pub fn new(config: Config) -> Self { + Self { config } + } + + /// Return a signed URL usable as an auth token. + pub async fn auth_token( + &self, + config: &aws_types::sdk_config::SdkConfig, + ) -> Result { + let credentials = self + .config + .credentials() + .or(config.credentials_provider()) + .ok_or("credentials are required to create a signed URL for RDS")? + .provide_credentials() + .await?; + let identity: Identity = credentials.into(); + let region = self + .config + .region() + .or(config.region()) + .cloned() + .unwrap_or_else(|| Region::new("us-east-1")); + let time = config.time_source().ok_or("a time source is required")?; + + let mut signing_settings = SigningSettings::default(); + signing_settings.expires_in = Some(Duration::from_secs( + self.config.expires_in().unwrap_or(900).min(900), + )); + signing_settings.signature_location = http_request::SignatureLocation::QueryParams; + + let signing_params = v4::SigningParams::builder() + .identity(&identity) + .region(region.as_ref()) + .name(SERVICE) + .time(time.now()) + .settings(signing_settings) + .build()?; + + let url = format!( + "https://{}:{}/?Action={}&DBUser={}", + self.config.hostname(), + self.config.port(), + ACTION, + self.config.username() + ); + let signable_request = + SignableRequest::new("GET", &url, std::iter::empty(), SignableBody::empty()) + .expect("signable request"); + + let (signing_instructions, _signature) = + http_request::sign(signable_request, &signing_params.into())?.into_parts(); + + let mut url = url::Url::parse(&url).unwrap(); + for (name, value) in signing_instructions.params() { + url.query_pairs_mut().append_pair(name, value); + } + let inner = url.to_string().split_off("https://".len()); + + Ok(AuthToken { inner }) + } +} + +/// Configuration for an RDS auth URL signer. +#[derive(Debug, Clone)] +pub struct Config { + /// The AWS credentials to sign requests with. + /// + /// Uses the default credential provider chain if not specified. + credentials: Option, + + /// The hostname of the database to connect to. + hostname: String, + + /// The port number the database is listening on. + port: u64, + + /// The region the database is located in. Uses the region inferred from the runtime if omitted. + region: Option, + + /// The username to login as. + username: String, + + /// The number of seconds the signed URL should be valid for. + /// + /// Maxes at 900 seconds. + expires_in: Option, +} + +impl Config { + /// Create a new `SignerConfigBuilder`. + pub fn builder() -> ConfigBuilder { + ConfigBuilder::default() + } + + /// The AWS credentials to sign requests with. + pub fn credentials(&self) -> Option { + self.credentials.clone() + } + + /// The hostname of the database to connect to. + pub fn hostname(&self) -> &str { + &self.hostname + } + + /// The port number the database is listening on. + pub fn port(&self) -> u64 { + self.port + } + + /// The region to sign requests with. + pub fn region(&self) -> Option<&Region> { + self.region.as_ref() + } + + /// The DB username to login as. + pub fn username(&self) -> &str { + &self.username + } + + /// The number of seconds the signed URL should be valid for. + /// + /// Maxes out at 900 seconds. + pub fn expires_in(&self) -> Option { + self.expires_in + } +} + +/// A builder for [`Config`]s. +#[derive(Debug, Default)] +pub struct ConfigBuilder { + /// The AWS credentials to create the auth token with. + /// + /// Uses the default credential provider chain if not specified. + credentials: Option, + + /// The hostname of the database to connect to. + hostname: Option, + + /// The port number the database is listening on. + port: Option, + + /// The region the database is located in. Uses the region inferred from the runtime if omitted. + region: Option, + + /// The database username to login as. + username: Option, + + /// The number of seconds the auth token should be valid for. + expires_in: Option, +} + +impl ConfigBuilder { + /// The AWS credentials to create the auth token with. + /// + /// Uses the default credential provider chain if not specified. + pub fn credentials(mut self, credentials: impl ProvideCredentials + 'static) -> Self { + self.credentials = Some(SharedCredentialsProvider::new(credentials)); + self + } + + /// The hostname of the database to connect to. + pub fn hostname(mut self, hostname: impl Into) -> Self { + self.hostname = Some(hostname.into()); + self + } + + /// The port number the database is listening on. + pub fn port(mut self, port: u64) -> Self { + self.port = Some(port); + self + } + + /// The region the database is located in. Uses the region inferred from the runtime if omitted. + pub fn region(mut self, region: Region) -> Self { + self.region = Some(region); + self + } + + /// The database username to login as. + pub fn username(mut self, username: impl Into) -> Self { + self.username = Some(username.into()); + self + } + + /// The number of seconds the signed URL should be valid for. + /// + /// Maxes out at 900 seconds. + pub fn expires_in(mut self, expires_in: u64) -> Self { + self.expires_in = Some(expires_in); + self + } + + /// Consume this builder, returning an error if required fields are missing. + /// Otherwise, return a new `SignerConfig`. + pub fn build(self) -> Result { + Ok(Config { + credentials: self.credentials, + hostname: self.hostname.ok_or("A hostname is required")?, + port: self.port.ok_or("a port is required")?, + region: self.region, + username: self.username.ok_or("a username is required")?, + expires_in: self.expires_in, + }) + } +} + +#[cfg(test)] +mod test { + use super::{AuthTokenGenerator, Config}; + use aws_credential_types::provider::SharedCredentialsProvider; + use aws_credential_types::Credentials; + use aws_smithy_async::test_util::ManualTimeSource; + use aws_types::region::Region; + use aws_types::SdkConfig; + use std::time::{Duration, UNIX_EPOCH}; + + #[tokio::test] + async fn signing_works() { + let time_source = ManualTimeSource::new(UNIX_EPOCH + Duration::from_secs(1724709600)); + let sdk_config = SdkConfig::builder() + .credentials_provider(SharedCredentialsProvider::new(Credentials::new( + "akid", "secret", None, None, "test", + ))) + .time_source(time_source) + .build(); + let signer = AuthTokenGenerator::new( + Config::builder() + .hostname("prod-instance.us-east-1.rds.amazonaws.com") + .port(3306) + .region(Region::new("us-east-1")) + .username("peccy") + .build() + .unwrap(), + ); + + let signed_url = signer.auth_token(&sdk_config).await.unwrap(); + assert_eq!(signed_url.as_str(), "prod-instance.us-east-1.rds.amazonaws.com:3306/?Action=connect&DBUser=peccy&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=akid%2F20240826%2Fus-east-1%2Frds-db%2Faws4_request&X-Amz-Date=20240826T220000Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=dd0cba843009474347af724090233265628ace491ea17ce3eb3da098b983ad89"); + } +} diff --git a/aws/rust-runtime/aws-sigv4/Cargo.toml b/aws/rust-runtime/aws-sigv4/Cargo.toml index 49af10cc21..0d247d5436 100644 --- a/aws/rust-runtime/aws-sigv4/Cargo.toml +++ b/aws/rust-runtime/aws-sigv4/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-sigv4" -version = "1.2.4" +version = "1.2.5" authors = ["AWS Rust SDK Team ", "David Barsky "] description = "SigV4 signer for HTTP requests and Event Stream messages." edition = "2021" diff --git a/aws/rust-runtime/aws-sigv4/src/http_request/sign.rs b/aws/rust-runtime/aws-sigv4/src/http_request/sign.rs index dc8308dfda..414570791d 100644 --- a/aws/rust-runtime/aws-sigv4/src/http_request/sign.rs +++ b/aws/rust-runtime/aws-sigv4/src/http_request/sign.rs @@ -93,6 +93,13 @@ pub enum SignableBody<'a> { StreamingUnsignedPayloadTrailer, } +impl SignableBody<'_> { + /// Create a new empty signable body + pub fn empty() -> SignableBody<'static> { + SignableBody::Bytes(&[]) + } +} + /// Instructions for applying a signature to an HTTP request. #[derive(Debug)] pub struct SigningInstructions { diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt index 31c9588db9..afa1afe607 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt @@ -19,6 +19,7 @@ import software.amazon.smithy.rustsdk.customize.ec2.Ec2Decorator import software.amazon.smithy.rustsdk.customize.glacier.GlacierDecorator import software.amazon.smithy.rustsdk.customize.lambda.LambdaDecorator import software.amazon.smithy.rustsdk.customize.onlyApplyTo +import software.amazon.smithy.rustsdk.customize.rds.RdsDecorator import software.amazon.smithy.rustsdk.customize.route53.Route53Decorator import software.amazon.smithy.rustsdk.customize.s3.S3Decorator import software.amazon.smithy.rustsdk.customize.s3.S3ExpiresDecorator @@ -77,6 +78,7 @@ val DECORATORS: List = Ec2Decorator().onlyApplyTo("com.amazonaws.ec2#AmazonEC2"), GlacierDecorator().onlyApplyTo("com.amazonaws.glacier#Glacier"), LambdaDecorator().onlyApplyTo("com.amazonaws.lambda#AWSGirApiService"), + RdsDecorator().onlyApplyTo("com.amazonaws.rds#AmazonRDSv19"), Route53Decorator().onlyApplyTo("com.amazonaws.route53#AWSDnsV20130401"), "com.amazonaws.s3#AmazonS3".applyDecorators( S3Decorator(), diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/rds/RdsDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/rds/RdsDecorator.kt new file mode 100644 index 0000000000..f5bf031a67 --- /dev/null +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/rds/RdsDecorator.kt @@ -0,0 +1,45 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package software.amazon.smithy.rustsdk.customize.rds + +import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext +import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator +import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency +import software.amazon.smithy.rust.codegen.core.rustlang.Visibility +import software.amazon.smithy.rust.codegen.core.rustlang.rust +import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.RustCrate +import software.amazon.smithy.rustsdk.AwsCargoDependency +import software.amazon.smithy.rustsdk.InlineAwsDependency + +class RdsDecorator : ClientCodegenDecorator { + override val name: String = "RDS" + override val order: Byte = 0 + + override fun extras( + codegenContext: ClientCodegenContext, + rustCrate: RustCrate, + ) { + val rc = codegenContext.runtimeConfig + + rustCrate.lib { + // We should have a better way of including an inline dependency. + rust( + "// include #T;", + RuntimeType.forInlineDependency( + InlineAwsDependency.forRustFileAs( + "rds_auth_token", + "auth_token", + Visibility.PUBLIC, + AwsCargoDependency.awsSigv4(rc), + CargoDependency.smithyRuntimeApiClient(rc), + CargoDependency.smithyAsync(rc).toDevDependency().withFeature("test-util"), + CargoDependency.Url, + ), + ), + ) + } + } +} diff --git a/rust-runtime/Cargo.lock b/rust-runtime/Cargo.lock index 1b609232bf..c84b962516 100644 --- a/rust-runtime/Cargo.lock +++ b/rust-runtime/Cargo.lock @@ -230,7 +230,7 @@ dependencies = [ "aws-runtime", "aws-sigv4", "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-checksums 0.60.12 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-checksums 0.60.12", "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-json 0.60.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -317,11 +317,12 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" version = "0.60.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" dependencies = [ - "aws-smithy-http 0.60.11", - "aws-smithy-types 1.2.7", + "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes", - "bytes-utils", "crc32c", "crc32fast", "hex", @@ -329,23 +330,19 @@ dependencies = [ "http-body 0.4.6", "md-5", "pin-project-lite", - "pretty_assertions", "sha1", "sha2", - "tokio", "tracing", - "tracing-test", ] [[package]] name = "aws-smithy-checksums" -version = "0.60.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" +version = "0.60.13" dependencies = [ - "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-http 0.60.11", + "aws-smithy-types 1.2.7", "bytes", + "bytes-utils", "crc32c", "crc32fast", "hex", @@ -353,9 +350,12 @@ dependencies = [ "http-body 0.4.6", "md-5", "pin-project-lite", + "pretty_assertions", "sha1", "sha2", + "tokio", "tracing", + "tracing-test", ] [[package]] diff --git a/rust-runtime/aws-smithy-checksums/Cargo.toml b/rust-runtime/aws-smithy-checksums/Cargo.toml index 5c7a6b8a01..0888246992 100644 --- a/rust-runtime/aws-smithy-checksums/Cargo.toml +++ b/rust-runtime/aws-smithy-checksums/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-checksums" -version = "0.60.12" +version = "0.60.13" authors = [ "AWS Rust SDK Team ", "Zelda Hessler ", From de4bc4547df15e2472b9bca91c89f963ffad0b03 Mon Sep 17 00:00:00 2001 From: ysaito1001 Date: Fri, 18 Oct 2024 10:04:05 -0500 Subject: [PATCH 5/5] Allow multiple releases per day in the smithy-rs repository (#3875) ## Motivation and Context Currently, we can only make one `smithy-rs` release per day, and this restricts our ability to respond to urgent issues. This PR lifts that limitation, allowing us to make multiple releases per day. ## Description The core of this change is in the `render` subcommand of `changelogger`. When generating a date-based release tag, it now checks for existing tags on the same day. If a tag already exists, the `render` subcommand will append a numerical suffix to ensure the new tag is unique. In fact, appending a numerical suffix to make a release tag unique has been a workaround in our release pipeline (outside the `smithy-rs` repository) for quite some time. With the changes in this PR, we can eliminate that temporary solution from the release pipeline. Now that `changelogger` requires access to previous tags, CI steps that run `generate-smithy-rs-release` need to checkout the `smithy-rs` repository with all tags (`fetch-depth: 0` is for that purpose). ## Testing - [x] Added unit tests for `changelogger` - [x] Successfully bumped the release tag in [dry-run](https://github.com/smithy-lang/smithy-rs/actions/runs/11356509152/job/31588857360#step:8:26) (based on [this dummy change](https://github.com/smithy-lang/smithy-rs/commit/cb19b31eaa506d66d9869261c920784ccc311b15) to trick `changelogger` into thinking that it has to bump a release tag) - [x] Successfully bumped the release tag in the release pipeline (without the temporary hack we placed last year) ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- .github/workflows/ci.yml | 3 + .../release-scripts/create-release.js | 2 +- .github/workflows/release.yml | 37 ++++-- tools/ci-build/changelogger/Cargo.lock | 2 +- tools/ci-build/changelogger/Cargo.toml | 2 +- tools/ci-build/changelogger/src/main.rs | 14 +- tools/ci-build/changelogger/src/render.rs | 124 ++++++++++++++++-- tools/ci-build/changelogger/tests/e2e_test.rs | 31 ++++- tools/ci-build/sdk-versioner/Cargo.lock | 20 +++ .../ci-build/smithy-rs-tool-common/src/git.rs | 18 +++ .../src/git/get_current_tag.rs | 86 ------------ .../src/git/get_last_commit.rs | 73 ----------- .../smithy-rs-tool-common/src/git/reset.rs | 77 ----------- 13 files changed, 216 insertions(+), 273 deletions(-) delete mode 100644 tools/ci-build/smithy-rs-tool-common/src/git/get_current_tag.rs delete mode 100644 tools/ci-build/smithy-rs-tool-common/src/git/get_last_commit.rs delete mode 100644 tools/ci-build/smithy-rs-tool-common/src/git/reset.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7426f4f321..f1d641c61d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,9 @@ jobs: with: path: smithy-rs ref: ${{ inputs.git_ref }} + # `generate-smithy-rs-release` requires access to previous tags to determine if a numerical suffix is needed + # to make the release tag unique + fetch-depth: 0 # The models from aws-sdk-rust are needed to generate the full SDK for CI - uses: actions/checkout@v4 with: diff --git a/.github/workflows/release-scripts/create-release.js b/.github/workflows/release-scripts/create-release.js index fb10ea1b2c..8826b90d4e 100644 --- a/.github/workflows/release-scripts/create-release.js +++ b/.github/workflows/release-scripts/create-release.js @@ -10,7 +10,7 @@ const assert = require("assert"); const fs = require("fs"); const smithy_rs_repo = { - owner: "awslabs", + owner: "smithy-lang", repo: "smithy-rs", }; diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12e168eb65..114443656e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -181,12 +181,18 @@ jobs: ref: ${{ inputs.commit_sha }} path: smithy-rs token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }} + fetch-depth: 0 - name: Generate release artifacts uses: ./smithy-rs/.github/actions/docker-build with: action: generate-smithy-rs-release - name: Download all artifacts uses: ./smithy-rs/.github/actions/download-all-artifacts + # This step is not idempotent, as it pushes release artifacts to the `smithy-rs-release-1.x.y` branch. However, + # if this step succeeds but a subsequent step fails, retrying the release workflow is "safe" in that it does not + # create any inconsistent states; this step would simply fail because the release branch would be ahead of `main` + # due to previously pushed artifacts. + # To successfully retry a release, revert the commits in the release branch that pushed the artifacts. - name: Push smithy-rs changes shell: bash working-directory: smithy-rs-release/smithy-rs @@ -202,7 +208,7 @@ jobs: # to retry a release action execution that failed due to a transient issue. # In that case, we expect the commit to be releasable as-is, i.e. the changelog should have already # been processed. - git fetch --unshallow + git fetch if [[ "${DRY_RUN}" == "true" ]]; then # During dry-runs, "git push" without "--force" can fail if smithy-rs-release-x.y.z-preview is behind # smithy-rs-release-x.y.z, but that does not matter much during dry-runs. @@ -214,18 +220,7 @@ jobs: fi fi echo "commit_sha=$(git rev-parse HEAD)" > $GITHUB_OUTPUT - - name: Tag release - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }} - script: | - const createReleaseScript = require("./smithy-rs/.github/workflows/release-scripts/create-release.js"); - await createReleaseScript({ - github, - isDryRun: ${{ inputs.dry_run }}, - releaseManifestPath: "smithy-rs-release/smithy-rs-release-manifest.json", - releaseCommitish: "${{ steps.push-changelog.outputs.commit_sha }}" - }); + # This step is idempotent; the `publisher` will not publish a crate if the version is already published on crates.io. - name: Publish to crates.io shell: bash working-directory: smithy-rs-release/crates-to-publish @@ -247,7 +242,23 @@ jobs: else publisher publish -y --location . fi + # This step is not idempotent and MUST be performed last, as it will generate a new release in the `smithy-rs` + # repository with the release tag that is always unique and has an increasing numerical suffix. + - name: Tag release + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }} + script: | + const createReleaseScript = require("./smithy-rs/.github/workflows/release-scripts/create-release.js"); + await createReleaseScript({ + github, + isDryRun: ${{ inputs.dry_run }}, + releaseManifestPath: "smithy-rs-release/smithy-rs-release-manifest.json", + releaseCommitish: "${{ steps.push-changelog.outputs.commit_sha }}" + }); + # If this step fails for any reason, there's no need to retry the release workflow, as this step is auxiliary + # and the release itself was successful. Instead, manually trigger `backport-pull-request.yml`. open-backport-pull-request: name: Open backport pull request to merge the release branch back to main needs: diff --git a/tools/ci-build/changelogger/Cargo.lock b/tools/ci-build/changelogger/Cargo.lock index a4ede11d28..c3075ab9bf 100644 --- a/tools/ci-build/changelogger/Cargo.lock +++ b/tools/ci-build/changelogger/Cargo.lock @@ -129,7 +129,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "changelogger" -version = "0.2.0" +version = "0.3.0" dependencies = [ "anyhow", "clap", diff --git a/tools/ci-build/changelogger/Cargo.toml b/tools/ci-build/changelogger/Cargo.toml index 5a5221a9c7..c8ff06f56c 100644 --- a/tools/ci-build/changelogger/Cargo.toml +++ b/tools/ci-build/changelogger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "changelogger" -version = "0.2.0" +version = "0.3.0" authors = ["AWS Rust SDK Team "] description = "A CLI tool render and update changelogs from changelog files" edition = "2021" diff --git a/tools/ci-build/changelogger/src/main.rs b/tools/ci-build/changelogger/src/main.rs index 664a487725..ed6ef19b75 100644 --- a/tools/ci-build/changelogger/src/main.rs +++ b/tools/ci-build/changelogger/src/main.rs @@ -89,6 +89,7 @@ mod tests { previous_release_versions_manifest: None, date_override: None, smithy_rs_location: None, + aws_sdk_rust_location: None, }) }, Args::try_parse_from([ @@ -124,6 +125,7 @@ mod tests { previous_release_versions_manifest: None, date_override: None, smithy_rs_location: None, + aws_sdk_rust_location: Some(PathBuf::from("aws-sdk-rust-location")), }) }, Args::try_parse_from([ @@ -140,6 +142,8 @@ mod tests { "fromplace", "--changelog-output", "some-changelog", + "--aws-sdk-rust-location", + "aws-sdk-rust-location", ]) .unwrap() ); @@ -159,6 +163,7 @@ mod tests { )), date_override: None, smithy_rs_location: None, + aws_sdk_rust_location: Some(PathBuf::from("aws-sdk-rust-location")), }) }, Args::try_parse_from([ @@ -174,7 +179,9 @@ mod tests { "--changelog-output", "some-changelog", "--previous-release-versions-manifest", - "path/to/versions.toml" + "path/to/versions.toml", + "--aws-sdk-rust-location", + "aws-sdk-rust-location", ]) .unwrap() ); @@ -196,6 +203,7 @@ mod tests { )), date_override: None, smithy_rs_location: None, + aws_sdk_rust_location: Some(PathBuf::from("aws-sdk-rust-location")), }) }, Args::try_parse_from([ @@ -213,7 +221,9 @@ mod tests { "--current-release-versions-manifest", "path/to/current/versions.toml", "--previous-release-versions-manifest", - "path/to/previous/versions.toml" + "path/to/previous/versions.toml", + "--aws-sdk-rust-location", + "aws-sdk-rust-location", ]) .unwrap() ); diff --git a/tools/ci-build/changelogger/src/render.rs b/tools/ci-build/changelogger/src/render.rs index 40b0e14942..20fa1c3656 100644 --- a/tools/ci-build/changelogger/src/render.rs +++ b/tools/ci-build/changelogger/src/render.rs @@ -14,6 +14,7 @@ use smithy_rs_tool_common::changelog::{ ValidationSet, }; use smithy_rs_tool_common::git::{find_git_repository_root, Git, GitCLI}; +use smithy_rs_tool_common::release_tag::ReleaseTag; use smithy_rs_tool_common::versions_manifest::{CrateVersionMetadataMap, VersionsManifest}; use std::env; use std::fmt::Write; @@ -80,6 +81,9 @@ pub struct RenderArgs { // working directory will be used to attempt to find it. #[clap(long, action)] pub smithy_rs_location: Option, + // Location of the aws-sdk-rust repository, used exclusively to retrieve existing release tags. + #[clap(long, required_if_eq("change-set", "aws-sdk"))] + pub aws_sdk_rust_location: Option, // For testing only #[clap(skip)] @@ -97,18 +101,76 @@ pub fn subcommand_render(args: &RenderArgs) -> Result<()> { .unwrap_or(current_dir.as_path()), ) .context("failed to find smithy-rs repo root")?; - let smithy_rs = GitCLI::new(&repo_root)?; + let current_tag = { + let cli_for_tag = if let Some(aws_sdk_rust_repo_root) = &args.aws_sdk_rust_location { + GitCLI::new( + &find_git_repository_root("aws-sdk-rust", aws_sdk_rust_repo_root) + .context("failed to find aws-sdk-rust repo root")?, + )? + } else { + GitCLI::new(&repo_root)? + }; + cli_for_tag.get_current_tag()? + }; + let next_release_tag = next_tag(now, ¤t_tag); + + let smithy_rs = GitCLI::new(&repo_root)?; if args.independent_versioning { - let smithy_rs_metadata = - date_based_release_metadata(now, "smithy-rs-release-manifest.json"); - let sdk_metadata = date_based_release_metadata(now, "aws-sdk-rust-release-manifest.json"); + let smithy_rs_metadata = date_based_release_metadata( + now, + next_release_tag.clone(), + "smithy-rs-release-manifest.json", + ); + let sdk_metadata = date_based_release_metadata( + now, + next_release_tag, + "aws-sdk-rust-release-manifest.json", + ); update_changelogs(args, &smithy_rs, &smithy_rs_metadata, &sdk_metadata) } else { bail!("the --independent-versioning flag must be set; synchronized versioning no longer supported"); } } +// Generate a unique date-based release tag +// +// This function generates a date-based release tag and compares it to `current_tag`. +// If the generated tag is a substring of `current_tag`, it indicates that a release has already occurred on that day. +// In this case, the function ensures uniqueness by appending a numerical suffix to `current_tag`. +fn next_tag(now: OffsetDateTime, current_tag: &ReleaseTag) -> String { + let date_based_release_tag = format!( + "release-{year}-{month:02}-{day:02}", + year = now.date().year(), + month = u8::from(now.date().month()), + day = now.date().day() + ); + + let current_tag = current_tag.as_str(); + if current_tag.starts_with(&date_based_release_tag) { + bump_release_tag_suffix(current_tag) + } else { + date_based_release_tag + } +} + +// Bump `current_tag` by adding or incrementing a numerical suffix +// +// This is a private function that is only called by `next_tag`. +// It assumes that `current_tag` follows the format `release-YYYY-MM-DD`. +fn bump_release_tag_suffix(current_tag: &str) -> String { + if let Some(pos) = current_tag.rfind('.') { + let prefix = ¤t_tag[..pos]; + let suffix = ¤t_tag[pos + 1..]; + let suffix = suffix + .parse::() + .expect("should parse numerical suffix"); + format!("{}.{}", prefix, suffix + 1) + } else { + format!("{}.{}", current_tag, 2) + } +} + struct ReleaseMetadata { title: String, tag: String, @@ -126,16 +188,12 @@ struct ReleaseManifest { fn date_based_release_metadata( now: OffsetDateTime, + tag: String, manifest_name: impl Into, ) -> ReleaseMetadata { ReleaseMetadata { title: date_title(&now), - tag: format!( - "release-{year}-{month:02}-{day:02}", - year = now.date().year(), - month = u8::from(now.date().month()), - day = now.date().day() - ), + tag, manifest_name: manifest_name.into(), } } @@ -506,14 +564,19 @@ pub(crate) fn render( #[cfg(test)] mod test { - use super::{date_based_release_metadata, render, Changelog, ChangelogEntries, ChangelogEntry}; + use super::{ + bump_release_tag_suffix, date_based_release_metadata, next_tag, render, Changelog, + ChangelogEntries, ChangelogEntry, + }; use smithy_rs_tool_common::changelog::ChangelogLoader; + use smithy_rs_tool_common::release_tag::ReleaseTag; use smithy_rs_tool_common::{ changelog::SdkAffected, package::PackageCategory, versions_manifest::{CrateVersion, CrateVersionMetadataMap}, }; use std::fs; + use std::str::FromStr; use tempfile::TempDir; use time::OffsetDateTime; @@ -662,7 +725,8 @@ message = "Some API change" #[test] fn test_date_based_release_metadata() { let now = OffsetDateTime::from_unix_timestamp(100_000_000).unwrap(); - let result = date_based_release_metadata(now, "some-manifest.json"); + let result = + date_based_release_metadata(now, "release-1973-03-03".to_owned(), "some-manifest.json"); assert_eq!("March 3rd, 1973", result.title); assert_eq!("release-1973-03-03", result.tag); assert_eq!("some-manifest.json", result.manifest_name); @@ -817,4 +881,40 @@ message = "Some new API to do X" .trim_start(); pretty_assertions::assert_str_eq!(release_notes, expected_body); } + + #[test] + fn test_bump_release_tag_suffix() { + for (expected, input) in &[ + ("release-2024-07-18.2", "release-2024-07-18"), + ("release-2024-07-18.3", "release-2024-07-18.2"), + ( + "release-2024-07-18.4294967295", // u32::MAX + "release-2024-07-18.4294967294", + ), + ] { + assert_eq!(*expected, &bump_release_tag_suffix(*input)); + } + } + + #[test] + fn test_next_tag() { + // `now` falls on 2024-10-14 + let now = OffsetDateTime::from_unix_timestamp(1_728_938_598).unwrap(); + assert_eq!( + "release-2024-10-14", + &next_tag(now, &ReleaseTag::from_str("release-2024-10-13").unwrap()), + ); + assert_eq!( + "release-2024-10-14.2", + &next_tag(now, &ReleaseTag::from_str("release-2024-10-14").unwrap()), + ); + assert_eq!( + "release-2024-10-14.3", + &next_tag(now, &ReleaseTag::from_str("release-2024-10-14.2").unwrap()), + ); + assert_eq!( + "release-2024-10-14.10", + &next_tag(now, &ReleaseTag::from_str("release-2024-10-14.9").unwrap()), + ); + } } diff --git a/tools/ci-build/changelogger/tests/e2e_test.rs b/tools/ci-build/changelogger/tests/e2e_test.rs index ced5bd851d..2ec84b635a 100644 --- a/tools/ci-build/changelogger/tests/e2e_test.rs +++ b/tools/ci-build/changelogger/tests/e2e_test.rs @@ -13,7 +13,7 @@ use std::fs; use std::path::{Path, PathBuf}; use std::process::Command; use tempfile::TempDir; -use time::OffsetDateTime; +use time::{Duration, OffsetDateTime}; const SOURCE_MARKDOWN1: &str = r#"--- applies_to: ["aws-sdk-rust"] @@ -136,6 +136,18 @@ fn create_fake_repo_root( .unwrap(); release_commits.push(git.get_head_revision().unwrap()); } + + handle_failure( + "git-tag", + &Command::new("git") + .arg("tag") + .arg("release-1970-01-01") + .current_dir(path) + .output() + .unwrap(), + ) + .unwrap(); + (release_commits.remove(0), release_commits.remove(0)) } @@ -280,6 +292,7 @@ fn render_smithy_rs() { current_release_versions_manifest: None, previous_release_versions_manifest: None, smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -309,7 +322,7 @@ Old entry contents ); pretty_assertions::assert_str_eq!( r#"{ - "tagName": "release-1970-01-01", + "tagName": "release-1970-01-01.2", "name": "January 1st, 1970", "body": "**New this release:**\n- (all, [smithy-rs#1234](https://github.com/smithy-lang/smithy-rs/issues/1234), @another-dev) Another change\n\n**Contributors**\nThank you for your contributions! ❤\n- @another-dev ([smithy-rs#1234](https://github.com/smithy-lang/smithy-rs/issues/1234))\n\n", "prerelease": false @@ -383,10 +396,11 @@ fn render_aws_sdk() { changelog_output: dest_path.clone(), source_to_truncate: Some(dot_changelog_path.clone()), release_manifest_output: Some(tmp_dir.path().into()), - date_override: Some(OffsetDateTime::UNIX_EPOCH), + date_override: Some(OffsetDateTime::UNIX_EPOCH + Duration::days(1)), current_release_versions_manifest: None, previous_release_versions_manifest: Some(previous_versions_manifest_path), smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -402,7 +416,7 @@ fn render_aws_sdk() { // the other should be filtered out by the `since_commit` attribute pretty_assertions::assert_str_eq!( r#" -January 1st, 1970 +January 2nd, 1970 ================= **New this release:** - :bug: ([aws-sdk-rust#234](https://github.com/awslabs/aws-sdk-rust/issues/234), [smithy-rs#567](https://github.com/smithy-lang/smithy-rs/issues/567), @test-dev) Some other change @@ -424,8 +438,8 @@ Old entry contents ); pretty_assertions::assert_str_eq!( r#"{ - "tagName": "release-1970-01-01", - "name": "January 1st, 1970", + "tagName": "release-1970-01-02", + "name": "January 2nd, 1970", "body": "**New this release:**\n- :bug: ([aws-sdk-rust#234](https://github.com/awslabs/aws-sdk-rust/issues/234), [smithy-rs#567](https://github.com/smithy-lang/smithy-rs/issues/567), @test-dev) Some other change\n\n**Service Features:**\n- `aws-sdk-ec2` (0.12.0): Some API change\n\n**Contributors**\nThank you for your contributions! ❤\n- @test-dev ([aws-sdk-rust#234](https://github.com/awslabs/aws-sdk-rust/issues/234), [smithy-rs#567](https://github.com/smithy-lang/smithy-rs/issues/567))\n\n", "prerelease": false }"#, @@ -480,6 +494,7 @@ Change from server current_release_versions_manifest: None, previous_release_versions_manifest: None, smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -556,6 +571,7 @@ Change from client current_release_versions_manifest: None, previous_release_versions_manifest: None, smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -622,6 +638,7 @@ fn render_crate_versions() { current_release_versions_manifest: Some(current_versions_manifest_path), previous_release_versions_manifest: None, smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -662,7 +679,7 @@ Old entry contents ); pretty_assertions::assert_str_eq!( r#"{ - "tagName": "release-1970-01-01", + "tagName": "release-1970-01-01.2", "name": "January 1st, 1970", "body": "**New this release:**\n- (all, [smithy-rs#1234](https://github.com/smithy-lang/smithy-rs/issues/1234), @another-dev) Another change\n\n**Contributors**\nThank you for your contributions! ❤\n- @another-dev ([smithy-rs#1234](https://github.com/smithy-lang/smithy-rs/issues/1234))\n\n**Crate Versions**\n
\nClick to expand to view crate versions...\n\n|Crate|Version|\n|-|-|\n|aws-config|0.54.1|\n|aws-sdk-accessanalyzer|0.24.0|\n|aws-smithy-async|0.54.1|\n
\n\n", "prerelease": false diff --git a/tools/ci-build/sdk-versioner/Cargo.lock b/tools/ci-build/sdk-versioner/Cargo.lock index 45d72fb58b..8d5cc0e293 100644 --- a/tools/ci-build/sdk-versioner/Cargo.lock +++ b/tools/ci-build/sdk-versioner/Cargo.lock @@ -942,6 +942,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "slab" version = "0.4.9" @@ -965,6 +978,7 @@ dependencies = [ "semver", "serde", "serde_json", + "serde_yaml", "thiserror", "toml 0.5.11", "tracing", @@ -1253,6 +1267,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "url" version = "2.5.0" diff --git a/tools/ci-build/smithy-rs-tool-common/src/git.rs b/tools/ci-build/smithy-rs-tool-common/src/git.rs index da57a95f5a..bee033b199 100644 --- a/tools/ci-build/smithy-rs-tool-common/src/git.rs +++ b/tools/ci-build/smithy-rs-tool-common/src/git.rs @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +use crate::release_tag::ReleaseTag; use crate::shell::{handle_failure, output_text}; use anyhow::{bail, Context, Result}; use std::borrow::Cow; @@ -10,6 +11,7 @@ use std::ffi::OsStr; use std::fmt::{self, Write}; use std::path::{Path, PathBuf}; use std::process::Command; +use std::str::FromStr; use tracing::debug; use tracing::warn; @@ -134,6 +136,9 @@ pub trait Git: Send + Sync { /// Returns list of changed files. fn changed_files(&self) -> Result>; + + /// Finds the most recent tag that is reachable from `HEAD`. + fn get_current_tag(&self) -> Result; } enum CommitInfo { @@ -397,6 +402,19 @@ impl Git for GitCLI { let (stdout, _) = output_text(&output); Ok(split_file_names(&stdout)) } + + fn get_current_tag(&self) -> Result { + let mut command = Command::new(&self.binary_name); + command.arg("describe"); + command.arg("--tags"); + command.arg("--abbrev=0"); + command.current_dir(&self.repo_path); + + let output = command.output()?; + handle_failure("get_current_tag", &output)?; + let (stdout, _) = output_text(&output); + ReleaseTag::from_str(stdout.trim()) + } } fn is_newline(c: char) -> bool { diff --git a/tools/ci-build/smithy-rs-tool-common/src/git/get_current_tag.rs b/tools/ci-build/smithy-rs-tool-common/src/git/get_current_tag.rs deleted file mode 100644 index 4bf88a666e..0000000000 --- a/tools/ci-build/smithy-rs-tool-common/src/git/get_current_tag.rs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use crate::shell::{handle_failure, output_text, ShellOperation}; -use anyhow::Result; -use std::path::PathBuf; -use std::process::Command; - -pub struct GetCurrentTag { - program: &'static str, - path: PathBuf, -} - -impl GetCurrentTag { - pub fn new(path: impl Into) -> GetCurrentTag { - GetCurrentTag { - program: "git", - path: path.into(), - } - } -} - -impl ShellOperation for GetCurrentTag { - type Output = String; - - fn run(&self) -> Result { - let mut command = Command::new(self.program); - command.arg("describe"); - command.arg("--tags"); - command.current_dir(&self.path); - - let output = command.output()?; - handle_failure("get current tag", &output)?; - let (stdout, _) = output_text(&output); - Ok(stdout.trim().into()) - } -} - -#[cfg(all(test, not(target_os = "windows")))] -mod tests { - use super::*; - - #[test] - fn get_current_tag_success() { - let tag = GetCurrentTag { - program: "./git_describe_tags", - path: "./fake_git".into(), - } - .run() - .unwrap(); - assert_eq!("some-tag", tag); - } - - #[cfg(feature = "async")] - #[tokio::test] - async fn get_current_tag_success_async() { - let tag = GetCurrentTag { - program: "./git_describe_tags", - path: "./fake_git".into(), - } - .spawn() - .await - .unwrap(); - assert_eq!("some-tag", tag); - } - - #[test] - fn get_current_tag_failure() { - let result = GetCurrentTag { - program: "./git_fails", - path: "./fake_git".into(), - } - .run(); - - assert!(result.is_err(), "expected error, got {:?}", result); - assert_eq!( - "Failed to get current tag:\n\ - Status: 1\n\ - Stdout: some stdout failure message\n\n\ - Stderr: some stderr failure message\n\n", - format!("{}", result.err().unwrap()) - ); - } -} diff --git a/tools/ci-build/smithy-rs-tool-common/src/git/get_last_commit.rs b/tools/ci-build/smithy-rs-tool-common/src/git/get_last_commit.rs deleted file mode 100644 index 4a1fa26f62..0000000000 --- a/tools/ci-build/smithy-rs-tool-common/src/git/get_last_commit.rs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use crate::shell::{handle_failure, output_text, ShellOperation}; -use anyhow::Result; -use std::path::PathBuf; -use std::process::Command; - -pub struct GetLastCommit { - program: &'static str, - repo_path: PathBuf, -} - -impl GetLastCommit { - pub fn new(repo_path: impl Into) -> GetLastCommit { - GetLastCommit { - program: "git", - repo_path: repo_path.into(), - } - } -} - -impl ShellOperation for GetLastCommit { - type Output = String; - - fn run(&self) -> Result { - let mut command = Command::new(self.program); - command.arg("rev-parse"); - command.arg("HEAD"); - command.current_dir(&self.repo_path); - - let output = command.output()?; - handle_failure("get last commit", &output)?; - let (stdout, _) = output_text(&output); - Ok(stdout.trim().into()) - } -} - -#[cfg(all(test, not(target_os = "windows")))] -mod tests { - use super::*; - - #[test] - fn get_last_commit_success() { - let last_commit = GetLastCommit { - program: "./git_revparse_head", - repo_path: "./fake_git".into(), - } - .run() - .unwrap(); - assert_eq!("commithash", last_commit); - } - - #[test] - fn get_last_commit_failure() { - let result = GetLastCommit { - program: "./git_fails", - repo_path: "./fake_git".into(), - } - .run(); - - assert!(result.is_err(), "expected error, got {:?}", result); - assert_eq!( - "Failed to get last commit:\n\ - Status: 1\n\ - Stdout: some stdout failure message\n\n\ - Stderr: some stderr failure message\n\n", - format!("{}", result.err().unwrap()) - ); - } -} diff --git a/tools/ci-build/smithy-rs-tool-common/src/git/reset.rs b/tools/ci-build/smithy-rs-tool-common/src/git/reset.rs deleted file mode 100644 index d5009258ef..0000000000 --- a/tools/ci-build/smithy-rs-tool-common/src/git/reset.rs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use crate::shell::{handle_failure, ShellOperation}; -use anyhow::Result; -use std::path::PathBuf; -use std::process::Command; - -pub struct Reset { - program: &'static str, - path: PathBuf, - args: Vec, -} - -impl Reset { - pub fn new(path: impl Into, args: &[&str]) -> Self { - Reset { - program: "git", - path: path.into(), - args: args.iter().map(|&s| s.to_string()).collect(), - } - } -} - -impl ShellOperation for Reset { - type Output = (); - - fn run(&self) -> Result<()> { - let mut command = Command::new(self.program); - command.arg("reset"); - for arg in &self.args { - command.arg(arg); - } - command.current_dir(&self.path); - - let output = command.output()?; - handle_failure("git reset", &output)?; - Ok(()) - } -} - -#[cfg(all(test, not(target_os = "windows")))] -mod tests { - use super::*; - - #[test] - fn reset_success() { - Reset { - program: "./git_reset", - path: "./fake_git".into(), - args: vec!["--hard".to_string(), "some-commit-hash".to_string()], - } - .run() - .unwrap(); - } - - #[test] - fn reset_failure() { - let result = Reset { - program: "./git_fails", - path: "./fake_git".into(), - args: vec!["--hard".to_string(), "some-commit-hash".to_string()], - } - .run(); - - assert!(result.is_err(), "expected error, got {:?}", result); - assert_eq!( - "Failed to git reset:\n\ - Status: 1\n\ - Stdout: some stdout failure message\n\n\ - Stderr: some stderr failure message\n\n", - format!("{}", result.err().unwrap()) - ); - } -}