From f6f1a06c6f01c504175bb46f88fe3ad1e5b302bb Mon Sep 17 00:00:00 2001 From: Richard Kelly Date: Thu, 9 Jun 2022 18:45:00 +0000 Subject: [PATCH] Update tough to use aws sdk rust Update tough-kms to use aws sdk rust Update tough-ssm to use aws-sdk-rust Update tuftool to AWS SDK Rust --- Cargo.lock | 1343 +++++++++++++++++++-------------- deny.toml | 15 +- tough-kms/Cargo.toml | 19 +- tough-kms/src/client.rs | 55 +- tough-kms/src/error.rs | 37 +- tough-kms/src/lib.rs | 46 +- tough-kms/tests/all_test.rs | 191 +---- tough-kms/tests/test_utils.rs | 77 ++ tough-ssm/Cargo.toml | 15 +- tough-ssm/src/client.rs | 58 +- tough-ssm/src/error.rs | 34 +- tough-ssm/src/lib.rs | 30 +- tuftool/Cargo.toml | 17 +- tuftool/src/source.rs | 4 +- 14 files changed, 1037 insertions(+), 904 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad630179..703704dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,6 +35,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "assert-json-diff" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4259cbe96513d2f1073027a259fc2ca917feb3026a5a8d984e3628e490255cc0" +dependencies = [ + "extend", + "serde", + "serde_json", +] + [[package]] name = "assert_cmd" version = "2.0.4" @@ -49,17 +60,6 @@ dependencies = [ "wait-timeout", ] -[[package]] -name = "async-trait" -version = "0.1.52" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "atty" version = "0.2.14" @@ -73,15 +73,338 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "aws-config" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11a8c971b0cb0484fc9436a291a44503b95141edc36ce7a6af6b6d7a06a02ab0" +dependencies = [ + "aws-http", + "aws-sdk-sso", + "aws-sdk-sts", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "hex", + "http", + "hyper", + "ring", + "tokio", + "tower", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-endpoint" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bc956f415dda77215372e5bc751a2463d1f9a1ec34edf3edc6c0ff67e5c8e43" +dependencies = [ + "aws-smithy-http", + "aws-types", + "http", + "regex", + "tracing", +] + +[[package]] +name = "aws-http" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a0d98a1d606aa24554e604f220878db4aa3b525b72f88798524497cc3867fc6" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "http-body", + "lazy_static", + "percent-encoding", + "pin-project-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-kms" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fee45083be6f062676aaeab0fe16c931a4e188d2ddce6f2c8d17399c014dc81" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "tokio-stream", + "tower", +] + +[[package]] +name = "aws-sdk-ssm" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d41b62dcea814079c2f6540c465b6d45210b20a4e30efdcd24cc5dcf4aec" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand", + "http", + "tokio-stream", + "tower", +] + +[[package]] +name = "aws-sdk-sso" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa0c66fab12976065403cf4cafacffe76afa91d0da335d195af379d4223d235" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "tokio-stream", + "tower", +] + +[[package]] +name = "aws-sdk-sts" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048037cdfd7f42fb29b5f969c7f639b4b7eac00e8f911e4eac4f89fb7b3a0500" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-query", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes", + "http", + "tower", +] + +[[package]] +name = "aws-sig-auth" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8386fc0d218dbf2011f65bd8300d21ba98603fd150b962f61239be8b02d1fc6" +dependencies = [ + "aws-sigv4", + "aws-smithy-http", + "aws-types", + "http", + "tracing", +] + +[[package]] +name = "aws-sigv4" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd866926c2c4978210bcb01d7d1b431c794f0c23ca9ee1e420204b018836b5fb" +dependencies = [ + "aws-smithy-http", + "form_urlencoded", + "hex", + "http", + "once_cell", + "percent-encoding", + "regex", + "ring", + "time 0.3.11", + "tracing", +] + +[[package]] +name = "aws-smithy-async" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb59cfdd21143006c01b9ca4dc4a9190b8c50c2ef831f9eb36f54f69efa42f1" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", + "tokio-stream", +] + +[[package]] +name = "aws-smithy-client" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44243329ba8618474c3b7f396de281f175ae172dd515b3d35648671a3cf51871" +dependencies = [ + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-protocol-test", + "aws-smithy-types", + "bytes", + "fastrand", + "http", + "http-body", + "hyper", + "hyper-rustls", + "hyper-tls", + "lazy_static", + "pin-project-lite", + "serde", + "tokio", + "tower", + "tracing", +] + +[[package]] +name = "aws-smithy-http" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba78f69a5bbe7ac1826389304c67b789032d813574e78f9a2d450634277f833" +dependencies = [ + "aws-smithy-types", + "bytes", + "bytes-utils", + "futures-core", + "http", + "http-body", + "hyper", + "once_cell", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "aws-smithy-http-tower" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff8a512d68350561e901626baa08af9491cfbd54596201b84b4da846a59e4da3" +dependencies = [ + "aws-smithy-http", + "bytes", + "http", + "http-body", + "pin-project-lite", + "tower", + "tracing", +] + +[[package]] +name = "aws-smithy-json" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b7633698853aae80bd8b26866531420138eca91ea4620735d20b0537c93c2e" +dependencies = [ + "aws-smithy-types", +] + +[[package]] +name = "aws-smithy-protocol-test" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9cfb5fdf0ce8040aa55860852b83ba3d48f5679bb3a003078c900d98fbc22d" +dependencies = [ + "assert-json-diff", + "http", + "pretty_assertions", + "regex", + "roxmltree", + "serde_json", + "thiserror", +] + +[[package]] +name = "aws-smithy-query" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a94b5a8cc94a85ccbff89eb7bc80dc135ede02847a73d68c04ac2a3e4cf6b7" +dependencies = [ + "aws-smithy-types", + "urlencoding", +] + +[[package]] +name = "aws-smithy-types" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d230d281653de22fb0e9c7c74d18d724a39d7148e2165b1e760060064c4967c0" +dependencies = [ + "itoa", + "num-integer", + "ryu", + "time 0.3.11", +] + +[[package]] +name = "aws-smithy-xml" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aacaf6c0fa549ebe5d9daa96233b8635965721367ee7c69effc8d8078842df3" +dependencies = [ + "xmlparser", +] + +[[package]] +name = "aws-types" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb54f097516352475a0159c9355f8b4737c54044538a4d9aca4d376ef2361ccc" +dependencies = [ + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-types", + "http", + "rustc_version", + "tracing", + "zeroize", +] [[package]] name = "backtrace" -version = "0.3.63" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", @@ -104,15 +427,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - [[package]] name = "bstr" version = "0.2.17" @@ -126,21 +440,31 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "bytes" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" + +[[package]] +name = "bytes-utils" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1934a3ef9cac8efde4966a92781e77713e1ba329f1d42e446c7d7eba340d8ef1" +dependencies = [ + "bytes", + "either", +] [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -158,7 +482,7 @@ dependencies = [ "num-integer", "num-traits", "serde", - "time 0.1.43", + "time 0.1.44", "winapi", ] @@ -179,9 +503,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -193,29 +517,11 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "cpufeatures" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossbeam-channel" -version = "0.5.2" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -223,9 +529,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -234,72 +540,58 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.6" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" dependencies = [ + "autocfg", "cfg-if", "crossbeam-utils", - "lazy_static", "memoffset", + "once_cell", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ "cfg-if", - "lazy_static", + "once_cell", ] [[package]] -name = "crypto-mac" -version = "0.11.1" +name = "ct-logs" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" dependencies = [ - "generic-array", - "subtle", + "sct", ] [[package]] -name = "difflib" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" - -[[package]] -name = "digest" -version = "0.9.0" +name = "ctor" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ - "generic-array", + "quote", + "syn", ] [[package]] -name = "dirs-next" -version = "2.0.0" +name = "diff" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "difflib" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] name = "doc-comment" @@ -309,30 +601,42 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dyn-clone" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140206b78fb2bc3edbcfc9b5ccbd0b30699cfe8d348b8b31b330e47df5291a5a" +checksum = "9d07a982d1fb29db01e5a59b1918e03da4df7297eaeee7686ac45542fd4e59c8" [[package]] name = "either" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" [[package]] name = "encoding_rs" -version = "0.8.30" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ "cfg-if", ] +[[package]] +name = "extend" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47da3a72ec598d9c8937a7ebca8962a5c7a1f28444e38c2b33c771ba3f55f05" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "fastrand" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] @@ -370,13 +674,12 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", - "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -385,9 +688,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -395,32 +698,21 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" - -[[package]] -name = "futures-executor" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-io" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-macro" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", @@ -429,21 +721,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures-channel", "futures-core", @@ -457,32 +749,11 @@ dependencies = [ "slab", ] -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "gimli" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" [[package]] name = "globset" @@ -499,9 +770,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f1f717ddc7b2ba36df7e871fd88db79326551d3d6f1fc406fbfd28b582ff8e" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" dependencies = [ "bytes", "fnv", @@ -518,9 +789,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" @@ -558,32 +829,22 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest", -] - [[package]] name = "http" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.1", + "itoa", ] [[package]] name = "http-body" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", @@ -592,9 +853,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.5.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" [[package]] name = "httpdate" @@ -626,9 +887,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.16" +version = "0.14.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ec3e62bdc98a2f0393a5048e4c30ef659440ea6e0e572965103e72bd836f55" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" dependencies = [ "bytes", "futures-channel", @@ -639,7 +900,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 0.4.8", + "itoa", "pin-project-lite", "socket2", "tokio", @@ -650,17 +911,19 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" dependencies = [ - "http", + "ct-logs", + "futures-util", "hyper", "log", "rustls", "rustls-native-certs", "tokio", "tokio-rustls", + "webpki", ] [[package]] @@ -689,9 +952,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", @@ -708,9 +971,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" +checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "itertools" @@ -723,21 +986,15 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "js-sys" -version = "0.3.56" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" dependencies = [ "wasm-bindgen", ] @@ -750,15 +1007,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.114" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0005d08a8f7b65fb8073cb697aa0b12b631ed251ce73d862ce50eeb52ce3b50" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", ] @@ -775,22 +1032,11 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" -[[package]] -name = "md-5" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" -dependencies = [ - "block-buffer", - "digest", - "opaque-debug", -] - [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" @@ -809,41 +1055,30 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" dependencies = [ "adler", - "autocfg", ] [[package]] name = "mio" -version = "0.7.14" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "miow", - "ntapi", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", ] [[package]] name = "native-tls" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" dependencies = [ "lazy_static", "libc", @@ -857,20 +1092,11 @@ dependencies = [ "tempfile", ] -[[package]] -name = "ntapi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi", -] - [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -878,9 +1104,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", ] @@ -897,18 +1123,18 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ "libc", ] [[package]] name = "object" -version = "0.27.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "memchr", ] @@ -924,30 +1150,36 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "openssl" -version = "0.10.38" +version = "0.10.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" +checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" dependencies = [ "bitflags", "cfg-if", "foreign-types", "libc", "once_cell", + "openssl-macros", "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.5" @@ -956,9 +1188,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.72" +version = "0.9.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" +checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" dependencies = [ "autocfg", "cc", @@ -967,6 +1199,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "output_vt100" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" +dependencies = [ + "winapi", +] + [[package]] name = "path-absolutize" version = "3.0.13" @@ -978,18 +1219,18 @@ dependencies = [ [[package]] name = "path-dedot" -version = "3.0.14" +version = "3.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bfa72956f6be8524f7f7e2b07972dda393cb0008a6df4451f658b7e1bd1af80" +checksum = "d611d5291372b3738a34ebf0d1f849e58b1dcc1101032f76a346eaa1f8ddbb5b" dependencies = [ "once_cell", ] [[package]] name = "pem" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9a3b09a20e374558580a4914d3b7d89bd61b954a5a5e1dcbea98753addb1947" +checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" dependencies = [ "base64", ] @@ -1000,11 +1241,31 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pin-project" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1014,9 +1275,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "predicates" @@ -1045,6 +1306,18 @@ dependencies = [ "termtree", ] +[[package]] +name = "pretty_assertions" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89f989ac94207d048d92db058e4f6ec7342b0971fc58d1271ca148b799b3563" +dependencies = [ + "ansi_term", + "ctor", + "diff", + "output_vt100", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1071,18 +1344,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.15" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] @@ -1101,9 +1374,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1113,28 +1386,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" dependencies = [ "bitflags", ] -[[package]] -name = "redox_users" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" -dependencies = [ - "getrandom", - "redox_syscall", -] - [[package]] name = "regex" -version = "1.5.6" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -1149,9 +1412,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.26" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "remove_dir_all" @@ -1164,9 +1427,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.9" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" +checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" dependencies = [ "base64", "bytes", @@ -1191,6 +1454,7 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-native-tls", + "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -1214,116 +1478,12 @@ dependencies = [ ] [[package]] -name = "rusoto_core" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db30db44ea73551326269adcf7a2169428a054f14faf9e1768f2163494f2fa2" -dependencies = [ - "async-trait", - "base64", - "bytes", - "crc32fast", - "futures", - "http", - "hyper", - "hyper-rustls", - "hyper-tls", - "lazy_static", - "log", - "rusoto_credential", - "rusoto_signature", - "rustc_version", - "serde", - "serde_json", - "tokio", - "xml-rs", -] - -[[package]] -name = "rusoto_credential" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee0a6c13db5aad6047b6a44ef023dbbc21a056b6dab5be3b79ce4283d5c02d05" -dependencies = [ - "async-trait", - "chrono", - "dirs-next", - "futures", - "hyper", - "serde", - "serde_json", - "shlex", - "tokio", - "zeroize", -] - -[[package]] -name = "rusoto_kms" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e1fc19cfcfd9f6b2f96e36d5b0dddda9004d2cbfc2d17543e3b9f10cc38fce8" -dependencies = [ - "async-trait", - "bytes", - "futures", - "rusoto_core", - "serde", - "serde_json", -] - -[[package]] -name = "rusoto_mock" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a384880f3c6d514e9499e6df75490bef5f6f39237bc24844e3933dfc09e9e55" -dependencies = [ - "async-trait", - "chrono", - "futures", - "http", - "rusoto_core", - "serde", - "serde_json", -] - -[[package]] -name = "rusoto_signature" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ae95491c8b4847931e291b151127eccd6ff8ca13f33603eb3d0035ecb05272" -dependencies = [ - "base64", - "bytes", - "chrono", - "digest", - "futures", - "hex", - "hmac", - "http", - "hyper", - "log", - "md-5", - "percent-encoding", - "pin-project-lite", - "rusoto_credential", - "rustc_version", - "serde", - "sha2", - "tokio", -] - -[[package]] -name = "rusoto_ssm" -version = "0.48.0" +name = "roxmltree" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "166034bb4835e1e6a7ac1cc659c9798e751cd75d7244f37beeaa12f2bbdda30b" +checksum = "921904a62e410e37e215c40381b7117f830d9d89ba60ab5236170541dd25646b" dependencies = [ - "async-trait", - "bytes", - "futures", - "rusoto_core", - "serde", - "serde_json", + "xmlparser", ] [[package]] @@ -1343,10 +1503,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.4" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ + "base64", "log", "ring", "sct", @@ -1355,30 +1516,21 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" -dependencies = [ - "base64", -] - [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] name = "same-file" @@ -1391,12 +1543,12 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "winapi", + "windows-sys", ] [[package]] @@ -1407,9 +1559,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.7.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ "ring", "untrusted", @@ -1417,9 +1569,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09d3c15d814eda1d6a836f2f2b56a6abc1446c8a34351cb3180d3db92ffe4ce" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ "bitflags", "core-foundation", @@ -1430,9 +1582,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90dd10c41c6bfc633da6e0c659bd25d31e0791e5974ac42970267d59eba87f7" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -1440,24 +1592,24 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.4" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" [[package]] name = "serde" -version = "1.0.136" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" dependencies = [ "proc-macro2", "quote", @@ -1466,11 +1618,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.78" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ - "itoa 1.0.1", + "itoa", "ryu", "serde", ] @@ -1491,39 +1643,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.1", + "itoa", "ryu", "serde", ] -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer", - "cfg-if", - "cpufeatures", - "digest", - "opaque-debug", -] - -[[package]] -name = "shlex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - [[package]] name = "simplelog" version = "0.12.0" @@ -1532,14 +1656,17 @@ checksum = "48dfff04aade74dd495b007c831cd6f4e0cee19c344dd9dc0884c0289b70a786" dependencies = [ "log", "termcolor", - "time 0.3.9", + "time 0.3.11", ] [[package]] name = "slab" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] name = "snafu" @@ -1566,9 +1693,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f82496b90c36d70af5fcd482edaa2e0bd16fade569de1330405fecbbdac736b" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi", @@ -1610,21 +1737,15 @@ dependencies = [ "syn", ] -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - [[package]] name = "syn" -version = "1.0.86" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1643,9 +1764,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] @@ -1665,23 +1786,44 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] [[package]] name = "time" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" dependencies = [ - "itoa 1.0.1", + "itoa", "libc", "num_threads", "time-macros", @@ -1695,9 +1837,9 @@ checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -1710,11 +1852,10 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.8.4" +version = "1.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dae83881bc9b0403dd5b44ea9deed3e939856cc8722d5be37f0d6e5c6d53dd" +checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" dependencies = [ - "autocfg", "bytes", "libc", "memchr", @@ -1722,16 +1863,16 @@ dependencies = [ "num_cpus", "once_cell", "pin-project-lite", - "signal-hook-registry", + "socket2", "tokio-macros", "winapi", ] [[package]] name = "tokio-macros" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", @@ -1750,27 +1891,38 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls", "tokio", "webpki", ] +[[package]] +name = "tokio-stream" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" dependencies = [ "bytes", "futures-core", "futures-sink", - "log", "pin-project-lite", "tokio", + "tracing", ] [[package]] @@ -1805,14 +1957,15 @@ dependencies = [ name = "tough-kms" version = "0.3.6" dependencies = [ + "aws-config", + "aws-sdk-kms", + "aws-smithy-client", + "aws-smithy-http", "base64", "bytes", + "http", "pem", "ring", - "rusoto_core", - "rusoto_credential", - "rusoto_kms", - "rusoto_mock", "serde", "serde_json", "snafu", @@ -1824,9 +1977,8 @@ dependencies = [ name = "tough-ssm" version = "0.6.6" dependencies = [ - "rusoto_core", - "rusoto_credential", - "rusoto_ssm", + "aws-config", + "aws-sdk-ssm", "serde", "serde_json", "snafu", @@ -1835,29 +1987,64 @@ dependencies = [ ] [[package]] -name = "tower-service" +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.29" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" dependencies = [ "cfg-if", + "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tracing-core" -version = "0.1.21" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -1871,6 +2058,9 @@ name = "tuftool" version = "0.7.2" dependencies = [ "assert_cmd", + "aws-config", + "aws-sdk-kms", + "aws-sdk-ssm", "chrono", "hex", "httptest", @@ -1881,10 +2071,6 @@ dependencies = [ "rayon", "reqwest", "ring", - "rusoto_core", - "rusoto_credential", - "rusoto_kms", - "rusoto_ssm", "serde", "serde_json", "simplelog", @@ -1900,31 +2086,31 @@ dependencies = [ ] [[package]] -name = "typenum" -version = "1.15.0" +name = "unicode-bidi" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] -name = "unicode-bidi" -version = "0.3.7" +name = "unicode-ident" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" @@ -1932,12 +2118,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "untrusted" version = "0.7.1" @@ -1956,6 +2136,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "urlencoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b90931029ab9b034b300b797048cf23723400aa757e8a2bfb9d748102f9821" + [[package]] name = "vcpkg" version = "0.2.15" @@ -2006,15 +2192,21 @@ dependencies = [ [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.79" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2022,13 +2214,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.79" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -2037,9 +2229,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.29" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" +checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" dependencies = [ "cfg-if", "js-sys", @@ -2049,9 +2241,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.79" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2059,9 +2251,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.79" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ "proc-macro2", "quote", @@ -2072,15 +2264,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.79" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" [[package]] name = "web-sys" -version = "0.3.56" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" dependencies = [ "js-sys", "wasm-bindgen", @@ -2088,9 +2280,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ "ring", "untrusted", @@ -2127,23 +2319,66 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "winreg" -version = "0.7.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi", ] [[package]] -name = "xml-rs" -version = "0.8.4" +name = "xmlparser" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" +checksum = "114ba2b24d2167ef6d67d7d04c8cc86522b87f490025f39f0303b7db5bf5e3d8" [[package]] name = "zeroize" -version = "1.5.0" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc222aec311c323c717f56060324f32b82da1ce1dd81d9a09aa6a9030bfe08db" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" diff --git a/deny.toml b/deny.toml index 26153896..f93175ba 100644 --- a/deny.toml +++ b/deny.toml @@ -22,6 +22,10 @@ allow = [ "Zlib" ] +exceptions = [ + { name = "unicode-ident", version = "1.0.2", allow = ["MIT", "Apache-2.0", "Unicode-DFS-2016"] }, +] + # https://github.com/hsivonen/encoding_rs The non-test code that isn't generated from the WHATWG data in this crate is # under Apache-2.0 OR MIT. Test code is under CC0. [[licenses.clarify]] @@ -54,10 +58,13 @@ multiple-versions = "deny" wildcards = "deny" skip-tree = [ - # rusoto_signature uses an older version of itoa - { name = "rusoto_signature" }, - # structopt-derive uses and older verision of heck - { name = "structopt-derive" }, + { name = "h2", version = "0.3.11" }, + # aws sdk depends on hyper, which pulls in an older version of itoa + { name = "hyper", version = "0.14.16" }, + # chrono pulls in an older version of time + { name = "chrono", version = "0.4.19" }, + # structopt is using an older heck + { name = "heck", version="0.3.3"}, ] [sources] diff --git a/tough-kms/Cargo.toml b/tough-kms/Cargo.toml index 5e307771..91ef4f09 100644 --- a/tough-kms/Cargo.toml +++ b/tough-kms/Cargo.toml @@ -9,24 +9,25 @@ keywords = ["TUF", "KMS"] edition = "2018" [features] -default = ["rusoto"] -rusoto = ["rusoto-rustls"] -rusoto-native-tls = ["rusoto_core/native-tls", "rusoto_credential", "rusoto_kms/native-tls"] -rusoto-rustls = ["rusoto_core/rustls", "rusoto_credential", "rusoto_kms/rustls"] +default = ["aws-sdk-rust"] +aws-sdk-rust = ["aws-sdk-rust-rustls"] +aws-sdk-rust-tls = ["aws-config/native-tls", "aws-sdk-kms/native-tls"] +aws-sdk-rust-rustls = ["aws-config/rustls", "aws-sdk-kms/rustls"] [dependencies] tough = { version = "0.12.2", path = "../tough", features = ["http"] } ring = { version = "0.16.16", features = ["std"] } -rusoto_core = { version = "0.48", optional = true, default-features = false } -rusoto_credential = { version = "0.48", optional = true } -rusoto_kms = { version = "0.48", optional = true, default-features = false } +aws-sdk-kms = "0.16.0" +aws-config = "0.46.0" snafu = { version = "0.7", features = ["backtraces-impl-backtrace-crate"] } -tokio = "1.8" +tokio = { version = "1", features = ["fs", "io-util", "time", "macros", "rt-multi-thread"] } pem = "1.0.2" [dev-dependencies] +aws-smithy-client = {version = "0.46.0", features = ["test-util"]} +aws-smithy-http = "0.46.0" base64 = "0.13" bytes = "1" -rusoto_mock = { version = "0.48", default-features = false } +http = "0.2" serde = "1.0.125" serde_json = "1.0.63" diff --git a/tough-kms/src/client.rs b/tough-kms/src/client.rs index 29b88e60..38950af1 100644 --- a/tough-kms/src/client.rs +++ b/tough-kms/src/client.rs @@ -2,32 +2,43 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 use crate::error::{self, Result}; -use rusoto_core::{HttpClient, Region}; -use rusoto_credential::ProfileProvider; -use rusoto_kms::KmsClient; +use aws_sdk_kms::Client as KmsClient; use snafu::ResultExt; -use std::str::FromStr; +use std::thread; /// Builds a KMS client for a given profile name. pub(crate) fn build_client_kms(profile: Option<&str>) -> Result { - Ok(if let Some(profile) = profile { - let mut provider = ProfileProvider::new().context(error::RusotoCredsSnafu)?; - provider.set_profile(profile); - let region = provider - .region_from_profile() - .context(error::RusotoRegionFromProfileSnafu { profile })?; + // We are cloning this so that we can send it across a thread boundary + let profile = profile.map(std::borrow::ToOwned::to_owned); + // We need to spin up a new thread to deal with the async nature of the + // AWS SDK Rust + let client: Result = thread::spawn(move || { + let runtime = tokio::runtime::Runtime::new().context(error::RuntimeCreationSnafu)?; + Ok(runtime.block_on(async_build_client_kms(profile))) + }) + .join() + .map_err(|_| error::Error::ThreadJoin {})?; + client +} - KmsClient::new_with( - HttpClient::new().context(error::RusotoTlsSnafu)?, - provider, - match region { - Some(region) => { - Region::from_str(®ion).context(error::RusotoRegionSnafu { region })? - } - None => Region::default(), - }, - ) +async fn async_build_client_kms(profile: Option) -> KmsClient { + let config = aws_config::from_env(); + let client_config = if let Some(profile) = profile { + config + .region( + aws_config::profile::ProfileFileRegionProvider::builder() + .profile_name(&profile) + .build(), + ) + .credentials_provider( + aws_config::profile::ProfileFileCredentialsProvider::builder() + .profile_name(&profile) + .build(), + ) + .load() + .await } else { - KmsClient::new(Region::default()) - }) + config.load().await + }; + KmsClient::new(&client_config) } diff --git a/tough-kms/src/error.rs b/tough-kms/src/error.rs index 60f2f6f3..dee1f7ce 100644 --- a/tough-kms/src/error.rs +++ b/tough-kms/src/error.rs @@ -16,42 +16,15 @@ pub type Result = std::result::Result; #[non_exhaustive] #[allow(missing_docs)] pub enum Error { - /// The library failed to authenticate Aws account. - #[snafu(display("Error creating AWS credentials provider: {}", source))] - RusotoCreds { - source: rusoto_credential::CredentialsError, - backtrace: Backtrace, - }, - - /// The library failed to get the region for the given profile. - #[snafu(display("Unable to determine region from profile '{}': {}", profile, source))] - RusotoRegionFromProfile { - profile: String, - source: rusoto_credential::CredentialsError, - backtrace: Backtrace, - }, - - /// The library failed to identify the region obtained from the given profile. - #[snafu(display("Unknown AWS region '{}': {}", region, source))] - RusotoRegion { - region: String, - source: rusoto_core::region::ParseRegionError, - backtrace: Backtrace, - }, - - /// The library failed to instantiate 'HttpClient'. - #[snafu(display("Error creating AWS request dispatcher: {}", source))] - RusotoTls { - source: rusoto_core::request::TlsError, - backtrace: Backtrace, - }, - /// The library failed to instantiate 'tokio Runtime'. #[snafu(display("Unable to create tokio runtime: {}", source))] RuntimeCreation { source: std::io::Error, backtrace: Backtrace, }, + /// The library failed to join 'tokio Runtime'. + #[snafu(display("Unable to join tokio thread used to offload async workloads"))] + ThreadJoin, /// The library failed to get public key from AWS KMS #[snafu(display( @@ -63,7 +36,7 @@ pub enum Error { KmsGetPublicKey { profile: Option, key_id: String, - source: rusoto_core::RusotoError, + source: aws_sdk_kms::types::SdkError, backtrace: Backtrace, }, @@ -80,7 +53,7 @@ pub enum Error { KmsSignMessage { key_id: String, profile: Option, - source: rusoto_core::RusotoError, + source: aws_sdk_kms::types::SdkError, backtrace: Backtrace, }, diff --git a/tough-kms/src/lib.rs b/tough-kms/src/lib.rs index dbe9d795..df35e118 100644 --- a/tough-kms/src/lib.rs +++ b/tough-kms/src/lib.rs @@ -22,9 +22,10 @@ mod client; pub mod error; +use aws_sdk_kms::types::Blob; +use aws_sdk_kms::Client as KmsClient; use ring::digest::{digest, SHA256}; use ring::rand::SecureRandom; -use rusoto_kms::{Kms, KmsClient, SignRequest}; use snafu::{ensure, OptionExt, ResultExt}; use std::collections::HashMap; use std::fmt; @@ -42,12 +43,14 @@ pub enum KmsSigningAlgorithm { } impl KmsSigningAlgorithm { - fn value(self) -> String { + fn value(self) -> aws_sdk_kms::model::SigningAlgorithmSpec { // Currently we are supporting only single algorithm, but code stub is added to support // multiple algorithms in future. - String::from(match self { - KmsSigningAlgorithm::RsassaPssSha256 => "RSASSA_PSS_SHA_256", - }) + match self { + KmsSigningAlgorithm::RsassaPssSha256 => { + aws_sdk_kms::model::SigningAlgorithmSpec::RsassaPssSha256 + } + } } } @@ -83,10 +86,10 @@ impl KeySource for KmsKeySource { None => client::build_client_kms(self.profile.as_deref())?, }; // Get the public key from AWS KMS - let fut = kms_client.get_public_key(rusoto_kms::GetPublicKeyRequest { - key_id: self.key_id.clone(), - ..rusoto_kms::GetPublicKeyRequest::default() - }); + let fut = kms_client + .get_public_key() + .key_id(self.key_id.clone()) + .send(); let response = tokio::runtime::Runtime::new() .context(error::RuntimeCreationSnafu)? .block_on(fut) @@ -100,7 +103,7 @@ impl KeySource for KmsKeySource { contents: response .public_key .context(error::PublicKeyNoneSnafu)? - .to_vec(), + .into_inner(), }, pem::EncodeConfig { line_ending: pem::LineEnding::LF, @@ -115,7 +118,7 @@ impl KeySource for KmsKeySource { ); Ok(Box::new(KmsRsaKey { profile: self.profile.clone(), - client: Some(kms_client.clone()), + client: Some(kms_client), key_id: self.key_id.clone(), public_key: key.parse().context(error::PublicKeyParseSnafu)?, signing_algorithm: self.signing_algorithm, @@ -123,7 +126,8 @@ impl KeySource for KmsKeySource { response .customer_master_key_spec .as_ref() - .context(error::MissingCustomerMasterKeySpecSnafu)?, + .context(error::MissingCustomerMasterKeySpecSnafu)? + .as_str(), )?, })) } @@ -185,13 +189,15 @@ impl Sign for KmsRsaKey { Some(value) => value, None => client::build_client_kms(self.profile.as_deref())?, }; - let sign_fut = kms_client.sign(SignRequest { - key_id: self.key_id.clone(), - message: digest(&SHA256, msg).as_ref().to_vec().into(), - message_type: Some(String::from("DIGEST")), - signing_algorithm: self.signing_algorithm.value(), - ..rusoto_kms::SignRequest::default() - }); + let blob = Blob::new(digest(&SHA256, msg).as_ref().to_vec()); + let sign_fut = kms_client + .sign() + .key_id(self.key_id.clone()) + .message(blob) + .message_type(aws_sdk_kms::model::MessageType::Digest) + .signing_algorithm(self.signing_algorithm.value()) + .send(); + let response = tokio::runtime::Runtime::new() .context(error::RuntimeCreationSnafu)? .block_on(sign_fut) @@ -202,7 +208,7 @@ impl Sign for KmsRsaKey { let signature = response .signature .context(error::SignatureNotFoundSnafu)? - .to_vec(); + .into_inner(); // sometimes KMS produces a signature that is shorter than the modulus. in those cases, // we have observed that openssl and KMS will both validate the signature, but ring will diff --git a/tough-kms/tests/all_test.rs b/tough-kms/tests/all_test.rs index ade71ef3..24eedbb0 100644 --- a/tough-kms/tests/all_test.rs +++ b/tough-kms/tests/all_test.rs @@ -1,12 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT OR Apache-2.0 mod test_utils; -use rusoto_kms::KmsClient; -extern crate rusoto_mock; -use self::rusoto_mock::*; use ring::rand::SystemRandom; -use rusoto_core::signature::SignedRequest; -use rusoto_core::{HttpDispatchError, Region}; use serde::{Deserialize, Deserializer}; use std::fs::File; use std::io::BufReader; @@ -62,23 +57,12 @@ fn check_tuf_key_success() { .unwrap(); let reader = BufReader::new(file); let expected_key: Key = serde_json::from_reader(reader).unwrap(); - let mock = MockRequestDispatcher::default() - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.GetPublicKey"))); - }) - .with_body( - MockResponseReader::read_response(test_utils::test_data().to_str().unwrap(), input) - .as_ref(), - ); - let mock_client = KmsClient::new_with(mock, MockCredentialsProvider, Region::UsEast1); + + let client = test_utils::mock_client(vec![input]); let kms_key = KmsKeySource { profile: None, key_id, - client: Some(mock_client), + client: Some(client), signing_algorithm: RsassaPssSha256, }; let sign = kms_key.as_sign().unwrap(); @@ -99,46 +83,14 @@ fn check_sign_success() { .unwrap(), ) .unwrap(); + let client = test_utils::mock_client(vec![resp_public_key, resp_signature]); let reader = BufReader::new(file); let expected_json: SignResp = serde_json::from_reader(reader).unwrap(); let expected_signature = expected_json.signature.to_vec(); - let mock = MultipleMockRequestDispatcher::new(vec![ - MockRequestDispatcher::with_status(200) - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.GetPublicKey"))); - }) - .with_body( - MockResponseReader::read_response( - test_utils::test_data().to_str().unwrap(), - resp_public_key, - ) - .as_ref(), - ), - MockRequestDispatcher::with_status(200) - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.Sign"))); - }) - .with_body( - MockResponseReader::read_response( - test_utils::test_data().to_str().unwrap(), - resp_signature, - ) - .as_ref(), - ), - ]); - let mock_client = KmsClient::new_with(mock, MockCredentialsProvider, Region::UsEast1); let kms_key = KmsKeySource { profile: None, key_id: String::from("alias/some_alias"), - client: Some(mock_client), + client: Some(client), signing_algorithm: RsassaPssSha256, }; let rng = SystemRandom::new(); @@ -152,10 +104,7 @@ fn check_sign_success() { #[test] // Ensure call to tuf_key fails when public key is not available fn check_public_key_failure() { - let error_msg = String::from("Some error message from KMS"); - let mock = - MockRequestDispatcher::with_dispatch_error(HttpDispatchError::new(error_msg.clone())); - let client = KmsClient::new_with(mock, MockCredentialsProvider, Region::UsEast1); + let client = test_utils::mock_client_with_status(501); let key_id = String::from("alias/some_alias"); let kms_key = KmsKeySource { profile: None, @@ -165,38 +114,18 @@ fn check_public_key_failure() { }; let result = kms_key.as_sign(); assert!(result.is_err()); - let err = result.err().unwrap(); - assert_eq!( - format!( - "Failed to get public key for aws-kms:///{} : {}", - key_id, error_msg - ), - err.to_string() - ); } #[test] // Ensure call to as_sign fails when signing algorithms are missing in get_public_key response fn check_public_key_missing_algo() { let input = "response_public_key_no_algo.json"; + let client = test_utils::mock_client(vec![input]); let key_id = String::from("alias/some_alias"); - let mock = MockRequestDispatcher::default() - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.GetPublicKey"))); - }) - .with_body( - MockResponseReader::read_response(test_utils::test_data().to_str().unwrap(), input) - .as_ref(), - ); - let mock_client = KmsClient::new_with(mock, MockCredentialsProvider, Region::UsEast1); let kms_key = KmsKeySource { profile: None, key_id, - client: Some(mock_client), + client: Some(client), signing_algorithm: RsassaPssSha256, }; let err = kms_key.as_sign().err().unwrap(); @@ -213,23 +142,11 @@ fn check_public_key_missing_algo() { fn check_public_key_unmatch_algo() { let input = "response_public_key_unmatch_algo.json"; let key_id = String::from("alias/some_alias"); - let mock = MockRequestDispatcher::default() - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.GetPublicKey"))); - }) - .with_body( - MockResponseReader::read_response(test_utils::test_data().to_str().unwrap(), input) - .as_ref(), - ); - let mock_client = KmsClient::new_with(mock, MockCredentialsProvider, Region::UsEast1); + let client = test_utils::mock_client(vec![input]); let kms_key = KmsKeySource { profile: None, key_id, - client: Some(mock_client), + client: Some(client), signing_algorithm: RsassaPssSha256, }; let err = kms_key.as_sign().err().unwrap(); @@ -239,101 +156,17 @@ fn check_public_key_unmatch_algo() { ); } -#[test] -// Ensure sign error when Kms fails to sign message. -fn check_sign_request_failure() { - let error_msg = String::from("Some error message from KMS"); - let resp_public_key = "response_public_key.json"; - let key_id = String::from("alias/some_alias"); - let mock = MultipleMockRequestDispatcher::new(vec![ - MockRequestDispatcher::with_status(200) - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.GetPublicKey"))); - }) - .with_body( - MockResponseReader::read_response( - test_utils::test_data().to_str().unwrap(), - resp_public_key, - ) - .as_ref(), - ), - MockRequestDispatcher::with_dispatch_error(HttpDispatchError::new(error_msg.clone())) - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.Sign"))); - }), - ]); - let mock_client = KmsClient::new_with(mock, MockCredentialsProvider, Region::UsEast1); - let kms_key = KmsKeySource { - profile: None, - key_id: key_id.clone(), - client: Some(mock_client), - signing_algorithm: RsassaPssSha256, - }; - let rng = SystemRandom::new(); - let kms_sign = kms_key.as_sign().unwrap(); - let result = kms_sign.sign("Some message to sign".as_bytes(), &rng); - assert!(result.is_err()); - let err = result.err().unwrap(); - assert_eq!( - format!( - "Error while signing message for aws-kms:///{} : {}", - key_id, error_msg - ), - err.to_string() - ); -} - #[test] // Ensure sign error when Kms returns empty signature. fn check_signature_failure() { let resp_public_key = "response_public_key.json"; let resp_signature = "response_signature_empty.json"; let key_id = String::from("alias/some_alias"); - let mock = MultipleMockRequestDispatcher::new(vec![ - MockRequestDispatcher::with_status(200) - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.GetPublicKey"))); - }) - .with_body( - MockResponseReader::read_response( - test_utils::test_data().to_str().unwrap(), - resp_public_key, - ) - .as_ref(), - ), - MockRequestDispatcher::with_status(200) - .with_request_checker(|request: &SignedRequest| { - assert!(request - .headers - .get("x-amz-target") - .unwrap() - .contains(&Vec::from("TrentService.Sign"))); - }) - .with_body( - MockResponseReader::read_response( - test_utils::test_data().to_str().unwrap(), - resp_signature, - ) - .as_ref(), - ), - ]); - let mock_client = KmsClient::new_with(mock, MockCredentialsProvider, Region::UsEast1); + let client = test_utils::mock_client(vec![resp_public_key, resp_signature]); let kms_key = KmsKeySource { profile: None, key_id, - client: Some(mock_client), + client: Some(client), signing_algorithm: RsassaPssSha256, }; let rng = SystemRandom::new(); diff --git a/tough-kms/tests/test_utils.rs b/tough-kms/tests/test_utils.rs index f4c6d47c..39aab583 100644 --- a/tough-kms/tests/test_utils.rs +++ b/tough-kms/tests/test_utils.rs @@ -1,6 +1,10 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT OR Apache-2.0 +use aws_sdk_kms::{Client, Config, Credentials}; +use aws_smithy_client::erase::DynConnector; +use aws_smithy_client::test_connection::TestConnection; +use aws_smithy_http::body::SdkBody; use std::path::PathBuf; /// Returns the path to our test data directory @@ -9,3 +13,76 @@ pub fn test_data() -> PathBuf { p.pop(); p.join("tough-kms").join("tests").join("data") } + +pub fn mock_client(data_files: Vec<&str>) -> Client { + let creds = Credentials::new( + "ATESTCLIENT", + "atestsecretkey", + Some("atestsessiontoken".to_string()), + None, + "", + ); + + let conf = Config::builder() + .credentials_provider(creds) + .region(aws_sdk_kms::Region::new("us-east-1")) + .build(); + // Get a vec of events based on the given data_files + let events = data_files + .iter() + .map(|d| { + let path = std::path::Path::new("tests/data").join(d); + let data = std::fs::read_to_string(path).unwrap(); + + // Events + ( + // Request + http::Request::builder() + .body(SdkBody::from("request body")) + .unwrap(), + // Response + http::Response::builder() + .status(200) + .body(SdkBody::from(data)) + .unwrap(), + ) + }) + .collect(); + + let conn = TestConnection::new(events); + let conn = DynConnector::new(conn); + aws_sdk_kms::Client::from_conf_conn(conf, conn) +} + +// Create a mock client that returns a specific status code and empty +// response body. +pub fn mock_client_with_status(status: u16) -> Client { + let creds = Credentials::new( + "ATESTCLIENT", + "atestsecretkey", + Some("atestsessiontoken".to_string()), + None, + "", + ); + + let conf = aws_sdk_kms::Config::builder() + .credentials_provider(creds) + .region(aws_sdk_kms::Region::new("us-east-1")) + .build(); + + let events = vec![( + // Request + http::Request::builder() + .body(SdkBody::from("request body")) + .unwrap(), + // Response + http::Response::builder() + .status(status) + .body("response body") + .unwrap(), + )]; + + let conn = TestConnection::new(events); + let conn = DynConnector::new(conn); + aws_sdk_kms::Client::from_conf_conn(conf, conn) +} diff --git a/tough-ssm/Cargo.toml b/tough-ssm/Cargo.toml index f0b58fc7..5c75c95c 100644 --- a/tough-ssm/Cargo.toml +++ b/tough-ssm/Cargo.toml @@ -9,17 +9,16 @@ keywords = ["TUF", "SSM"] edition = "2018" [features] -default = ["rusoto"] -rusoto = ["rusoto-rustls"] -rusoto-native-tls = ["rusoto_core/native-tls", "rusoto_credential", "rusoto_ssm/native-tls"] -rusoto-rustls = ["rusoto_core/rustls", "rusoto_credential", "rusoto_ssm/rustls"] +default = ["aws-sdk-rust"] +aws-sdk-rust = ["aws-sdk-rust-rustls"] +aws-sdk-rust-tls = ["aws-config/native-tls", "aws-sdk-ssm/native-tls"] +aws-sdk-rust-rustls = ["aws-config/rustls", "aws-sdk-ssm/rustls"] [dependencies] tough = { version = "0.12.2", path = "../tough", features = ["http"] } -rusoto_core = { version = "0.48", optional = true, default-features = false } -rusoto_credential = { version = "0.48", optional = true } -rusoto_ssm = { version = "0.48", optional = true, default-features = false } +aws-sdk-ssm = "0.16.0" +aws-config = "0.46.0" serde = "1.0.125" serde_json = "1.0.63" snafu = { version = "0.7", features = ["backtraces-impl-backtrace-crate"] } -tokio = "1.8" +tokio = { version = "1", features = ["fs", "io-util", "time", "macros", "rt-multi-thread"] } diff --git a/tough-ssm/src/client.rs b/tough-ssm/src/client.rs index c92d4fe4..e402bd0c 100644 --- a/tough-ssm/src/client.rs +++ b/tough-ssm/src/client.rs @@ -1,33 +1,45 @@ // Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT OR Apache-2.0 -use crate::error::{self, Result}; -use rusoto_core::{HttpClient, Region}; -use rusoto_credential::ProfileProvider; -use rusoto_ssm::SsmClient; +use aws_sdk_ssm::Client as SsmClient; use snafu::ResultExt; -use std::str::FromStr; +use std::thread; + +use crate::error::{self, Result}; /// Builds an SSM client for a given profile name. pub(crate) fn build_client(profile: Option<&str>) -> Result { - Ok(if let Some(profile) = profile { - let mut provider = ProfileProvider::new().context(error::RusotoCredsSnafu)?; - provider.set_profile(profile); - let region = provider - .region_from_profile() - .context(error::RusotoRegionFromProfileSnafu { profile })?; + // We are cloning this so that we can send it across a thread boundary + let profile = profile.map(|s| s.to_owned()); + // We need to spin up a new thread to deal with the async nature of the + // AWS SDK Rust + let client: Result = thread::spawn(move || { + let runtime = tokio::runtime::Runtime::new().context(error::RuntimeCreationSnafu)?; + Ok(runtime.block_on(async_build_client(profile))) + }) + .join() + .map_err(|_| error::Error::ThreadJoin {})?; + client +} - SsmClient::new_with( - HttpClient::new().context(error::RusotoTlsSnafu)?, - provider, - match region { - Some(region) => { - Region::from_str(®ion).context(error::RusotoRegionSnafu { region })? - } - None => Region::default(), - }, - ) +async fn async_build_client(profile: Option) -> SsmClient { + let config = aws_config::from_env(); + let client_config = if let Some(profile) = profile { + config + .region( + aws_config::profile::ProfileFileRegionProvider::builder() + .profile_name(&profile) + .build(), + ) + .credentials_provider( + aws_config::profile::ProfileFileCredentialsProvider::builder() + .profile_name(profile) + .build(), + ) + .load() + .await } else { - SsmClient::new(Region::default()) - }) + config.load().await + }; + SsmClient::new(&client_config) } diff --git a/tough-ssm/src/error.rs b/tough-ssm/src/error.rs index 19049cad..bfcf4814 100644 --- a/tough-ssm/src/error.rs +++ b/tough-ssm/src/error.rs @@ -1,6 +1,7 @@ // Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT OR Apache-2.0 +use aws_sdk_ssm::error::{GetParameterError, PutParameterError}; use snafu::{Backtrace, Snafu}; pub type Result = std::result::Result; @@ -15,37 +16,14 @@ pub enum Error { backtrace: Backtrace, }, - #[snafu(display("Error creating AWS credentials provider: {}", source))] - RusotoCreds { - source: rusoto_credential::CredentialsError, - backtrace: Backtrace, - }, - - #[snafu(display("Unable to determine region from profile '{}': {}", profile, source))] - RusotoRegionFromProfile { - profile: String, - source: rusoto_credential::CredentialsError, - backtrace: Backtrace, - }, - - #[snafu(display("Unknown AWS region \"{}\": {}", region, source))] - RusotoRegion { - region: String, - source: rusoto_core::region::ParseRegionError, - backtrace: Backtrace, - }, - - #[snafu(display("Error creating AWS request dispatcher: {}", source))] - RusotoTls { - source: rusoto_core::request::TlsError, - backtrace: Backtrace, - }, - #[snafu(display("Unable to create tokio runtime: {}", source))] RuntimeCreation { source: std::io::Error, backtrace: Backtrace, }, + /// The library failed to join 'tokio Runtime'. + #[snafu(display("Unable to join tokio thread used to offload async workloads"))] + ThreadJoin, #[snafu(display( "Failed to get aws-ssm://{}{}: {}", @@ -56,7 +34,7 @@ pub enum Error { SsmGetParameter { profile: Option, parameter_name: String, - source: rusoto_core::RusotoError, + source: aws_sdk_ssm::types::SdkError, backtrace: Backtrace, }, @@ -80,7 +58,7 @@ pub enum Error { SsmPutParameter { profile: Option, parameter_name: String, - source: rusoto_core::RusotoError, + source: aws_sdk_ssm::types::SdkError, backtrace: Backtrace, }, } diff --git a/tough-ssm/src/lib.rs b/tough-ssm/src/lib.rs index 489bec59..7b1309b1 100644 --- a/tough-ssm/src/lib.rs +++ b/tough-ssm/src/lib.rs @@ -4,7 +4,6 @@ mod client; pub mod error; -use rusoto_ssm::Ssm; use snafu::{OptionExt, ResultExt}; use tough::key_source::KeySource; use tough::sign::{parse_keypair, Sign}; @@ -24,10 +23,11 @@ impl KeySource for SsmKeySource { ) -> std::result::Result, Box> { let ssm_client = client::build_client(self.profile.as_deref())?; - let fut = ssm_client.get_parameter(rusoto_ssm::GetParameterRequest { - name: self.parameter_name.to_owned(), - with_decryption: Some(true), - }); + let fut = ssm_client + .get_parameter() + .name(self.parameter_name.to_owned()) + .with_decryption(true) + .send(); let response = tokio::runtime::Runtime::new() .context(error::RuntimeCreationSnafu)? .block_on(fut) @@ -58,15 +58,17 @@ impl KeySource for SsmKeySource { key_id_hex: &str, ) -> std::result::Result<(), Box> { let ssm_client = client::build_client(self.profile.as_deref())?; - let fut = ssm_client.put_parameter(rusoto_ssm::PutParameterRequest { - name: self.parameter_name.to_owned(), - description: Some(key_id_hex.to_owned()), - key_id: self.key_id.as_ref().cloned(), - overwrite: Some(true), - type_: Some("SecureString".to_owned()), - value: value.to_owned(), - ..rusoto_ssm::PutParameterRequest::default() - }); + + let fut = ssm_client + .put_parameter() + .name(self.parameter_name.to_owned()) + .description(key_id_hex.to_owned()) + .set_key_id(self.key_id.as_ref().cloned()) + .overwrite(true) + .set_type(Some(aws_sdk_ssm::model::ParameterType::SecureString)) + .value(value.to_owned()) + .send(); + tokio::runtime::Runtime::new() .context(error::RuntimeCreationSnafu)? .block_on(fut) diff --git a/tuftool/Cargo.toml b/tuftool/Cargo.toml index 9e8db906..2de5c8b2 100644 --- a/tuftool/Cargo.toml +++ b/tuftool/Cargo.toml @@ -10,10 +10,10 @@ edition = "2018" [features] integ = [] -default = ["rusoto"] -rusoto = ["rusoto-rustls"] -rusoto-native-tls = ["rusoto_core/native-tls", "rusoto_credential", "rusoto_ssm/native-tls", "rusoto_kms/native-tls"] -rusoto-rustls = ["rusoto_core/rustls", "rusoto_credential", "rusoto_ssm/rustls", "rusoto_kms/rustls",] +default = ["aws-sdk-rust"] +aws-sdk-rust = ["aws-sdk-rust-rustls"] +aws-sdk-rust-native-tls = ["aws-config/native-tls", "aws-sdk-ssm/native-tls", "aws-sdk-kms/native-tls"] +aws-sdk-rust-rustls = ["aws-config/rustls", "aws-sdk-ssm/rustls", "aws-sdk-kms/rustls",] [dependencies] chrono = "0.4.11" @@ -24,18 +24,17 @@ olpc-cjson = { version = "0.1.0", path = "../olpc-cjson" } pem = "1.0.2" rayon = "1.5" reqwest = { version = "0.11.1", features = ["blocking"] } +aws-sdk-kms = "0.16.0" +aws-sdk-ssm = "0.16.0" +aws-config = "0.46.0" ring = { version = "0.16.16", features = ["std"] } -rusoto_core = { version = "0.48", optional = true, default-features = false } -rusoto_credential = { version = "0.48", optional = true } -rusoto_ssm = { version = "0.48", optional = true, default-features = false } -rusoto_kms = { version = "0.48", optional = true, default-features = false } serde = "1.0.125" serde_json = "1.0.63" simplelog = "0.12" snafu = { version = "0.7", features = ["backtraces-impl-backtrace-crate"] } structopt = "0.3" tempfile = "3.3.0" -tokio = "~1.8" # LTS +tokio = "~1.18" # LTS tough = { version = "0.12.2", path = "../tough", features = ["http"] } tough-ssm = { version = "0.6.6", path = "../tough-ssm" } tough-kms = { version = "0.3.6", path = "../tough-kms" } diff --git a/tuftool/src/source.rs b/tuftool/src/source.rs index 0c4fb182..1129c6b6 100644 --- a/tuftool/src/source.rs +++ b/tuftool/src/source.rs @@ -3,7 +3,7 @@ #![allow(clippy::doc_markdown)] //! Private keys are generally provided as paths, but may sometimes be provided as a URL. For -//! example, when one of the Rusoto features is enabled, you can use an aws-ssm:// special URL +//! example, when one of the AWS SDK Rust features is enabled, you can use an aws-ssm:// special URL //! to refer to a key accessible in SSM. (See below for more format examples) //! //! This module parses a key source command line parameter as a URL, relative to `file://$PWD`, @@ -61,7 +61,7 @@ pub(crate) fn parse_key_source(input: &str) -> Result> { "file" => Ok(Box::new(LocalKeySource { path: PathBuf::from(url.path()), })), - #[cfg(any(feature = "rusoto-native-tls", feature = "rusoto-rustls"))] + #[cfg(any(feature = "aws-sdk-rust-native-tls", feature = "aws-sdk-rust-rustls"))] "aws-ssm" => Ok(Box::new(SsmKeySource { profile: url.host_str().and_then(|s| { if s.is_empty() {