diff --git a/aws/rust-runtime/Cargo.lock b/aws/rust-runtime/Cargo.lock index 4c05d84e6c..f6152a0690 100644 --- a/aws/rust-runtime/Cargo.lock +++ b/aws/rust-runtime/Cargo.lock @@ -69,7 +69,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -488,9 +488,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "bytes-utils" @@ -529,9 +529,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -1146,9 +1146,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", @@ -1257,9 +1257,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libfuzzer-sys" @@ -1607,9 +1607,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -1976,29 +1976,29 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.211" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "1ac55e59090389fb9f0dd9e0f3c09615afed1d19094284d0b200441f13550793" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.211" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "54be4f245ce16bc58d57ef2716271d0d4519e0f6defa147f6e081005bcb278ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -2122,9 +2122,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" dependencies = [ "proc-macro2", "quote", @@ -2161,7 +2161,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2231,9 +2231,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -2255,7 +2255,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2306,7 +2306,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2366,7 +2366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2433,9 +2433,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" @@ -2511,7 +2511,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", "wasm-bindgen-shared", ] @@ -2533,7 +2533,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2703,7 +2703,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] diff --git a/aws/rust-runtime/aws-config/Cargo.lock b/aws/rust-runtime/aws-config/Cargo.lock index 4c969b87a1..113aebf8fa 100644 --- a/aws/rust-runtime/aws-config/Cargo.lock +++ b/aws/rust-runtime/aws-config/Cargo.lock @@ -230,16 +230,23 @@ name = "aws-smithy-http-client" version = "1.0.0" dependencies = [ "aws-smithy-async", + "aws-smithy-protocol-test", "aws-smithy-runtime-api", "aws-smithy-types", + "bytes", "h2 0.4.6", "http 0.2.12", + "http 1.1.0", "http-body 0.4.6", + "http-body 1.0.1", "hyper", "hyper-rustls", + "indexmap", "once_cell", "pin-project-lite", "rustls", + "serde", + "serde_json", "tokio", "tracing", ] @@ -283,7 +290,6 @@ dependencies = [ "aws-smithy-async", "aws-smithy-http", "aws-smithy-http-client", - "aws-smithy-protocol-test", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", @@ -292,13 +298,9 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper", - "indexmap", "once_cell", "pin-project-lite", "pin-utils", - "serde", - "serde_json", "tokio", "tracing", "tracing-subscriber", @@ -416,9 +418,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "bytes-utils" @@ -451,9 +453,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] @@ -829,9 +831,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", @@ -903,9 +905,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "lock_api" @@ -1146,9 +1148,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -1371,29 +1373,29 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.211" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "1ac55e59090389fb9f0dd9e0f3c09615afed1d19094284d0b200441f13550793" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.211" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "54be4f245ce16bc58d57ef2716271d0d4519e0f6defa147f6e081005bcb278ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "indexmap", "itoa", @@ -1487,9 +1489,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" dependencies = [ "proc-macro2", "quote", @@ -1513,7 +1515,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -1573,9 +1575,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -1597,7 +1599,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -1648,7 +1650,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -1721,7 +1723,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -1782,9 +1784,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" diff --git a/aws/sdk/Cargo.lock b/aws/sdk/Cargo.lock index d87a4c5dbe..d067cbbc12 100644 --- a/aws/sdk/Cargo.lock +++ b/aws/sdk/Cargo.lock @@ -295,7 +295,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -312,7 +312,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -904,9 +904,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.56.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecd672c8d4265fd4fbecacd4a479180e616881bbe639250cf81ddb604e4c301" +checksum = "8888c238bf93c77c5df8274b3999fd7fc1bb3fb658616f40dfde9e4fcd9efd94" dependencies = [ "ahash", "aws-credential-types 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -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", @@ -1326,7 +1326,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", @@ -1366,21 +1366,28 @@ name = "aws-smithy-http-client" version = "1.0.0" dependencies = [ "aws-smithy-async 1.2.1", + "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime-api 1.7.3", "aws-smithy-types 1.2.7", + "bytes", "h2 0.4.6", "http 0.2.12", "http 1.1.0", "http-body 0.4.6", - "hyper 0.14.30", - "hyper 1.4.1", + "http-body 1.0.1", + "http-body-util", + "hyper 0.14.31", + "hyper 1.5.0", "hyper-rustls 0.24.2", "hyper-rustls 0.27.3", "hyper-util", + "indexmap", "once_cell", "pin-project-lite", "rustls 0.21.12", - "rustls 0.23.14", + "rustls 0.23.15", + "serde", + "serde_json", "tokio", "tower", "tracing", @@ -1412,7 +1419,7 @@ dependencies = [ name = "aws-smithy-mocks-experimental" version = "0.2.1" dependencies = [ - "aws-sdk-s3 1.56.0", + "aws-sdk-s3 1.57.0", "aws-smithy-runtime-api 1.7.3", "aws-smithy-types 1.2.7", "tokio", @@ -1480,7 +1487,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", @@ -1502,7 +1509,6 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-http-client", - "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime-api 1.7.3", "aws-smithy-types 1.2.7", "bytes", @@ -1513,15 +1519,11 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", - "hyper-rustls 0.24.2", - "indexmap", + "hyper 0.14.31", "once_cell", "pin-project-lite", "pin-utils", "pretty_assertions", - "serde", - "serde_json", "tokio", "tracing", "tracing-subscriber", @@ -1577,7 +1579,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", @@ -1764,7 +1766,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.79", + "syn 2.0.82", "which", ] @@ -1840,9 +1842,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "bytes-utils" @@ -1881,9 +1883,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -2194,7 +2196,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2443,7 +2445,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2719,9 +2721,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", @@ -2743,9 +2745,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", @@ -2754,6 +2756,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2769,7 +2772,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", @@ -2786,9 +2789,9 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -2807,7 +2810,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", @@ -2932,9 +2935,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libfuzzer-sys" @@ -3046,7 +3049,7 @@ checksum = "bd2209fff77f705b00c737016a48e73733d7fbccb8b007194db148f03561fb70" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -3358,12 +3361,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "910d41a655dac3b764f1ade94821093d3610248694320cd072303a8eedcf221d" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -3392,9 +3395,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -3649,9 +3652,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "aws-lc-rs", "once_cell", @@ -3836,29 +3839,29 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.211" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "1ac55e59090389fb9f0dd9e0f3c09615afed1d19094284d0b200441f13550793" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.211" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "54be4f245ce16bc58d57ef2716271d0d4519e0f6defa147f6e081005bcb278ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "indexmap", "itoa", @@ -4010,9 +4013,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" dependencies = [ "proc-macro2", "quote", @@ -4049,7 +4052,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -4120,9 +4123,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -4144,7 +4147,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -4163,7 +4166,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] @@ -4258,7 +4261,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -4331,7 +4334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -4404,9 +4407,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" @@ -4503,7 +4506,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", "wasm-bindgen-shared", ] @@ -4537,7 +4540,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4794,7 +4797,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] diff --git a/aws/sdk/integration-tests/no-default-features/Cargo.toml b/aws/sdk/integration-tests/no-default-features/Cargo.toml index 9ed56d6c09..5c3d43ba16 100644 --- a/aws/sdk/integration-tests/no-default-features/Cargo.toml +++ b/aws/sdk/integration-tests/no-default-features/Cargo.toml @@ -17,7 +17,7 @@ publish = false aws-config = { path = "../../build/aws-sdk/sdk/aws-config", default-features = false } aws-sdk-s3 = { path = "../../build/aws-sdk/sdk/s3", default-features = false } aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async" } -aws-smithy-runtime= { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["test-util"] } aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] } futures = "0.3.25" tokio = { version = "1.23.1", features = ["full", "test-util"] } diff --git a/rust-runtime/Cargo.lock b/rust-runtime/Cargo.lock index b054a9fb26..b77d643c18 100644 --- a/rust-runtime/Cargo.lock +++ b/rust-runtime/Cargo.lock @@ -112,7 +112,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.56.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecd672c8d4265fd4fbecacd4a479180e616881bbe639250cf81ddb604e4c301" +checksum = "8888c238bf93c77c5df8274b3999fd7fc1bb3fb658616f40dfde9e4fcd9efd94" dependencies = [ "ahash", "aws-credential-types", @@ -424,7 +424,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", @@ -464,21 +464,28 @@ name = "aws-smithy-http-client" version = "1.0.0" dependencies = [ "aws-smithy-async 1.2.1", + "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime-api 1.7.3", "aws-smithy-types 1.2.7", + "bytes", "h2 0.4.6", "http 0.2.12", "http 1.1.0", "http-body 0.4.6", - "hyper 0.14.30", - "hyper 1.4.1", + "http-body 1.0.1", + "http-body-util", + "hyper 0.14.31", + "hyper 1.5.0", "hyper-rustls 0.24.2", "hyper-rustls 0.27.3", "hyper-util", + "indexmap 2.6.0", "once_cell", "pin-project-lite", "rustls 0.21.12", - "rustls 0.23.14", + "rustls 0.23.15", + "serde", + "serde_json", "tokio", "tower 0.5.1", "tracing", @@ -498,7 +505,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", @@ -528,7 +535,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", @@ -648,7 +655,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 2.6.0", "once_cell", @@ -670,7 +677,6 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-http-client", - "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime-api 1.7.3", "aws-smithy-types 1.2.7", "bytes", @@ -681,15 +687,11 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", - "hyper-rustls 0.24.2", - "indexmap 2.6.0", + "hyper 0.14.31", "once_cell", "pin-project-lite", "pin-utils", "pretty_assertions", - "serde", - "serde_json", "tokio", "tracing", "tracing-subscriber", @@ -745,7 +747,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", @@ -936,7 +938,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.79", + "syn 2.0.82", "which", ] @@ -999,9 +1001,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -1043,9 +1045,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -1371,7 +1373,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -1587,7 +1589,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -1860,9 +1862,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", @@ -1884,9 +1886,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", @@ -1895,6 +1897,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -1910,7 +1913,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", @@ -1926,9 +1929,9 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -1947,7 +1950,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", @@ -2092,7 +2095,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", @@ -2116,7 +2119,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", @@ -2134,7 +2137,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", ] @@ -2153,9 +2156,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libloading" @@ -2262,7 +2265,7 @@ checksum = "bd2209fff77f705b00c737016a48e73733d7fbccb8b007194db148f03561fb70" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2491,7 +2494,7 @@ checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2571,12 +2574,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "910d41a655dac3b764f1ade94821093d3610248694320cd072303a8eedcf221d" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -2605,9 +2608,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -2974,9 +2977,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "aws-lc-rs", "once_cell", @@ -3161,29 +3164,29 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.211" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "1ac55e59090389fb9f0dd9e0f3c09615afed1d19094284d0b200441f13550793" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.211" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "54be4f245ce16bc58d57ef2716271d0d4519e0f6defa147f6e081005bcb278ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "indexmap 2.6.0", "itoa", @@ -3353,9 +3356,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" dependencies = [ "proc-macro2", "quote", @@ -3413,7 +3416,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -3489,7 +3492,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", @@ -3498,9 +3501,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -3522,7 +3525,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -3541,7 +3544,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] @@ -3685,7 +3688,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -3758,7 +3761,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] @@ -3837,9 +3840,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "rand", @@ -3928,7 +3931,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", "wasm-bindgen-shared", ] @@ -3950,7 +3953,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4144,7 +4147,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.82", ] [[package]] diff --git a/rust-runtime/aws-smithy-http-client/Cargo.toml b/rust-runtime/aws-smithy-http-client/Cargo.toml index 3f8a24ace9..111fc3a60c 100644 --- a/rust-runtime/aws-smithy-http-client/Cargo.toml +++ b/rust-runtime/aws-smithy-http-client/Cargo.toml @@ -8,7 +8,6 @@ edition = "2021" repository = "https://github.com/smithy-lang/smithy-rs" [features] -legacy-tls-rustls = ["dep:legacy-hyper-rustls", "dep:legacy-rustls", "hyper-014"] hyper-014 = [ "aws-smithy-runtime-api/http-02x", "aws-smithy-types/http-body-0-4-x", @@ -25,8 +24,45 @@ hyper-1 = [ "hyper-util?/client-legacy", "dep:http-1x", "dep:tower", + + # FIXME - should not be needed in base http implementation, only for https and only for specific tls impl + "dep:rustls", + "dep:hyper-rustls", +] + +wire-mock = [ + "test-util", + "hyper-1", + "hyper-util?/server", + "hyper-util?/server-auto", + "hyper-util?/service", + "hyper-util?/server-graceful", + "tokio/macros", + "dep:http-body-util", ] +test-util = [ + "dep:aws-smithy-protocol-test", + "dep:serde", + "dep:serde_json", + "dep:indexmap", + "dep:bytes", + # for capture_request + "dep:http-1x", + "aws-smithy-runtime-api/http-1x", + # for dvr + "dep:http-body-1x", + "aws-smithy-types/http-body-1-x", +] + +legacy-test-util = [ + "test-util", + "dep:http-02x", + "aws-smithy-runtime-api/http-02x" +] + +legacy-tls-rustls = ["dep:legacy-hyper-rustls", "dep:legacy-rustls", "hyper-014"] + # FIXME - s2n-tls option, distinguish between rustls and s2n crypto-ring = ["dep:rustls", "rustls?/ring", "dep:hyper-rustls", "hyper-1"] crypto-aws-lc = ["dep:rustls", "rustls?/aws_lc_rs", "dep:hyper-rustls", "hyper-1"] @@ -36,9 +72,10 @@ crypto-aws-lc-fips = ["dep:rustls", "rustls?/fips", "dep:hyper-rustls", "hyper-1 aws-smithy-async = { path = "../aws-smithy-async" } aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["client"] } aws-smithy-types = { path = "../aws-smithy-types" } +aws-smithy-protocol-test = { path = "../aws-smithy-protocol-test", optional = true } h2 = { version = "0.4", default-features = false } # FIXME - do we need tokio enabled by default? -tokio = { version = "1", features = [] } +tokio = { version = "1.40", features = [] } once_cell = "1.20.1" pin-project-lite = "0.2.14" tracing = "0.1" @@ -47,6 +84,7 @@ tracing = "0.1" hyper = { version = "1", features = ["client", "http1", "http2"], optional = true } hyper-util = { version = "0.1.7", optional = true } http-1x = { package = "http", version = "1" , optional = true } +http-body-1x = { package = "http-body", version = "1", optional = true} hyper-rustls = { version = "0.27", features = ["http2", "http1", "native-tokio", "tls12"], default-features = false, optional = true } rustls = { version = "0.23", default-features = false, optional = true } tower = { version = "0.5.1", optional = true } @@ -60,6 +98,14 @@ legacy-hyper-rustls = { package = "hyper-rustls", version = "0.24", features = [ legacy-rustls = { package = "rustls", version = "0.21.8", optional = true } # end legacy stack deps +# test util stack +bytes = { version = "1", optional = true } +serde = { version = "1.0.210", features = ["derive"], optional = true } +serde_json = { version = "1.0.128", features = ["preserve_order"], optional = true } +indexmap = { version = "2.6.0", features = ["serde"], optional = true } +http-body-util = { version = "0.1.2", optional = true } +# end test util stack + [dev-dependencies] aws-smithy-async = { path = "../aws-smithy-async", features = ["rt-tokio", "test-util"] } aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["test-util"] } diff --git a/rust-runtime/aws-smithy-http-client/external-types.toml b/rust-runtime/aws-smithy-http-client/external-types.toml index 80d6dc0bf6..368c5b8c10 100644 --- a/rust-runtime/aws-smithy-http-client/external-types.toml +++ b/rust-runtime/aws-smithy-http-client/external-types.toml @@ -1,8 +1,9 @@ allowed_external_types = [ "aws_smithy_runtime_api::*", "aws_smithy_async::*", + "aws_smithy_types::*", - # TODO(https://github.com/smithy-lang/smithy-rs/issues/1193): Once tooling permits it, only allow the following types in the `hyper-014` feature + # TODO(https://github.com/smithy-lang/smithy-rs/issues/1193): Once tooling permits it, only allow the following types based on the feature that exposes them "hyper::client::client::Builder", "hyper::client::connect::Connection", "tokio::io::async_read::AsyncRead", @@ -10,4 +11,14 @@ allowed_external_types = [ "http::uri::Uri", # Used in trait bounds for legacy hyper connector build method "tower_service::Service", + + "bytes::bytes::Bytes", + "serde::ser::Serialize", + "serde::de::Deserialize", + "hyper::client::connect::dns::Name", + "http::request::Request", + "http::response::Response", + "http::uri::Uri", + "tokio::net::tcp::stream::TcpStream", + "hyper_util::rt::tokio::TokioIo", ] diff --git a/rust-runtime/aws-smithy-http-client/src/hyper_1.rs b/rust-runtime/aws-smithy-http-client/src/hyper_1.rs index aff7f7b5c4..3d6c8100cb 100644 --- a/rust-runtime/aws-smithy-http-client/src/hyper_1.rs +++ b/rust-runtime/aws-smithy-http-client/src/hyper_1.rs @@ -706,7 +706,7 @@ impl HyperClientBuilder { } } -fn build_with_fn( +pub(crate) fn build_with_fn( client_builder: Option, tcp_connector_fn: F, ) -> SharedHttpClient diff --git a/rust-runtime/aws-smithy-http-client/src/lib.rs b/rust-runtime/aws-smithy-http-client/src/lib.rs index 2520d287a6..562b54bd4f 100644 --- a/rust-runtime/aws-smithy-http-client/src/lib.rs +++ b/rust-runtime/aws-smithy-http-client/src/lib.rs @@ -11,6 +11,7 @@ //! //! # Crate Features //! +//! - `hyper-014`: (Deprecated) HTTP client implementation based on hyper-0.14.x. //! - `test-util`: Enables utilities for unit tests. DO NOT ENABLE IN PRODUCTION. #![warn( @@ -37,3 +38,6 @@ pub mod hyper_014 { /// Default HTTP and TLS connectors that use hyper 0.14.x and rustls. #[cfg(feature = "hyper-1")] pub mod hyper_1; + +#[cfg(feature = "test-util")] +pub mod test_util; diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util.rs b/rust-runtime/aws-smithy-http-client/src/test_util.rs similarity index 83% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util.rs rename to rust-runtime/aws-smithy-http-client/src/test_util.rs index a1c4250fb2..422187ea14 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util.rs @@ -12,7 +12,7 @@ //! respond with a given response, then capture request can also be useful since //! you can optionally give it a response to return. #![cfg_attr( - feature = "connector-hyper-0-14-x", + feature = "hyper-1", doc = "- [`dvr`]: If you want to record real-world traffic and then replay it later, then DVR's" )] //! [`RecordingClient`](dvr::RecordingClient) and [`ReplayingClient`](dvr::ReplayingClient) @@ -29,17 +29,20 @@ //! - [`NeverClient`]: Useful for testing timeouts, where you want the client to never respond. //! #![cfg_attr( - feature = "connector-hyper-0-14-x", + any(feature = "hyper-014", feature = "hyper-1"), doc = " There is also the [`NeverTcpConnector`], which makes it easy to test connect/read timeouts. Finally, for socket-level mocking, see the [`wire`] module. " )] + mod capture_request; pub use capture_request::{capture_request, CaptureRequestHandler, CaptureRequestReceiver}; -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(feature = "legacy-test-util")] +pub use capture_request::legacy_capture_request; + pub mod dvr; mod replay; @@ -48,11 +51,17 @@ pub use replay::{ReplayEvent, StaticReplayClient}; mod infallible; pub use infallible::infallible_client_fn; +// infallible based on http_02x stack had to be duplicated to avoid breaking API changes +#[allow(missing_docs)] +#[cfg(feature = "legacy-test-util")] +pub mod legacy_infallible; + mod never; pub use never::NeverClient; -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(any(feature = "hyper-014", feature = "hyper-1"))] pub use never::NeverTcpConnector; -#[cfg(all(feature = "connector-hyper-0-14-x", feature = "wire-mock"))] +mod body; +#[cfg(all(feature = "hyper-1", feature = "wire-mock"))] pub mod wire; diff --git a/rust-runtime/aws-smithy-http-client/src/test_util/body.rs b/rust-runtime/aws-smithy-http-client/src/test_util/body.rs new file mode 100644 index 0000000000..031e1a7904 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/test_util/body.rs @@ -0,0 +1,95 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_runtime_api::box_error::BoxError; +use aws_smithy_types::body::SdkBody; +use bytes::Bytes; +use http_body_1x::{Frame, SizeHint}; +use pin_project_lite::pin_project; +use std::future::poll_fn; +use std::pin::{pin, Pin}; +use std::task::{Context, Poll}; +use tokio::sync::mpsc; + +/// Create a `SdkBody` with an associated sender half. +/// +/// Useful for sending data from another thread/task and test scenarios. +pub(crate) fn channel_body() -> (Sender, SdkBody) { + let (tx, rx) = mpsc::channel(1); + let sender = Sender { tx }; + let ch_body = ChannelBody { rx }; + (sender, SdkBody::from_body_1_x(ch_body)) +} + +/// Sender half of channel based `SdkBody` implementation useful for testing. +/// +/// Roughly a replacement for hyper 0.14.x `Sender` body. +/// +/// ## Body Closing +/// +/// The request body will always be closed normally when the sender is dropped. If you +/// want to close the connection with an incomplete response, call [`Sender::abort()`] method to +/// abort the body in an abnormal fashion. +#[derive(Debug)] +pub(crate) struct Sender { + tx: mpsc::Sender, BoxError>>, +} + +impl Sender { + /// Send data on data channel when it's ready + pub(crate) async fn send_data(&mut self, chunk: Bytes) -> Result<(), BoxError> { + let frame = Frame::data(chunk); + self.tx.send(Ok(frame)).await.map_err(|e| e.into()) + } + + // TODO(test-utils): we can add support for trailers if needed in the future + + /// Abort the body in an abnormal fashion + pub(crate) fn abort(self) { + let _ = self.tx.clone().try_send(Err("body write aborted".into())); + } +} + +pin_project! { + struct ChannelBody { + rx: mpsc::Receiver, BoxError>> + } +} + +impl http_body_1x::Body for ChannelBody { + type Data = Bytes; + type Error = BoxError; + + fn poll_frame( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll, Self::Error>>> { + let this = self.project(); + this.rx.poll_recv(cx) + } + + fn is_end_stream(&self) -> bool { + self.rx.is_closed() + } + + fn size_hint(&self) -> SizeHint { + SizeHint::default() + } +} + +pub(crate) async fn next_data_frame(body: &mut SdkBody) -> Option> { + use http_body_1x::Body; + let mut pinned = pin!(body); + match poll_fn(|cx| pinned.as_mut().poll_frame(cx)).await? { + Ok(frame) => { + if frame.is_data() { + Some(Ok(frame.into_data().unwrap())) + } else { + None + } + } + Err(err) => Some(Err(err)), + } +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/capture_request.rs b/rust-runtime/aws-smithy-http-client/src/test_util/capture_request.rs similarity index 62% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/capture_request.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/capture_request.rs index 70836808a4..eacf483db3 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/capture_request.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/capture_request.rs @@ -7,8 +7,9 @@ use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; use aws_smithy_runtime_api::client::http::{ HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector, }; -use aws_smithy_runtime_api::client::orchestrator::HttpRequest; +use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse}; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; +use aws_smithy_runtime_api::http::HttpError; use aws_smithy_runtime_api::shared::IntoShared; use aws_smithy_types::body::SdkBody; use std::fmt::Debug; @@ -17,7 +18,7 @@ use tokio::sync::oneshot; #[derive(Debug)] struct Inner { - response: Option>, + response: Option, sender: Option>, } @@ -34,9 +35,7 @@ impl HttpConnector for CaptureRequestHandler { HttpConnectorFuture::ready(Ok(inner .response .take() - .expect("could not handle second request") - .try_into() - .unwrap())) + .expect("could not handle second request"))) } } @@ -101,19 +100,67 @@ impl CaptureRequestReceiver { /// ); /// ``` pub fn capture_request( - response: Option>, + response: Option>, ) -> (CaptureRequestHandler, CaptureRequestReceiver) { let (tx, rx) = oneshot::channel(); + let http_resp: HttpResponse = match response { + Some(resp) => resp.try_into().expect("valid HttpResponse"), + None => http_1x::Response::builder() + .status(200) + .body(SdkBody::empty()) + .expect("unreachable") + .try_into() + .expect("unreachable"), + }; ( CaptureRequestHandler(Arc::new(Mutex::new(Inner { - response: Some(response.unwrap_or_else(|| { - http_02x::Response::builder() - .status(200) - .body(SdkBody::empty()) - .expect("unreachable") - })), + response: Some(http_resp), sender: Some(tx), }))), CaptureRequestReceiver { receiver: rx }, ) } + +#[allow(missing_docs)] +#[cfg(feature = "legacy-test-util")] +pub fn legacy_capture_request( + response: Option>, +) -> (CaptureRequestHandler, CaptureRequestReceiver) { + capture_request(response) +} + +#[cfg(test)] +mod test { + use aws_smithy_runtime_api::client::http::HttpConnector; + use aws_smithy_runtime_api::client::orchestrator::HttpRequest; + use aws_smithy_types::body::SdkBody; + + #[cfg(feature = "legacy-test-util")] + #[tokio::test] + async fn test_can_plug_in_http_02x() { + use super::capture_request; + let (capture_client, _request) = capture_request(Some( + http_02x::Response::builder() + .status(202) + .body(SdkBody::empty()) + .expect("unreachable"), + )); + + let resp = capture_client.call(HttpRequest::empty()).await.unwrap(); + assert_eq!(202, resp.status().as_u16()); + } + + #[tokio::test] + async fn test_can_plug_in_http_1x() { + use super::capture_request; + let (capture_client, _request) = capture_request(Some( + http_1x::Response::builder() + .status(202) + .body(SdkBody::empty()) + .expect("unreachable"), + )); + + let resp = capture_client.call(HttpRequest::empty()).await.unwrap(); + assert_eq!(202, resp.status().as_u16()); + } +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr.rs b/rust-runtime/aws-smithy-http-client/src/test_util/dvr.rs similarity index 90% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/dvr.rs index 181c340902..e0fd982d6d 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/dvr.rs @@ -128,6 +128,7 @@ pub struct Response { headers: IndexMap>, } +#[cfg(feature = "legacy-test-util")] impl From<&Request> for http_02x::Request<()> { fn from(request: &Request) -> Self { let mut builder = http_02x::Request::builder().uri(request.uri.as_str()); @@ -140,6 +141,18 @@ impl From<&Request> for http_02x::Request<()> { } } +impl From<&Request> for http_1x::Request<()> { + fn from(request: &Request) -> Self { + let mut builder = http_1x::Request::builder().uri(request.uri.as_str()); + for (k, values) in request.headers.iter() { + for v in values { + builder = builder.header(k, v); + } + } + builder.method(request.method.as_str()).body(()).unwrap() + } +} + impl<'a> From<&'a HttpRequest> for Request { fn from(req: &'a HttpRequest) -> Self { let uri = req.uri().to_string(); @@ -162,7 +175,7 @@ fn headers_to_map_http(headers: &Headers) -> IndexMap> { out } -fn headers_to_map_02x(headers: &http_02x::HeaderMap) -> IndexMap> { +fn headers_to_map(headers: &Headers) -> IndexMap> { let mut out: IndexMap<_, Vec<_>> = IndexMap::new(); for (header_name, header_value) in headers.iter() { let entry = out.entry(header_name.to_string()).or_default(); @@ -175,7 +188,8 @@ fn headers_to_map_02x(headers: &http_02x::HeaderMap) -> IndexMap IndexMap> { +#[cfg(feature = "legacy-test-util")] +fn headers_to_map_02x(headers: &http_02x::HeaderMap) -> IndexMap> { let mut out: IndexMap<_, Vec<_>> = IndexMap::new(); for (header_name, header_value) in headers.iter() { let entry = out.entry(header_name.to_string()).or_default(); @@ -188,6 +202,7 @@ fn headers_to_map(headers: &Headers) -> IndexMap> { out } +#[cfg(feature = "legacy-test-util")] impl<'a, B> From<&'a http_02x::Response> for Response { fn from(resp: &'a http_02x::Response) -> Self { let status = resp.status().as_u16(); @@ -196,6 +211,27 @@ impl<'a, B> From<&'a http_02x::Response> for Response { } } +fn headers_to_map_1x(headers: &http_1x::HeaderMap) -> IndexMap> { + let mut out: IndexMap<_, Vec<_>> = IndexMap::new(); + for (header_name, header_value) in headers.iter() { + let entry = out.entry(header_name.to_string()).or_default(); + entry.push( + std::str::from_utf8(header_value.as_ref()) + .unwrap() + .to_string(), + ); + } + out +} + +impl<'a, B> From<&'a http_1x::Response> for Response { + fn from(resp: &'a http_1x::Response) -> Self { + let status = resp.status().as_u16(); + let headers = headers_to_map_1x(resp.headers()); + Self { status, headers } + } +} + impl From<&HttpResponse> for Response { fn from(resp: &HttpResponse) -> Self { Self { @@ -343,6 +379,7 @@ mod tests { Ok(()) } + #[cfg(feature = "legacy-test-util")] #[tokio::test] async fn turtles_all_the_way_down() -> Result<(), Box> { // create a replaying connection from a recording, wrap a recording connection around it, diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/record.rs b/rust-runtime/aws-smithy-http-client/src/test_util/dvr/record.rs similarity index 96% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/record.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/dvr/record.rs index 51e4619f37..7f5fb1dc4b 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/record.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/dvr/record.rs @@ -15,7 +15,6 @@ use aws_smithy_runtime_api::client::orchestrator::HttpRequest; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; use aws_smithy_runtime_api::shared::IntoShared; use aws_smithy_types::body::SdkBody; -use http_body_04x::Body; use std::path::Path; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex, MutexGuard}; @@ -74,12 +73,12 @@ pub struct RecordingClient { pub(crate) inner: SharedHttpConnector, } -#[cfg(feature = "tls-rustls")] +#[cfg(feature = "legacy-tls-rustls")] impl RecordingClient { /// Construct a recording connection wrapping a default HTTPS implementation without any timeouts. pub fn https() -> Self { #[allow(deprecated)] - use crate::client::http::hyper_014::HyperConnector; + use crate::hyper_014::HyperConnector; Self { data: Default::default(), num_events: Arc::new(AtomicUsize::new(0)), @@ -132,13 +131,13 @@ fn record_body( direction: Direction, event_bus: Arc>>, ) -> JoinHandle<()> { - let (sender, output_body) = hyper_0_14::Body::channel(); - let real_body = std::mem::replace(body, SdkBody::from_body_0_4(output_body)); + let (sender, output_body) = crate::test_util::body::channel_body(); + let real_body = std::mem::replace(body, output_body); tokio::spawn(async move { let mut real_body = real_body; let mut sender = sender; loop { - let data = real_body.data().await; + let data = crate::test_util::body::next_data_frame(&mut real_body).await; match data { Some(Ok(data)) => { event_bus.lock().unwrap().push(Event { diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/replay.rs b/rust-runtime/aws-smithy-http-client/src/test_util/dvr/replay.rs similarity index 92% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/replay.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/dvr/replay.rs index e4ad46494a..cca272a81c 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/replay.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/dvr/replay.rs @@ -4,7 +4,7 @@ */ use super::{Action, ConnectionId, Direction, Event, NetworkTraffic}; -use crate::client::http::test_util::replay::DEFAULT_RELAXED_HEADERS; +use crate::test_util::replay::DEFAULT_RELAXED_HEADERS; use aws_smithy_protocol_test::MediaType; use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; use aws_smithy_runtime_api::client::http::{ @@ -55,9 +55,9 @@ impl Waitable { #[derive(Clone)] pub struct ReplayingClient { live_events: Arc>>>, - verifiable_events: Arc>>, + verifiable_events: Arc>>, num_events: Arc, - recorded_requests: Arc>>>>, + recorded_requests: Arc>>>>, } // Ideally, this would just derive Debug, but that makes the tests in aws-config think they found AWS secrets @@ -207,6 +207,7 @@ impl ReplayingClient { } /// Return all the recorded requests for further analysis + #[cfg(feature = "legacy-test-util")] pub async fn take_requests(self) -> Vec> { let mut recorded_requests = std::mem::take(self.recorded_requests.lock().unwrap().deref_mut()); @@ -220,7 +221,17 @@ impl ReplayingClient { .await, ) } - out + out.into_iter() + .map(|v1r| { + let mut builder = http_02x::Request::builder() + .uri(v1r.uri().to_string()) + .method(v1r.method().as_str()); + for (k, v) in v1r.headers().iter() { + builder = builder.header(k.as_str(), v.as_bytes()) + } + builder.body(v1r.into_body()).expect("valid conversion") + }) + .collect() } /// Build a replay connection from a JSON file @@ -253,7 +264,7 @@ impl ReplayingClient { let initial_request = events.iter().next().expect("must have one event"); let request = match &initial_request.action { Action::Request { request } => { - http_02x::Request::from(request).map(|_| Bytes::from(body)) + http_1x::Request::from(request).map(|_| Bytes::from(body)) } _ => panic!("invalid first event"), }; @@ -271,7 +282,7 @@ impl ReplayingClient { } } -async fn replay_body(events: VecDeque, mut sender: hyper_0_14::body::Sender) { +async fn replay_body(events: VecDeque, mut sender: crate::test_util::body::Sender) { for event in events { match event.action { Action::Request { .. } => panic!(), @@ -315,8 +326,6 @@ async fn replay_body(events: VecDeque, mut sender: hyper_0_14::body::Send impl HttpConnector for ReplayingClient { fn call(&self, mut request: HttpRequest) -> HttpConnectorFuture { - use http_body_04x::Body; - let event_id = self.next_id(); tracing::debug!("received event {}: {request:?}", event_id.0); let mut events = match self.live_events.lock().unwrap().remove(&event_id) { @@ -330,17 +339,17 @@ impl HttpConnector for ReplayingClient { }; let _initial_request = events.pop_front().unwrap(); - let (sender, response_body) = hyper_0_14::Body::channel(); - let body = SdkBody::from_body_0_4(response_body); + let (sender, body) = crate::test_util::body::channel_body(); let recording = self.recorded_requests.clone(); let recorded_request = tokio::spawn(async move { let mut data_read = vec![]; - while let Some(data) = request.body_mut().data().await { + while let Some(data) = crate::test_util::body::next_data_frame(request.body_mut()).await + { data_read .extend_from_slice(data.expect("in memory request should not fail").as_ref()) } request - .try_into_http02x() + .try_into_http1x() .unwrap() .map(|_body| Bytes::from(data_read)) }); @@ -366,7 +375,7 @@ impl HttpConnector for ReplayingClient { Action::Response { response: Ok(response), } => { - let mut builder = http_02x::Response::builder().status(response.status); + let mut builder = http_1x::Response::builder().status(response.status); for (name, values) in response.headers { for value in values { builder = builder.header(&name, &value); diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/infallible.rs b/rust-runtime/aws-smithy-http-client/src/test_util/infallible.rs similarity index 78% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/infallible.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/infallible.rs index 0a9b925bde..a978962c21 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/infallible.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/infallible.rs @@ -21,11 +21,12 @@ use std::sync::Arc; /// # Examples /// /// ```rust -/// use aws_smithy_runtime::client::http::test_util::infallible_client_fn; -/// let http_client = infallible_client_fn(|_req| http_02x::Response::builder().status(200).body("OK!").unwrap()); +/// # use http_1x as http; +/// use aws_smithy_http_client::test_util::infallible_client_fn; +/// let http_client = infallible_client_fn(|_req| http::Response::builder().status(200).body("OK!").unwrap()); /// ``` pub fn infallible_client_fn( - f: impl Fn(http_02x::Request) -> http_02x::Response + Send + Sync + 'static, + f: impl Fn(http_1x::Request) -> http_1x::Response + Send + Sync + 'static, ) -> SharedHttpClient where B: Into, @@ -37,7 +38,7 @@ where struct InfallibleClientFn { #[allow(clippy::type_complexity)] response: Arc< - dyn Fn(http_02x::Request) -> Result, ConnectorError> + dyn Fn(http_1x::Request) -> Result, ConnectorError> + Send + Sync, >, @@ -51,7 +52,7 @@ impl fmt::Debug for InfallibleClientFn { impl InfallibleClientFn { fn new>( - f: impl Fn(http_02x::Request) -> http_02x::Response + Send + Sync + 'static, + f: impl Fn(http_1x::Request) -> http_1x::Response + Send + Sync + 'static, ) -> Self { Self { response: Arc::new(move |request| Ok(f(request).map(|b| b.into()))), @@ -62,7 +63,7 @@ impl InfallibleClientFn { impl HttpConnector for InfallibleClientFn { fn call(&self, request: HttpRequest) -> HttpConnectorFuture { HttpConnectorFuture::ready( - (self.response)(request.try_into_http02x().unwrap()) + (self.response)(request.try_into_http1x().unwrap()) .map(|res| HttpResponse::try_from(res).unwrap()), ) } diff --git a/rust-runtime/aws-smithy-http-client/src/test_util/legacy_infallible.rs b/rust-runtime/aws-smithy-http-client/src/test_util/legacy_infallible.rs new file mode 100644 index 0000000000..a96488714e --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/test_util/legacy_infallible.rs @@ -0,0 +1,83 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; +use aws_smithy_runtime_api::client::http::{ + HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpClient, + SharedHttpConnector, +}; +use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse}; +use aws_smithy_runtime_api::client::result::ConnectorError; +use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; +use aws_smithy_runtime_api::shared::IntoShared; +use aws_smithy_types::body::SdkBody; +use std::fmt; +use std::sync::Arc; + +/// Create a [`SharedHttpClient`] from `Fn(http:Request) -> http::Response` +/// +/// # Examples +/// +/// ```rust +/// use aws_smithy_http_client::test_util::legacy_infallible::infallible_client_fn; +/// let http_client = infallible_client_fn(|_req| http_02x::Response::builder().status(200).body("OK!").unwrap()); +/// ``` +pub fn infallible_client_fn( + f: impl Fn(http_02x::Request) -> http_02x::Response + Send + Sync + 'static, +) -> SharedHttpClient +where + B: Into, +{ + InfallibleClientFn::new(f).into_shared() +} + +#[derive(Clone)] +struct InfallibleClientFn { + #[allow(clippy::type_complexity)] + response: Arc< + dyn Fn(http_02x::Request) -> Result, ConnectorError> + + Send + + Sync, + >, +} + +impl fmt::Debug for InfallibleClientFn { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("InfallibleClientFn").finish() + } +} + +impl InfallibleClientFn { + fn new>( + f: impl Fn(http_02x::Request) -> http_02x::Response + Send + Sync + 'static, + ) -> Self { + Self { + response: Arc::new(move |request| Ok(f(request).map(|b| b.into()))), + } + } +} + +impl HttpConnector for InfallibleClientFn { + fn call(&self, request: HttpRequest) -> HttpConnectorFuture { + HttpConnectorFuture::ready( + (self.response)(request.try_into_http02x().unwrap()) + .map(|res| HttpResponse::try_from(res).unwrap()), + ) + } +} + +impl HttpClient for InfallibleClientFn { + fn http_connector( + &self, + _: &HttpConnectorSettings, + _: &RuntimeComponents, + ) -> SharedHttpConnector { + self.clone().into_shared() + } + + fn connector_metadata(&self) -> Option { + Some(ConnectorMetadata::new("infallible-client", None)) + } +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/never.rs b/rust-runtime/aws-smithy-http-client/src/test_util/never.rs similarity index 57% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/never.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/never.rs index 69e5dd4879..fd1633da36 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/never.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/never.rs @@ -62,11 +62,11 @@ impl HttpClient for NeverClient { /// A TCP connector that never connects. // In the future, this can be available for multiple hyper version feature flags, with the impls gated between individual features -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(any(feature = "hyper-014", feature = "hyper-1"))] #[derive(Clone, Debug, Default)] pub struct NeverTcpConnector; -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(any(feature = "hyper-014", feature = "hyper-1"))] impl NeverTcpConnector { /// Creates a new `NeverTcpConnector`. pub fn new() -> Self { @@ -74,9 +74,9 @@ impl NeverTcpConnector { } } -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(feature = "hyper-014")] impl hyper_0_14::service::Service for NeverTcpConnector { - type Response = connection::NeverTcpConnection; + type Response = hyper_014_support::NeverTcpConnection; type Error = aws_smithy_runtime_api::box_error::BoxError; type Future = std::pin::Pin< Box> + Send + Sync>, @@ -97,8 +97,38 @@ impl hyper_0_14::service::Service for NeverTcpConnector { } } -#[cfg(feature = "connector-hyper-0-14-x")] -mod connection { +#[cfg(feature = "hyper-1")] +mod hyper1_support { + use super::NeverTcpConnector; + use aws_smithy_async::future::never::Never; + use aws_smithy_runtime_api::client::result::ConnectorError; + use http_1x::Uri; + use hyper_util::rt::TokioIo; + use std::future::Future; + use std::pin::Pin; + use std::task::{Context, Poll}; + use tokio::net::TcpStream; + + impl tower::Service for NeverTcpConnector { + type Response = TokioIo; + type Error = ConnectorError; + type Future = Pin> + Send>>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, _uri: Uri) -> Self::Future { + Box::pin(async move { + Never::new().await; + unreachable!() + }) + } + } +} + +#[cfg(feature = "hyper-014")] +mod hyper_014_support { use hyper_0_14::client::connect::{Connected, Connection}; use std::io::Error; use std::pin::Pin; @@ -145,32 +175,62 @@ mod connection { } } -#[cfg(all(test, feature = "connector-hyper-0-14-x"))] -#[tokio::test] -async fn never_tcp_connector_plugs_into_hyper_014() { - use crate::client::http::hyper_014::HyperClientBuilder; +#[cfg(test)] +mod test { + use super::NeverTcpConnector; use aws_smithy_async::rt::sleep::TokioSleep; use aws_smithy_async::time::SystemTimeSource; + use aws_smithy_runtime_api::client::http::{HttpClient, HttpConnector, HttpConnectorSettings}; + use aws_smithy_runtime_api::client::orchestrator::HttpRequest; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; use std::time::Duration; - // it should compile - let client = HyperClientBuilder::new().build(NeverTcpConnector::new()); - let components = RuntimeComponentsBuilder::for_tests() - .with_sleep_impl(Some(TokioSleep::new())) - .with_time_source(Some(SystemTimeSource::new())) - .build() - .unwrap(); - let http_connector = client.http_connector( - &HttpConnectorSettings::builder() - .connect_timeout(Duration::from_millis(100)) - .build(), - &components, - ); - - let err = http_connector - .call(HttpRequest::get("http://fakeuri.com").unwrap()) - .await - .expect_err("it should time out"); - assert!(dbg!(err).is_timeout()); + #[cfg(feature = "hyper-014")] + #[tokio::test] + async fn never_tcp_connector_plugs_into_hyper_014() { + use crate::hyper_014::HyperClientBuilder; + + // it should compile + let client = HyperClientBuilder::new().build(NeverTcpConnector::new()); + let components = RuntimeComponentsBuilder::for_tests() + .with_sleep_impl(Some(TokioSleep::new())) + .with_time_source(Some(SystemTimeSource::new())) + .build() + .unwrap(); + let http_connector = client.http_connector( + &HttpConnectorSettings::builder() + .connect_timeout(Duration::from_millis(100)) + .build(), + &components, + ); + + let err = http_connector + .call(HttpRequest::get("http://fakeuri.com").unwrap()) + .await + .expect_err("it should time out"); + assert!(dbg!(err).is_timeout()); + } + + #[cfg(feature = "hyper-1")] + #[tokio::test] + async fn never_tcp_connector_plugs_into_hyper_1() { + let client = crate::hyper_1::build_with_fn(None, NeverTcpConnector::new); + let components = RuntimeComponentsBuilder::for_tests() + .with_sleep_impl(Some(TokioSleep::new())) + .with_time_source(Some(SystemTimeSource::new())) + .build() + .unwrap(); + let http_connector = client.http_connector( + &HttpConnectorSettings::builder() + .connect_timeout(Duration::from_millis(100)) + .build(), + &components, + ); + + let err = http_connector + .call(HttpRequest::get("http://fakeuri.com").unwrap()) + .await + .expect_err("it should time out"); + assert!(dbg!(err).is_timeout()); + } } diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/replay.rs b/rust-runtime/aws-smithy-http-client/src/test_util/replay.rs similarity index 95% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/replay.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/replay.rs index adbd5aa5bf..9d90a2d874 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/replay.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/replay.rs @@ -12,7 +12,7 @@ use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse}; use aws_smithy_runtime_api::client::result::ConnectorError; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; use aws_smithy_runtime_api::shared::IntoShared; -use http_02x::header::CONTENT_TYPE; +use http_1x::header::CONTENT_TYPE; use std::ops::Deref; use std::sync::{Arc, Mutex, MutexGuard}; @@ -119,7 +119,8 @@ impl ValidateRequest { /// # Example /// /// ```no_run -/// use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +/// # use http_1x as http; +/// use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; /// use aws_smithy_types::body::SdkBody; /// /// let http_client = StaticReplayClient::new(vec![ @@ -127,9 +128,9 @@ impl ValidateRequest { /// ReplayEvent::new( /// // If `assert_requests_match` is called later, then this request will be matched /// // against the actual request that was made. -/// http_02x::Request::builder().uri("http://localhost:1234/foo").body(SdkBody::empty()).unwrap(), +/// http::Request::builder().uri("http://localhost:1234/foo").body(SdkBody::empty()).unwrap(), /// // This response will be given to the first request regardless of whether it matches the request above. -/// http_02x::Response::builder().status(200).body(SdkBody::empty()).unwrap(), +/// http::Response::builder().status(200).body(SdkBody::empty()).unwrap(), /// ), /// // The next ReplayEvent covers the second request/response pair... /// ]); @@ -148,7 +149,7 @@ impl ValidateRequest { /// ``` /// /// [`assert_requests_match`]: StaticReplayClient::assert_requests_match -/// [DVR]: crate::client::http::test_util::dvr +/// [DVR]: crate::test_util::dvr #[derive(Clone, Debug)] pub struct StaticReplayClient { data: Arc>, @@ -281,17 +282,17 @@ impl HttpClient for StaticReplayClient { #[cfg(test)] mod test { - use crate::client::http::test_util::{ReplayEvent, StaticReplayClient}; + use crate::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; #[test] fn create_from_either_http_type() { let _client = StaticReplayClient::new(vec![ReplayEvent::new( - http1::Request::builder() + http_1x::Request::builder() .uri("test") .body(SdkBody::from("hello")) .unwrap(), - http1::Response::builder() + http_1x::Response::builder() .status(200) .body(SdkBody::from("hello")) .unwrap(), diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/wire.rs b/rust-runtime/aws-smithy-http-client/src/test_util/wire.rs similarity index 53% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/wire.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/wire.rs index 11415a494a..fc0108f381 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/wire.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/wire.rs @@ -12,8 +12,8 @@ //! # Examples //! ```no_run //! use aws_smithy_runtime_api::client::http::HttpConnectorSettings; -//! use aws_smithy_runtime::client::http::test_util::wire::{check_matches, ReplayedEvent, WireMockServer}; -//! use aws_smithy_runtime::{match_events, ev}; +//! use aws_smithy_http_client::test_util::wire::{check_matches, ReplayedEvent, WireMockServer}; +//! use aws_smithy_http_client::{match_events, ev}; //! # async fn example() { //! //! // This connection binds to a local address @@ -39,23 +39,24 @@ #![allow(missing_docs)] -#[allow(deprecated)] -use crate::client::http::hyper_014::HyperClientBuilder; use aws_smithy_async::future::never::Never; use aws_smithy_async::future::BoxFuture; use aws_smithy_runtime_api::client::http::SharedHttpClient; use bytes::Bytes; -use hyper_0_14::client::connect::dns::Name; -use hyper_0_14::server::conn::AddrStream; -use hyper_0_14::service::{make_service_fn, service_fn, Service}; +use http_body_util::Full; +use hyper::service::service_fn; +use hyper_util::client::legacy::connect::dns::Name; +use hyper_util::rt::{TokioExecutor, TokioIo}; +use hyper_util::server::graceful::{GracefulConnection, GracefulShutdown}; use std::collections::HashSet; use std::convert::Infallible; use std::error::Error; +use std::future::Future; use std::iter::Once; -use std::net::{SocketAddr, TcpListener}; +use std::net::SocketAddr; use std::sync::{Arc, Mutex}; use std::task::{Context, Poll}; -use tokio::spawn; +use tokio::net::TcpListener; use tokio::sync::oneshot; /// An event recorded by [`WireMockServer`]. @@ -97,19 +98,14 @@ pub fn check_matches(events: &[RecordedEvent], matchers: &[Matcher]) { macro_rules! matcher { ($expect:tt) => { ( - Box::new( - |event: &$crate::client::http::test_util::wire::RecordedEvent| { - if !matches!(event, $expect) { - return Err(format!( - "expected `{}` but got {:?}", - stringify!($expect), - event - ) - .into()); - } - Ok(()) - }, - ), + Box::new(|event: &$crate::test_util::wire::RecordedEvent| { + if !matches!(event, $expect) { + return Err( + format!("expected `{}` but got {:?}", stringify!($expect), event).into(), + ); + } + Ok(()) + }), stringify!($expect), ) }; @@ -120,7 +116,7 @@ macro_rules! matcher { macro_rules! match_events { ($( $expect:pat),*) => { |events| { - $crate::client::http::test_util::wire::check_matches(events, &[$( $crate::matcher!($expect) ),*]); + $crate::test_util::wire::check_matches(events, &[$( $crate::matcher!($expect) ),*]); } }; } @@ -129,27 +125,26 @@ macro_rules! match_events { #[macro_export] macro_rules! ev { (http($status:expr)) => { - $crate::client::http::test_util::wire::RecordedEvent::Response( - $crate::client::http::test_util::wire::ReplayedEvent::HttpResponse { + $crate::test_util::wire::RecordedEvent::Response( + $crate::test_util::wire::ReplayedEvent::HttpResponse { status: $status, .. }, ) }; (dns) => { - $crate::client::http::test_util::wire::RecordedEvent::DnsLookup(_) + $crate::test_util::wire::RecordedEvent::DnsLookup(_) }; (connect) => { - $crate::client::http::test_util::wire::RecordedEvent::NewConnection + $crate::test_util::wire::RecordedEvent::NewConnection }; (timeout) => { - $crate::client::http::test_util::wire::RecordedEvent::Response( - $crate::client::http::test_util::wire::ReplayedEvent::Timeout, + $crate::test_util::wire::RecordedEvent::Response( + $crate::test_util::wire::ReplayedEvent::Timeout, ) }; } -use aws_smithy_runtime_api::shared::IntoShared; pub use {ev, match_events, matcher}; #[non_exhaustive] @@ -184,7 +179,7 @@ impl ReplayedEvent { /// Test server that binds to 127.0.0.1:0 /// -/// See the [module docs](crate::client::http::test_util::wire) for a usage example. +/// See the [module docs](crate::test_util::wire) for a usage example. /// /// Usage: /// - Call [`WireMockServer::start`] to start the server @@ -199,11 +194,40 @@ pub struct WireMockServer { shutdown_hook: oneshot::Sender<()>, } +#[derive(Debug, Clone)] +struct SharedGraceful { + graceful: Arc>>, +} + +impl SharedGraceful { + fn new() -> Self { + Self { + graceful: Arc::new(Mutex::new(Some(GracefulShutdown::new()))), + } + } + + fn watch(&self, conn: C) -> impl Future { + let graceful = self.graceful.lock().unwrap(); + graceful + .as_ref() + .expect("graceful not shutdown") + .watch(conn) + } + + async fn shutdown(&self) { + let graceful = { self.graceful.lock().unwrap().take() }; + + if let Some(graceful) = graceful { + graceful.shutdown().await; + } + } +} + impl WireMockServer { /// Start a wire mock server with the given events to replay. pub async fn start(mut response_events: Vec) -> Self { - let listener = TcpListener::bind("127.0.0.1:0").unwrap(); - let (tx, rx) = oneshot::channel(); + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let (tx, mut rx) = oneshot::channel(); let listener_addr = listener.local_addr().unwrap(); response_events.reverse(); let response_events = Arc::new(Mutex::new(response_events)); @@ -211,48 +235,74 @@ impl WireMockServer { let wire_events = Arc::new(Mutex::new(vec![])); let wire_log_for_service = wire_events.clone(); let poisoned_conns: Arc>> = Default::default(); - let make_service = make_service_fn(move |connection: &AddrStream| { + let graceful = SharedGraceful::new(); + let conn_builder = Arc::new(hyper_util::server::conn::auto::Builder::new( + TokioExecutor::new(), + )); + + let server = async move { let poisoned_conns = poisoned_conns.clone(); let events = handler_events.clone(); let wire_log = wire_log_for_service.clone(); - let remote_addr = connection.remote_addr(); - tracing::info!("established connection: {:?}", connection); - wire_log.lock().unwrap().push(RecordedEvent::NewConnection); - async move { - Ok::<_, Infallible>(service_fn(move |_: http_02x::Request| { - if poisoned_conns.lock().unwrap().contains(&remote_addr) { - tracing::error!("poisoned connection {:?} was reused!", &remote_addr); - panic!("poisoned connection was reused!"); - } - let next_event = events.clone().lock().unwrap().pop(); - let wire_log = wire_log.clone(); - let poisoned_conns = poisoned_conns.clone(); - async move { - let next_event = next_event - .unwrap_or_else(|| panic!("no more events! Log: {:?}", wire_log)); - wire_log - .lock() - .unwrap() - .push(RecordedEvent::Response(next_event.clone())); - if next_event == ReplayedEvent::Timeout { - tracing::info!("{} is poisoned", remote_addr); - poisoned_conns.lock().unwrap().insert(remote_addr); - } - tracing::debug!("replying with {:?}", next_event); - let event = generate_response_event(next_event).await; - dbg!(event) + loop { + tokio::select! { + Ok((stream, remote_addr)) = listener.accept() => { + tracing::info!("established connection: {:?}", remote_addr); + let poisoned_conns = poisoned_conns.clone(); + let events = events.clone(); + let wire_log = wire_log.clone(); + wire_log.lock().unwrap().push(RecordedEvent::NewConnection); + let io = TokioIo::new(stream); + + let svc = service_fn(move |_req| { + let poisoned_conns = poisoned_conns.clone(); + let events = events.clone(); + let wire_log = wire_log.clone(); + if poisoned_conns.lock().unwrap().contains(&remote_addr) { + tracing::error!("poisoned connection {:?} was reused!", &remote_addr); + panic!("poisoned connection was reused!"); + } + let next_event = events.clone().lock().unwrap().pop(); + async move { + let next_event = next_event + .unwrap_or_else(|| panic!("no more events! Log: {:?}", wire_log)); + + wire_log + .lock() + .unwrap() + .push(RecordedEvent::Response(next_event.clone())); + + if next_event == ReplayedEvent::Timeout { + tracing::info!("{} is poisoned", remote_addr); + poisoned_conns.lock().unwrap().insert(remote_addr); + } + tracing::debug!("replying with {:?}", next_event); + let event = generate_response_event(next_event).await; + dbg!(event) + } + }); + + let conn_builder = conn_builder.clone(); + let graceful = graceful.clone(); + tokio::spawn(async move { + let conn = conn_builder.serve_connection(io, svc); + let fut = graceful.watch(conn); + if let Err(e) = fut.await { + panic!("Error serving connection: {:?}", e); + } + }); + }, + _ = &mut rx => { + tracing::info!("wire server: shutdown signalled"); + graceful.shutdown().await; + tracing::info!("wire server: shutdown complete!"); + break; } - })) + } } - }); - let server = hyper_0_14::Server::from_tcp(listener) - .unwrap() - .serve(make_service) - .with_graceful_shutdown(async { - rx.await.ok(); - tracing::info!("server shutdown!"); - }); - spawn(server); + }; + + tokio::spawn(server); Self { event_log: wire_events, bind_addr: listener_addr, @@ -272,22 +322,22 @@ impl WireMockServer { pub fn dns_resolver(&self) -> LoggingDnsResolver { let event_log = self.event_log.clone(); let bind_addr = self.bind_addr; - LoggingDnsResolver { + LoggingDnsResolver(InnerDnsResolver { log: event_log, socket_addr: bind_addr, - } + }) } /// Prebuilt [`HttpClient`](aws_smithy_runtime_api::client::http::HttpClient) with correctly wired DNS resolver. /// /// **Note**: This must be used in tandem with [`Self::dns_resolver`] pub fn http_client(&self) -> SharedHttpClient { - #[allow(deprecated)] - HyperClientBuilder::new() - .build(hyper_0_14::client::HttpConnector::new_with_resolver( - self.dns_resolver(), - )) - .into_shared() + let resolver = self.dns_resolver(); + crate::hyper_1::build_with_fn(None, move || { + hyper_util::client::legacy::connect::HttpConnector::new_with_resolver( + resolver.clone().0, + ) + }) } /// Endpoint to use when connecting @@ -308,11 +358,11 @@ impl WireMockServer { async fn generate_response_event( event: ReplayedEvent, -) -> Result, Infallible> { +) -> Result>, Infallible> { let resp = match event { - ReplayedEvent::HttpResponse { status, body } => http_02x::Response::builder() + ReplayedEvent::HttpResponse { status, body } => http_1x::Response::builder() .status(status) - .body(hyper_0_14::Body::from(body)) + .body(Full::new(body)) .unwrap(), ReplayedEvent::Timeout => { Never::new().await; @@ -326,12 +376,16 @@ async fn generate_response_event( /// /// Regardless of what hostname is requested, it will always return the same socket address. #[derive(Clone, Debug)] -pub struct LoggingDnsResolver { +pub struct LoggingDnsResolver(InnerDnsResolver); + +// internal implementation so we don't have to expose hyper_util +#[derive(Clone, Debug)] +struct InnerDnsResolver { log: Arc>>, socket_addr: SocketAddr, } -impl Service for LoggingDnsResolver { +impl tower::Service for InnerDnsResolver { type Response = Once; type Error = Infallible; type Future = BoxFuture<'static, Self::Response, Self::Error>; @@ -352,3 +406,20 @@ impl Service for LoggingDnsResolver { }) } } + +#[cfg(any(feature = "legacy-test-util", feature = "hyper-014"))] +impl hyper_0_14::service::Service for LoggingDnsResolver { + type Response = Once; + type Error = Infallible; + type Future = BoxFuture<'static, Self::Response, Self::Error>; + + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + self.0.poll_ready(cx) + } + + fn call(&mut self, req: hyper_0_14::client::connect::dns::Name) -> Self::Future { + use std::str::FromStr; + let adapter = Name::from_str(req.as_str()).expect("valid conversion"); + self.0.call(adapter) + } +} diff --git a/rust-runtime/aws-smithy-runtime/test-data/example.com.json b/rust-runtime/aws-smithy-http-client/test-data/example.com.json similarity index 100% rename from rust-runtime/aws-smithy-runtime/test-data/example.com.json rename to rust-runtime/aws-smithy-http-client/test-data/example.com.json diff --git a/rust-runtime/aws-smithy-runtime/Cargo.toml b/rust-runtime/aws-smithy-runtime/Cargo.toml index 6a8d8e6f2e..125a2edf2a 100644 --- a/rust-runtime/aws-smithy-runtime/Cargo.toml +++ b/rust-runtime/aws-smithy-runtime/Cargo.toml @@ -19,20 +19,17 @@ rt-tokio = ["tokio/rt"] # Features for testing test-util = [ "aws-smithy-runtime-api/test-util", - "dep:aws-smithy-protocol-test", "dep:tracing-subscriber", - "dep:serde", - "dep:serde_json", - "dep:indexmap", - # for now we need hyper-0-14 explicitly still as it's used internally - "dep:hyper-0-14" + "connector-hyper-0-14-x", + "aws-smithy-http-client/test-util", + "aws-smithy-http-client/legacy-test-util", ] -wire-mock = ["test-util", "connector-hyper-0-14-x", "hyper-0-14?/server"] + +wire-mock = ["test-util", "aws-smithy-http-client/wire-mock"] [dependencies] aws-smithy-async = { path = "../aws-smithy-async" } aws-smithy-http = { path = "../aws-smithy-http" } -aws-smithy-protocol-test = { path = "../aws-smithy-protocol-test", optional = true } aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api" } aws-smithy-types = { path = "../aws-smithy-types", features = ["http-body-0-4-x"] } aws-smithy-http-client = { path = "../aws-smithy-http-client", optional = true } @@ -45,14 +42,9 @@ http-body-04x = { package = "http-body", version = "0.4.4" } http-body-1x = { package = "http-body", version = "1" } # This avoids bringing `httparse` 1.9.0 and 1.9.1 through `hyper-0-14` that break unit tests of runtime crates httparse = "1.8.0" -hyper-0-14 = { package = "hyper", version = "0.14.26", default-features = false, optional = true } -hyper-rustls = { version = "0.24", features = ["rustls-native-certs", "http2"], optional = true } once_cell = "1.18.0" pin-project-lite = "0.2.7" pin-utils = "0.1.0" -serde = { version = "1", features = ["derive"], optional = true } -serde_json = { version = "1", features = ["preserve_order"], optional = true } -indexmap = { version = "2", optional = true, features = ["serde"] } tokio = { version = "1.25", features = [] } tracing = "0.1.37" tracing-subscriber = { version = "0.3.16", optional = true, features = ["env-filter", "fmt", "json"] } @@ -70,6 +62,7 @@ pretty_assertions = "1.4.0" tokio = { version = "1.25", features = ["macros", "rt", "rt-multi-thread", "test-util", "full"] } tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } tracing-test = "0.2.1" +# FIXME - migrate to hyper-1 hyper_0_14 = { package = "hyper", version = "0.14.27", features = ["client", "server", "tcp", "http1", "http2"] } http1 = { package = "http", version = "1" } diff --git a/rust-runtime/aws-smithy-runtime/external-types.toml b/rust-runtime/aws-smithy-runtime/external-types.toml index 57a363ab6b..c2da47280b 100644 --- a/rust-runtime/aws-smithy-runtime/external-types.toml +++ b/rust-runtime/aws-smithy-runtime/external-types.toml @@ -24,6 +24,10 @@ allowed_external_types = [ "tokio::io::async_read::AsyncRead", "tokio::io::async_write::AsyncWrite", "aws_smithy_http_client::hyper_014", + "aws_smithy_http_client::test_util::*", + "aws_smithy_http_client::ev", + "aws_smithy_http_client::match_events", + "aws_smithy_http_client::matcher", # TODO(https://github.com/smithy-lang/smithy-rs/issues/1193): Once tooling permits it, only allow the following types in the `http-0-x` feature "http_body::Body" diff --git a/rust-runtime/aws-smithy-runtime/src/client/http.rs b/rust-runtime/aws-smithy-runtime/src/client/http.rs index 8c1be0b48c..2e8068413c 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/http.rs @@ -6,8 +6,38 @@ /// Interceptor for connection poisoning. pub mod connection_poisoning; +#[deprecated = "Direct HTTP test utility support from `aws-smithy-runtime` crate is deprecated. Please use the `test-util` feature from `aws-smithy-http-client` instead"] #[cfg(feature = "test-util")] -pub mod test_util; +pub mod test_util { + #![allow(missing_docs)] + + pub use aws_smithy_http_client::test_util::{ + legacy_capture_request as capture_request, CaptureRequestHandler, CaptureRequestReceiver, + }; + + #[cfg(feature = "connector-hyper-0-14-x")] + pub mod dvr { + pub use aws_smithy_http_client::test_util::dvr::*; + } + + pub use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; + + pub use aws_smithy_http_client::test_util::legacy_infallible::infallible_client_fn; + + pub use aws_smithy_http_client::test_util::NeverClient; + + #[cfg(feature = "connector-hyper-0-14-x")] + pub use aws_smithy_http_client::test_util::NeverTcpConnector; + + #[cfg(all(feature = "connector-hyper-0-14-x", feature = "wire-mock"))] + #[macro_use] + pub mod wire { + pub use aws_smithy_http_client::test_util::wire::ev; + pub use aws_smithy_http_client::test_util::wire::match_events; + pub use aws_smithy_http_client::test_util::wire::matcher; + pub use aws_smithy_http_client::test_util::wire::*; + } +} /// Default HTTP and TLS connectors that use hyper 0.14.x and rustls. /// diff --git a/rust-runtime/aws-smithy-runtime/src/lib.rs b/rust-runtime/aws-smithy-runtime/src/lib.rs index 36dcd854ec..dd17c5bc77 100644 --- a/rust-runtime/aws-smithy-runtime/src/lib.rs +++ b/rust-runtime/aws-smithy-runtime/src/lib.rs @@ -34,3 +34,11 @@ pub mod static_partition_map; /// General testing utilities. #[cfg(feature = "test-util")] pub mod test_util; + +// legacy test-util, re-export of macros +#[cfg(feature = "wire-mock")] +pub use aws_smithy_http_client::test_util::wire::ev; +#[cfg(feature = "wire-mock")] +pub use aws_smithy_http_client::test_util::wire::match_events; +#[cfg(feature = "wire-mock")] +pub use aws_smithy_http_client::test_util::wire::matcher; diff --git a/tools/ci-build/sdk-lints/src/lint_cargo_toml.rs b/tools/ci-build/sdk-lints/src/lint_cargo_toml.rs index 5f9b6385e1..2ea376b420 100644 --- a/tools/ci-build/sdk-lints/src/lint_cargo_toml.rs +++ b/tools/ci-build/sdk-lints/src/lint_cargo_toml.rs @@ -375,9 +375,10 @@ impl StableCratesExposeStableCrates { }) // TODO(tooling): When tooling allows, specify this at the crate level. These // are gated by the hyper-014 feature and carryover from relocating hyper-014.x - // support from aws-smithy-runtime + // support from aws-smithy-runtime. hyper_util is only exposed as part of test_util trait impl .filter(|tpe| { - !(name == "aws-smithy-http-client" && ["tower_service"].contains(&tpe.as_str())) + !(name == "aws-smithy-http-client" + && ["tower_service", "serde", "hyper_util"].contains(&tpe.as_str())) }) .map(|crte| { LintError::new(format!(