From c68fe646861459cdcb30db42c908f4e4716756cc Mon Sep 17 00:00:00 2001 From: stevelr Date: Fri, 24 Mar 2023 12:09:02 -0700 Subject: [PATCH] use call_actor callback for better reusability of library (#207) * use call_actor callback for better reusability of library Signed-off-by: stevelr * allow overflow settings Signed-off-by: stevelr * use latest codegen branch Signed-off-by: stevelr * fix unit test to handle content max, use latest wasmbus-rpc (draft pr) Signed-off-by: stevelr * use git rev for wasmcloud-test-util dependency Signed-off-by: stevelr * bump default max content len to 100MB and absolute max to 1GB Signed-off-by: stevelr * bump deps Signed-off-by: stevelr * use branch name in wasmbus-rpc dependency (still waiting on pr merge) Signed-off-by: stevelr * use smithy-bindgen and latest wasmcloud-test-util Signed-off-by: stevelr * Removed codegen.toml and build.rs in favor of smithy-bindgen * update deps Signed-off-by: stevelr * document max_content_len setting Signed-off-by: stevelr * enable tracing for call_actor Signed-off-by: stevelr * use released wasmcloud_util_test library Signed-off-by: stevelr * remove redundant async/await, add GH workflow for releasing library Signed-off-by: stevelr * remove c flag in nc command in 'make test' Signed-off-by: stevelr * start nats for tests Signed-off-by: stevelr --------- Signed-off-by: stevelr --- .github/workflows/httpserver-lib.yml | 62 ++ httpserver-rs/Cargo.lock | 1139 ++++++++++++++---------- httpserver-rs/Cargo.toml | 16 +- httpserver-rs/Makefile | 10 +- httpserver-rs/bin/main.rs | 78 +- httpserver-rs/settings.md | 17 +- httpserver-rs/src/lib.rs | 278 ++++-- httpserver-rs/src/settings.rs | 55 +- httpserver-rs/tests/httpserver_test.rs | 20 +- 9 files changed, 1041 insertions(+), 634 deletions(-) create mode 100644 .github/workflows/httpserver-lib.yml diff --git a/.github/workflows/httpserver-lib.yml b/.github/workflows/httpserver-lib.yml new file mode 100644 index 00000000..a6cc5241 --- /dev/null +++ b/.github/workflows/httpserver-lib.yml @@ -0,0 +1,62 @@ +name: HTTPSERVER_LIB + +on: + push: + branches: [main] + paths: + - "httpserver-rs/**" + tags: + - "wasmcloud-httpserver-provider-v*" + pull_request: + branches: [main] + paths: + - "httpserver-rs/**" + +env: + CARGO_TERM_COLOR: always + working-directory: ./httpserver-rs + +jobs: + rust_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Update rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt, clippy + - name: run_all_tests_clippy_fmt + working-directory: ${{ env.working-directory }} + run: | + make test + rustfmt --edition 2021 --check src/*.rs tests/*.rs + cargo clippy --all + + github_release: + if: startswith(github.ref, 'refs/tags/') # Only run on tag push + needs: rust_test + runs-on: ubuntu-latest + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: true + + crates_release: + if: startswith(github.ref, 'refs/tags/') # Only run on tag push + needs: github_release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - id: crates-release-action + uses: wasmcloud/common-actions/crates-release@main + with: + working-directory: ${{ env.working-directory }} + crates-token: ${{ secrets.CRATES_PUBLISH_TOKEN }} diff --git a/httpserver-rs/Cargo.lock b/httpserver-rs/Cargo.lock index 110bd3df..aec15b08 100644 --- a/httpserver-rs/Cargo.lock +++ b/httpserver-rs/Cargo.lock @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -53,9 +53,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" [[package]] name = "anyhow" -version = "1.0.66" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "ascii_tree" @@ -71,11 +71,11 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-nats" -version = "0.23.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9323e13cccc5d28a249e3d0c22600129703c75283a73fc3ebb3dbd2d51bef1cb" +checksum = "47a445ce9f6605511fe594b31a6ba174bc874fef6bfa628cea51e9bfe450e2f7" dependencies = [ - "base64", + "base64 0.13.1", "base64-url", "bytes", "futures", @@ -89,7 +89,7 @@ dependencies = [ "regex", "ring", "rustls-native-certs", - "rustls-pemfile 1.0.1", + "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_nanos", @@ -105,34 +105,35 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +checksum = "ad445822218ce64be7a341abfb0b1ea43b5c23aa83902542a4542e78309d8e5e" dependencies = [ "async-stream-impl", "futures-core", + "pin-project-lite", ] [[package]] name = "async-stream-impl" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "async-trait" -version = "0.1.58" +version = "0.1.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.8", ] [[package]] @@ -201,7 +202,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -214,9 +215,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", @@ -233,13 +234,19 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "base64-url" version = "1.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67a99c239d0c7e77c85dddfa9cebce48704b3c49550fcd3b84dd637e4484899f" dependencies = [ - "base64", + "base64 0.13.1", ] [[package]] @@ -256,9 +263,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake2" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ "digest 0.10.6", ] @@ -274,9 +281,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -293,9 +300,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byteorder" @@ -305,15 +312,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.77" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-if" @@ -323,31 +330,14 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "atty", - "bitflags", - "clap_derive 3.2.18", - "clap_lex 0.2.4", - "indexmap", - "once_cell", - "strsim", - "termcolor", - "textwrap", -] - -[[package]] -name = "clap" -version = "4.0.26" +version = "4.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2148adefda54e14492fb9bddcc600b4344c5d1a3123bd666dcb939c6f0e0e57e" +checksum = "3c911b090850d79fc64fe9ea01e28e465f65e821e08813ced95bced72f7a8a9b" dependencies = [ - "atty", "bitflags", - "clap_derive 4.0.21", - "clap_lex 0.3.0", + "clap_derive", + "clap_lex", + "is-terminal", "once_cell", "strsim", "termcolor", @@ -355,44 +345,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" -dependencies = [ - "heck 0.4.0", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_derive" -version = "4.0.21" +version = "4.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "9a932373bab67b984c790ddf2c9ca295d8e3af3b7ef92de5a5bacdccdee4b09b" dependencies = [ - "heck 0.4.0", - "proc-macro-error", + "heck 0.4.1", "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", + "syn 2.0.8", ] [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" dependencies = [ "os_str_bytes", ] @@ -430,9 +397,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" dependencies = [ "cfg-if", "crossbeam-utils", @@ -440,9 +407,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if", ] @@ -464,7 +431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -480,11 +447,24 @@ dependencies = [ "zeroize", ] +[[package]] +name = "dashmap" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +dependencies = [ + "cfg-if", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "data-encoding" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "der" @@ -516,7 +496,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "block-buffer 0.10.3", + "block-buffer 0.10.4", "crypto-common", "subtle", ] @@ -543,9 +523,9 @@ dependencies = [ [[package]] name = "downloader" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074093edfa907e8203c17c5111b04e114e03bde5ccdfa21a388fa4f34dabad96" +checksum = "d05213e96f184578b5f70105d4d0a644a168e99e12d7bea0b200c15d67b5c182" dependencies = [ "futures", "rand", @@ -556,9 +536,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ "signature", ] @@ -577,15 +557,15 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if", ] @@ -603,6 +583,27 @@ dependencies = [ "termcolor", ] +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "error-chain" version = "0.12.4" @@ -621,9 +622,9 @@ checksum = "59e867569975c88fdf73833a30bd6e0978aa6ab6bd784b648fcece07450951ba" [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -634,12 +635,40 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin 0.9.6", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.1.0" @@ -651,9 +680,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" dependencies = [ "futures-channel", "futures-core", @@ -666,9 +695,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", "futures-sink", @@ -676,15 +705,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" dependencies = [ "futures-core", "futures-task", @@ -693,38 +722,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-channel", "futures-core", @@ -755,21 +784,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" [[package]] name = "h2" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" dependencies = [ "bytes", "fnv", @@ -780,15 +811,15 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.4", + "tokio-util 0.7.7", "tracing", ] [[package]] name = "handlebars" -version = "4.3.5" +version = "4.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433e4ab33f1213cdc25b5fa45c76881240cfe79284cf2b395e8b9e312a30a2fd" +checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a" dependencies = [ "log", "pest", @@ -810,7 +841,7 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ - "base64", + "base64 0.13.1", "bitflags", "bytes", "headers-core", @@ -840,9 +871,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -853,11 +884,26 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -895,9 +941,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -919,9 +965,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59df7c4e19c950e6e0e868dcc0a300b09a9b88e9ec55bd879ca819087a77355d" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", @@ -942,6 +988,19 @@ dependencies = [ "tokio-io-timeout", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "idna" version = "0.3.0" @@ -971,11 +1030,34 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "ipnet" -version = "2.5.1" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" + +[[package]] +name = "is-terminal" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.45.0", +] [[package]] name = "itertools" @@ -988,15 +1070,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -1018,9 +1100,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.137" +version = "0.2.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "lock_api" @@ -1058,9 +1146,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" @@ -1074,59 +1162,45 @@ dependencies = [ [[package]] name = "minicbor" -version = "0.17.1" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e575910763b21a0db7df5e142907fe944bff84d1dfc78e2ba92e7f3bdfd36b" +checksum = "48222b0b93eea4181f796ff574ad31a6ef635a6a6d9953b5cebffe44e1b70c59" [[package]] name = "minicbor" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a20020e8e2d1881d8736f64011bb5ff99f1db9947ce3089706945c8915695cb" -dependencies = [ - "minicbor-derive", -] - -[[package]] -name = "minicbor-derive" -version = "0.12.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8608fb1c805b5b6b3d5ab7bd95c40c396df622b64d77b2d621a5eae1eed050ee" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "a5e575910763b21a0db7df5e142907fe944bff84d1dfc78e2ba92e7f3bdfd36b" [[package]] name = "minicbor-ser" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d31d566bc65d61279ba962508150b3b0c459d940b7b243a19273f31f74c3b0f" +checksum = "327f21c0fdeca4f4e5d0552ac36af7bf76e1e1fe4fc165ae00355b4f1995d493" dependencies = [ - "minicbor 0.18.0", + "minicbor 0.11.5", "serde", ] [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -1153,6 +1227,33 @@ dependencies = [ "twoway", ] +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "nkeys" version = "0.2.0" @@ -1199,28 +1300,28 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "object" -version = "0.29.0" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "opaque-debug" @@ -1228,12 +1329,51 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl" +version = "0.10.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b277f87dacc05a6b709965d1cbafac4649d6ce9f3ce9ceb88508b5666dfec9" +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 1.0.109", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a95792af3c4e0153c3914df2261bedd30a98476f94dc892b67dfe1d89d433a04" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "opentelemetry" version = "0.17.0" @@ -1336,9 +1476,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "output_vt100" @@ -1373,22 +1513,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.4" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "paste" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "pem-rfc7468" @@ -1407,9 +1547,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.4.1" +version = "2.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a528564cc62c19a7acac4d81e01f39e53e25e17b934878f4c6d25cc2836e62f8" +checksum = "8cbd939b234e95d72bc393d51788aec68aeeb5d51e748ca08ff3aad58cb722f7" dependencies = [ "thiserror", "ucd-trie", @@ -1429,9 +1569,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.4.1" +version = "2.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fd9bc6500181952d34bd0b2b0163a54d794227b498be0b7afa7698d0a7b18f" +checksum = "a81186863f3d0a27340815be8f2078dd8050b14cd71913db9fbda795e5f707d7" dependencies = [ "pest", "pest_generator", @@ -1439,33 +1579,33 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.4.1" +version = "2.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2610d5ac5156217b4ff8e46ddcef7cdf44b273da2ac5bca2ecbfa86a330e7c4" +checksum = "75a1ef20bf3193c15ac345acb32e26b3dc3223aff4d77ae4fc5359567683796b" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "pest_meta" -version = "2.4.1" +version = "2.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824749bf7e21dd66b36fbe26b3f45c713879cccd4a009a917ab8e045ca8246fe" +checksum = "5e3b284b1f13a20dc5ebc90aff59a51b8d7137c221131b52a7260c08cbc1cc80" dependencies = [ "once_cell", "pest", - "sha1", + "sha2 0.10.6", ] [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", "indexmap", @@ -1488,7 +1628,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1515,6 +1655,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1542,7 +1688,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1559,9 +1705,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" dependencies = [ "unicode-ident", ] @@ -1606,7 +1752,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1627,9 +1773,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.21" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -1692,9 +1838,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c" dependencies = [ "aho-corasick", "memchr", @@ -1712,26 +1858,17 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949" dependencies = [ - "base64", + "base64 0.21.0", "bytes", "encoding_rs", "futures-core", @@ -1741,19 +1878,22 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile 1.0.1", + "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_urlencoded", "tokio", + "tokio-native-tls", "tokio-rustls", "tower-service", "url", @@ -1773,7 +1913,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted", "web-sys", "winapi", @@ -1803,9 +1943,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b" [[package]] name = "rustc-hash" @@ -1813,11 +1953,25 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustix" +version = "0.36.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", +] + [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -1832,7 +1986,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.1", + "rustls-pemfile 1.0.2", "schannel", "security-framework", ] @@ -1843,23 +1997,23 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ - "base64", + "base64 0.13.1", ] [[package]] name = "rustls-pemfile" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64", + "base64 0.21.0", ] [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "safemem" @@ -1869,12 +2023,11 @@ checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] @@ -1901,9 +2054,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags", "core-foundation", @@ -1914,9 +2067,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -1924,44 +2077,44 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.147" +version = "1.0.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.7" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" +checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.8", ] [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" dependencies = [ "itoa", "ryu", @@ -1970,22 +2123,31 @@ dependencies = [ [[package]] name = "serde_nanos" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44969a61f5d316be20a42ff97816efb3b407a924d06824c3d8a49fa8450de0e" +checksum = "8ae801b7733ca8d6a2b580debe99f67f36826a0f5b8a36055dc6bc40f8d6bc71" dependencies = [ "serde", ] [[package]] name = "serde_repr" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.8", +] + +[[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", ] [[package]] @@ -2002,9 +2164,9 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ "cfg-if", "cpufeatures", @@ -2057,9 +2219,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -2084,9 +2246,9 @@ checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] @@ -2097,11 +2259,28 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "smithy-bindgen" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72465f7ba4112b55816e2c9eac7b36204ea1c94f5fd1b12996980d9e1785dfc5" +dependencies = [ + "atelier_json", + "proc-macro-error", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 1.0.109", + "tracing", + "weld-codegen", +] + [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -2113,6 +2292,15 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5d6e0250b93c8427a177b849d144a96d5acc57006149479403d7861ab721e34" +dependencies = [ + "lock_api", +] + [[package]] name = "spki" version = "0.4.1" @@ -2145,9 +2333,20 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9" dependencies = [ "proc-macro2", "quote", @@ -2162,73 +2361,67 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "unicode-xid", ] [[package]] name = "tempfile" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ "cfg-if", "fastrand", - "libc", "redox_syscall", - "remove_dir_all", - "winapi", + "rustix", + "windows-sys 0.42.0", ] [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.8", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "time" -version = "0.3.17" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ "itoa", "serde", @@ -2244,9 +2437,9 @@ checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" [[package]] name = "time-macros" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" dependencies = [ "time-core", ] @@ -2262,15 +2455,15 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.22.0" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ "autocfg", "bytes", @@ -2283,7 +2476,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.45.0", ] [[package]] @@ -2298,13 +2491,23 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", ] [[package]] @@ -2331,9 +2534,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", @@ -2368,9 +2571,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", @@ -2382,11 +2585,45 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ + "indexmap", "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] @@ -2397,7 +2634,7 @@ checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" dependencies = [ "async-stream", "async-trait", - "base64", + "base64 0.13.1", "bytes", "futures-core", "futures-util", @@ -2429,7 +2666,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2446,7 +2683,7 @@ dependencies = [ "rand", "slab", "tokio", - "tokio-util 0.7.4", + "tokio-util 0.7.7", "tower-layer", "tower-service", "tracing", @@ -2485,7 +2722,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2566,9 +2803,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" @@ -2576,7 +2813,7 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64", + "base64 0.13.1", "byteorder", "bytes", "http", @@ -2600,9 +2837,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -2621,15 +2858,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-normalization" @@ -2642,9 +2879,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-xid" @@ -2677,9 +2914,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" dependencies = [ "getrandom", "serde", @@ -2691,6 +2928,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.4" @@ -2734,7 +2977,7 @@ dependencies = [ "tokio-rustls", "tokio-stream", "tokio-tungstenite", - "tokio-util 0.7.4", + "tokio-util 0.7.7", "tower-service", "tracing", ] @@ -2745,7 +2988,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32d1cfad67501627ac9344cbd89be80d2d5ebc98ef3b86862041cb26a280081f" dependencies = [ - "base64", + "base64 0.13.1", "data-encoding", "env_logger", "humantime", @@ -2768,9 +3011,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2778,24 +3021,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -2805,9 +3048,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2815,22 +3058,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "wasmbus-macros" @@ -2841,19 +3084,19 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "wasmbus-rpc" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40741670f20464a709dda3a7b036cd84fc1210f8399fb85e6bf7f56893654c4c" +checksum = "e61f6be0a90660de63951fb782dbb37979d03203c60176b6041ec36f6d367136" dependencies = [ "async-nats", "async-trait", "atty", - "base64", + "base64 0.13.1", "bytes", "cfg-if", "data-encoding", @@ -2873,7 +3116,7 @@ dependencies = [ "thiserror", "time", "tokio", - "toml", + "toml 0.5.11", "tracing", "tracing-futures", "tracing-opentelemetry", @@ -2881,49 +3124,21 @@ dependencies = [ "uuid", "wascap", "wasmbus-macros", - "weld-codegen 0.6.0", -] - -[[package]] -name = "wasmcloud-interface-httpserver" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8e7f065dc7bd3ee6f3fa5bbc55eee90bad2dc2bd5b250ea2acabb18080a1eb" -dependencies = [ - "async-trait", - "serde", - "serde_bytes", - "serde_json", - "wasmbus-rpc", - "weld-codegen 0.5.0", -] - -[[package]] -name = "wasmcloud-interface-testing" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cda5358bdc6d7739a8510aa5ea264d3930b239ffdd6eee8c39fbae2577dd76" -dependencies = [ - "async-trait", - "regex", - "rmp-serde", - "serde", - "serde_bytes", - "serde_json", - "wasmbus-rpc", - "weld-codegen 0.5.0", + "weld-codegen", ] [[package]] name = "wasmcloud-provider-httpserver" -version = "0.17.0" +version = "0.17.1" dependencies = [ "assert_matches", "async-trait", "atty", - "base64", + "base64 0.21.0", "blake2", "bytes", + "dashmap", + "flume", "futures", "http", "opentelemetry 0.18.0", @@ -2931,45 +3146,45 @@ dependencies = [ "serde", "serde_bytes", "serde_json", + "smithy-bindgen", "thiserror", "tokio", - "toml", + "toml 0.7.3", "tracing", "tracing-subscriber", "warp", "wasmbus-rpc", - "wasmcloud-interface-httpserver", "wasmcloud-test-util", ] [[package]] name = "wasmcloud-test-util" -version = "0.6.4" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61ffa428b4c302c24802180cd406039c632091dcd9c0952ffa4d9283b0e55b8" +checksum = "b104f4a83f45a76358b7805d700dc5114402b767d5607c1689d27efb9d262327" dependencies = [ "anyhow", - "async-nats", "async-trait", - "base64", + "base64 0.21.0", "futures", "log", "nkeys", "regex", "serde", + "serde_bytes", "serde_json", + "smithy-bindgen", "termcolor", "tokio", - "toml", + "toml 0.7.3", "wasmbus-rpc", - "wasmcloud-interface-testing", ] [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -2987,48 +3202,18 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] [[package]] name = "weld-codegen" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a116c5da028abf02e952882a998e5aef9dabca49a86569c39904fe341386546" -dependencies = [ - "Inflector", - "anyhow", - "atelier_assembler", - "atelier_core", - "atelier_json", - "atelier_smithy", - "bytes", - "cfg-if", - "clap 3.2.23", - "directories", - "downloader", - "handlebars", - "lazy_static", - "lexical-sort", - "reqwest", - "rustc-hash", - "semver", - "serde", - "serde_json", - "tempfile", - "thiserror", - "toml", -] - -[[package]] -name = "weld-codegen" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0897960d6e7c55863b78d5bb48858c7f243a731c416f12cc47854b74ca1a85" +checksum = "66385fd8affabb09b678d2f826c78d995789cdb2fbb2dd02e6010dffe298797e" dependencies = [ "Inflector", "anyhow", @@ -3038,7 +3223,7 @@ dependencies = [ "atelier_smithy", "bytes", "cfg-if", - "clap 4.0.26", + "clap", "directories", "downloader", "handlebars", @@ -3051,14 +3236,14 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml", + "toml 0.7.3", ] [[package]] name = "which" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", "libc", @@ -3096,19 +3281,6 @@ 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 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - [[package]] name = "windows-sys" version = "0.42.0" @@ -3116,85 +3288,88 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_x86_64_msvc", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.0" +name = "windows-sys" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] [[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" +name = "windows-targets" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] [[package]] -name = "windows_aarch64_msvc" -version = "0.42.0" +name = "windows_aarch64_gnullvm" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] -name = "windows_i686_gnu" -version = "0.36.1" +name = "windows_aarch64_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.0" +name = "winnow" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "deac0939bd6e4f24ab5919fbf751c97a8cfc8543bb083a305ed5c0c10bb241d1" +dependencies = [ + "memchr", +] [[package]] name = "winreg" @@ -3216,12 +3391,12 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] diff --git a/httpserver-rs/Cargo.toml b/httpserver-rs/Cargo.toml index 469c59b4..7f47235b 100644 --- a/httpserver-rs/Cargo.toml +++ b/httpserver-rs/Cargo.toml @@ -1,33 +1,35 @@ [package] name = "wasmcloud-provider-httpserver" -version = "0.17.0" +version = "0.17.1" edition = "2021" [dependencies] async-trait = "0.1.52" atty = "0.2" -base64 = "0.13" +base64 = "0.21" bytes = "1.2" +dashmap = "5.4.0" +flume = "0.10.14" futures = "0.3" http = "0.2" opentelemetry = { version = "0.18.0", features = ["rt-tokio"] } serde_bytes = "0.11" serde_json = "1.0" serde = {version = "1.0", features = ["derive"] } +smithy-bindgen = "0.1" thiserror = "1.0" tokio = { version = "1", features = ["full"] } -toml = "0.5" +toml = "0.7" tracing = "0.1.34" tracing-subscriber = { version = "0.3", features = ["env-filter"] } warp = { version="0.3", features=["tls"] } -wasmcloud-interface-httpserver = "0.8.1" -wasmbus-rpc = { version = "0.11.2", features = ["otel"] } +wasmbus-rpc = { version = "0.12.0", features = ["otel"]} [dev-dependencies] assert_matches = "1.5" blake2 = "0.10.4" -reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"]} -wasmcloud-test-util = "0.6.4" +reqwest = { version = "0.11", features = ["json"]} +wasmcloud-test-util = "0.7.0" [lib] name = "wasmcloud_provider_httpserver" diff --git a/httpserver-rs/Makefile b/httpserver-rs/Makefile index 2a9e57c5..9434c77f 100644 --- a/httpserver-rs/Makefile +++ b/httpserver-rs/Makefile @@ -13,5 +13,13 @@ oci_insecure = --insecure include ../build/makefiles/provider.mk -test: +ifeq ($(shell nc -zt -w1 127.0.0.1 4222 || echo fail),fail) +test:: + docker run --rm -d --name nats-provider-test -p 127.0.0.1:4222:4222 nats:2.9 -js cargo test -- --nocapture + docker stop nats-provider-test +else +test:: + cargo test -- --nocapture +endif + diff --git a/httpserver-rs/bin/main.rs b/httpserver-rs/bin/main.rs index cab7f754..fc3666ed 100644 --- a/httpserver-rs/bin/main.rs +++ b/httpserver-rs/bin/main.rs @@ -1,12 +1,18 @@ //! Http Server implementation for wasmcloud:httpserver //! //! -use std::{collections::HashMap, convert::Infallible, sync::Arc}; +use std::{convert::Infallible, sync::Arc}; use async_trait::async_trait; -use tokio::sync::RwLock; -use wasmbus_rpc::{core::LinkDefinition, error::RpcError, provider::prelude::*}; -use wasmcloud_provider_httpserver::{load_settings, HttpServerCore}; +use tracing::{error, instrument, trace, warn}; +use wasmbus_rpc::{ + core::LinkDefinition, error::RpcError, provider::prelude::*, provider::ProviderTransport, +}; +use wasmcloud_provider_httpserver::{ + load_settings, + wasmcloud_interface_httpserver::{HttpRequest, HttpResponse, HttpServer, HttpServerSender}, + HttpServerCore, +}; fn main() -> Result<(), Box> { // handle lattice control messages and forward rpc to the provider dispatch @@ -24,7 +30,7 @@ fn main() -> Result<(), Box> { #[derive(Clone, Default, Provider)] struct HttpServerProvider { // map to store http server (and its link parameters) for each linked actor - actors: Arc>>, + actors: Arc>, } impl ProviderDispatch for HttpServerProvider {} @@ -42,36 +48,76 @@ impl ProviderHandler for HttpServerProvider { let settings = load_settings(&ld.values).map_err(|e| RpcError::ProviderInit(e.to_string()))?; - let http_server = HttpServerCore::new(settings.clone(), get_host_bridge()); - http_server.start(ld.clone()).await.map_err(|e| { + let http_server = HttpServerCore::new( + settings.clone(), + get_host_bridge().lattice_prefix().to_string(), + call_actor, + ); + + http_server.start(ld).await.map_err(|e| { RpcError::ProviderInit(format!( "starting httpserver for {} {:?}: {}", &ld.actor_id, &settings.address, e )) })?; - let mut update_map = self.actors.write().await; - update_map.insert(ld.actor_id.to_string(), http_server); + self.actors.insert(ld.actor_id.to_string(), http_server); Ok(true) } /// Handle notification that a link is dropped - stop the http listener async fn delete_link(&self, actor_id: &str) { - let mut aw = self.actors.write().await; - if let Some(server) = aw.remove(actor_id) { + if let Some(entry) = self.actors.remove(actor_id) { tracing::info!(%actor_id, "httpserver stopping listener for actor"); - server.begin_shutdown().await; + entry.1.begin_shutdown(); } } /// Handle shutdown request by shutting down all the http server threads async fn shutdown(&self) -> Result<(), Infallible> { - let mut aw = self.actors.write().await; // empty the actor link data and stop all servers - for (_, server) in aw.drain() { - server.begin_shutdown().await; - } + self.actors.clear(); Ok(()) } } + +/// forward HttpRequest to actor. +#[instrument(level = "debug", skip(_lattice_id, ld, req, timeout), fields(actor_id = %ld.actor_id))] +async fn call_actor( + _lattice_id: String, + ld: Arc, + req: HttpRequest, + timeout: Option, +) -> Result { + let tx = ProviderTransport::new_with_timeout(ld.as_ref(), Some(get_host_bridge()), timeout); + let ctx = Context::default(); + let actor = HttpServerSender::via(tx); + + let rc = actor.handle_request(&ctx, &req).await; + match rc { + Err(RpcError::Timeout(_)) => { + error!("actor request timed out: returning 503",); + Ok(HttpResponse { + status_code: 503, + body: Default::default(), + header: Default::default(), + }) + } + + Ok(resp) => { + trace!( + status_code = %resp.status_code, + "http response received from actor" + ); + Ok(resp) + } + Err(e) => { + warn!( + error = %e, + "actor responded with error" + ); + Err(e) + } + } +} diff --git a/httpserver-rs/settings.md b/httpserver-rs/settings.md index da71e092..d0d27d79 100644 --- a/httpserver-rs/settings.md +++ b/httpserver-rs/settings.md @@ -12,7 +12,7 @@ Address is a string in the form "IP:PORT". The default bind address is "127.0.0. ### TLS -An empty tls section, or no tls section, disables tls. To enable tls, both `cert_file` and `priv_key_file` must contain absolute paths to existing files. +An empty tls section, or no tls section, disables tls. To enable TLS, both `cert_file` and `priv_key_file` must contain absolute paths to existing files. ### CORS @@ -34,10 +34,18 @@ An empty tls section, or no tls section, disables tls. To enable tls, both `cert - `max_age_secs` - sets the `Access-Control-Max-Age` header. Default is 300 seconds. +### Content length limit + +The http server is configured with a maximum content size that will be accepted for an incoming request. This is an important safety measure to prevent a caller from submitting unreasonably large requests to cause the server to run out of memory. By default, the content limit is 100MB (104857600 bytes). +The value can be overridden with the setting `max_content_len`. The value of this setting is a json string containing a number, or a number followed immediately by a 'K', 'M', or 'G' (or lowercase 'k','m', or 'g'), representing *1024, *1048576, or *1073741824, respectively. +For example, the following setting limits uploads to 20 MB. +```json +{ "max_content_len": "20M" } +``` ## Examples of settings files -Bind to all IP interfaces and port 3000, no TLS +Bind to all IP interfaces and port 3000, with TLS disabled ```json { "address": "0.0.0.0:3000" } @@ -60,13 +68,14 @@ Example with all settings "allowed_methods": [ "GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS" ], "exposed_headers": [], "max_age_secs": 300 - } + }, + "max_content_len": "100M" } ``` ## Using the http server settings -The link definition connecting an actor to a capability provider includes a key-value map called "values". (The location of this 'values' map is still tbd, possibly in a manifest file). "values" is currently defined as a map with string keys and string values, and there are a few options for specifying the httpserver settings within the values map. +The link definition connecting an actor to a capability provider includes a key-value map called "values". "values" is currently defined as a map with string keys and string values, and there are a few options for specifying the httpserver settings within the values map. - use key `config_file`, with a value that is the absolute path to a json or toml file (file type detected by the `.json` or `.toml` extension). diff --git a/httpserver-rs/src/lib.rs b/httpserver-rs/src/lib.rs index 15baac8f..b37255e4 100644 --- a/httpserver-rs/src/lib.rs +++ b/httpserver-rs/src/lib.rs @@ -32,25 +32,35 @@ //! Tokio can manage a thread pool (of OS threads) to be shared //! by the all of the server green threads. //! -use std::{convert::Infallible, sync::Arc}; +use std::{ + pin::Pin, + time::Duration, + {convert::Infallible, sync::Arc}, +}; use bytes::Bytes; +use flume::{bounded, Receiver, Sender}; +use futures::Future; use http::header::HeaderMap; use thiserror::Error as ThisError; -use tokio::{ - sync::{oneshot, RwLock}, - task::JoinHandle, -}; -use tracing::{error, info, instrument, trace, warn, Instrument}; +use tokio::task::JoinHandle; +use tracing::{error, info, trace, Instrument}; use warp::{filters::cors::Builder, path::FullPath, Filter}; -use wasmbus_rpc::{common::Context, core::LinkDefinition, error::RpcError, provider::*}; -use wasmcloud_interface_httpserver::{HttpRequest, HttpResponse, HttpServer, HttpServerSender}; +use wasmbus_rpc::{core::LinkDefinition, error::RpcResult}; +use wasmcloud_interface_httpserver::{HttpRequest, HttpResponse}; mod settings; -pub use settings::{load_settings, ServiceSettings}; +pub use settings::{load_settings, ServiceSettings, CONTENT_LEN_LIMIT, DEFAULT_MAX_CONTENT_LEN}; mod hashmap_ci; pub(crate) use hashmap_ci::make_case_insensitive; +pub mod wasmcloud_interface_httpserver { + smithy_bindgen::smithy_bindgen!( + "httpserver/httpserver.smithy", + "org.wasmcloud.interface.httpserver" + ); +} + /// errors generated by this crate #[derive(ThisError, Debug)] pub enum Error { @@ -70,10 +80,25 @@ pub enum Error { SettingsToml(toml::de::Error), } -struct Inner { +pub type AsyncCallActorFn = Box< + dyn Fn( + String, + Arc, + HttpRequest, + Option, + ) -> Pin> + Send + 'static>> + + Send + + Sync, +>; + +struct CallActorFn(AsyncCallActorFn); + +pub struct Inner { settings: ServiceSettings, - signal: Option>, - bridge: &'static HostBridge, + lattice_id: String, + shutdown_tx: Sender, + shutdown_rx: Receiver, + call_actor: CallActorFn, } /// An asynchronous HttpServer with support for CORS and TLS @@ -86,32 +111,50 @@ struct Inner { /// ``` #[derive(Clone)] pub struct HttpServerCore { - inner: Arc>, + inner: Arc, +} + +impl std::ops::Deref for HttpServerCore { + type Target = Inner; + fn deref(&self) -> &Self::Target { + self.inner.as_ref() + } } impl HttpServerCore { /// Initializes server with settings - pub fn new(settings: ServiceSettings, bridge: &'static HostBridge) -> Self { + pub fn new(settings: ServiceSettings, lattice_id: String, call_actor_fn: F) -> Self + where + F: Fn(String, Arc, HttpRequest, Option) -> Fut + + Send + + Sync + + 'static, + Fut: Future> + 'static + Send, + { + let (shutdown_tx, shutdown_rx) = bounded(1); + let call_actor_fn = Arc::new(call_actor_fn); Self { - inner: Arc::new(RwLock::new(Inner { + inner: Arc::new(Inner { settings, - signal: None, - bridge, - })), + lattice_id, + shutdown_tx, + shutdown_rx, + call_actor: CallActorFn(Box::new( + move |lattice: String, + ld: Arc, + req: HttpRequest, + timeout: Option| { + let call_actor_fn = call_actor_fn.clone(); + Box::pin(call_actor_fn(lattice, ld, req, timeout)) + }, + )), + }), } } /// Initiate server shutdown. This can be called from any thread and is non-blocking. - pub async fn begin_shutdown(&self) { - let mut mut_sig = self.inner.write().await; - let sig = mut_sig.signal.take(); - if let Some(sig) = sig { - if sig.send(true).is_err() { - // might not see this error if logging isn't initialized on this thread. - // only relevant if the shutdown fails - error!("failed sending shutdown signal to main thread"); - } - } + pub fn begin_shutdown(&self) { + let _ = self.shutdown_tx.try_send(true); } /// Start the server in a new thread @@ -121,20 +164,17 @@ impl HttpServerCore { /// let server = HttpServer::new(settings); /// let _ = server.start().await?; /// ``` - pub async fn start(&self, ld: LinkDefinition) -> Result, Error> { - let (shutdown_tx, shutdown_rx) = oneshot::channel(); - let inner = Arc::clone(&self.inner); - { - let mut update = inner.write().await; - update.signal = Some(shutdown_tx); - } - let timeout = { - let rd = self.inner.read().await; - rd.settings.timeout_ms.map(std::time::Duration::from_millis) - }; - let ld = Arc::new(ld); + pub async fn start(&self, ld: &LinkDefinition) -> Result, Error> { + let timeout = self + .inner + .settings + .timeout_ms + .map(std::time::Duration::from_millis); + + let ld = Arc::new(ld.clone()); let linkdefs = ld.clone(); - let actor_id = ld.actor_id.clone(); + let trace_ld = ld.clone(); + let arc_inner = self.inner.clone(); let route = warp::any() .and(warp::header::headers_cloned()) .and(warp::method()) @@ -142,14 +182,15 @@ impl HttpServerCore { .and(warp::path::full()) .and(opt_raw_query()) .and_then( - move |headers: HeaderMap, + move | + headers: HeaderMap, method: http::method::Method, body: Bytes, path: FullPath, query: String| { - let inner = Arc::clone(&inner); let span = tracing::debug_span!("http request", %method, path = %path.as_str(), %query); - let ld_ref = linkdefs.clone(); + let ld = linkdefs.clone(); + let arc_inner = arc_inner.clone(); async move { let hmap = convert_request_headers(&headers); let req = HttpRequest { @@ -163,10 +204,7 @@ impl HttpServerCore { ?req, "httpserver calling actor" ); - let read_guard = inner.read().in_current_span().await; - let bridge = read_guard.bridge; - let response = match Self::send_actor(ld_ref, req, bridge, timeout).in_current_span().await - { + let response = match arc_inner.call_actor.call(arc_inner.lattice_id.clone(), ld, req, timeout).in_current_span().await { Ok(resp) => resp, Err(e) => { error!( @@ -175,11 +213,11 @@ impl HttpServerCore { ); HttpResponse { status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(), - ..Default::default() + body: Default::default(), + header: Default::default(), } } }; - drop(read_guard); let mut http_response = http::response::Response::new(response.body); let status = match http::StatusCode::from_u16(response.status_code) { Ok(status_code) => status_code, @@ -198,6 +236,7 @@ impl HttpServerCore { }.instrument(span) }, ).with(warp::trace(move |req_info| { + let actor_id = &trace_ld.actor_id; let span = tracing::debug_span!("request", method = %req_info.method(), path = %req_info.path(), query = tracing::field::Empty, %actor_id); if let Some(remote_addr) = req_info.remote_addr() { span.record("remote_addr", &tracing::field::display(remote_addr)); @@ -206,10 +245,7 @@ impl HttpServerCore { span })); - let addr = { - let rd = self.inner.read().await; - rd.settings.address.unwrap() - }; + let addr = self.settings.address.unwrap(); info!( %addr, actor_id = %ld.actor_id, @@ -217,29 +253,29 @@ impl HttpServerCore { ); // add Cors configuration, if enabled, and spawn either TlsServer or Server - let read = self.inner.read().await; - let cors = cors_filter(&read.settings)?; + let cors = cors_filter(&self.settings)?; let server = warp::serve(route.with(cors)); let handle = tokio::runtime::Handle::current(); - let join = if read.settings.tls.is_set() { + let shutdown_rx = self.shutdown_rx.clone(); + let join = if self.settings.tls.is_set() { let (_, fut) = server .tls() // unwrap ok here because tls.is_set confirmed both fields are some() - .key_path(read.settings.tls.priv_key_file.as_ref().unwrap()) - .cert_path(read.settings.tls.cert_file.as_ref().unwrap()) + .key_path(self.settings.tls.priv_key_file.as_ref().unwrap()) + .cert_path(self.settings.tls.cert_file.as_ref().unwrap()) // we'd prefer to use try_bind_with_graceful_shutdown but it's not supported // for tls server yet. Waiting on https://github.com/seanmonstar/warp/pull/717 // attempt to bind to the address .bind_with_graceful_shutdown(addr, async move { - if let Err(e) = shutdown_rx.await { + if let Err(e) = shutdown_rx.recv_async().await { error!(error = %e, "shutting down httpserver listener"); } }); - handle.spawn(async move { fut.await }) + handle.spawn(fut) } else { let (_, fut) = server .try_bind_with_graceful_shutdown(addr, async move { - if let Err(e) = shutdown_rx.await { + if let Err(e) = shutdown_rx.recv_async().await { error!(error = %e, "shutting down httpserver listener"); } }) @@ -250,47 +286,17 @@ impl HttpServerCore { e )) })?; - handle.spawn(async move { fut.await }) + handle.spawn(fut) }; Ok(join) } +} - /// forward HttpRequest to actor. - #[instrument(level = "debug", skip(ld, req, bridge), fields(actor_id = %ld.actor_id))] - async fn send_actor( - ld: Arc, - req: HttpRequest, - bridge: &'static HostBridge, - timeout: Option, - ) -> Result { - trace!("sending request to actor"); - let tx = ProviderTransport::new_with_timeout(ld.as_ref(), Some(bridge), timeout); - let ctx = Context::default(); - let actor = HttpServerSender::via(tx); - match actor.handle_request(&ctx, &req).await { - Err(RpcError::Timeout(_)) => { - error!("actor request timed out: returning 503",); - Ok(HttpResponse { - status_code: 503, - ..Default::default() - }) - } - Ok(resp) => { - trace!( - status_code = %resp.status_code, - "http response received from actor" - ); - Ok(resp) - } - Err(e) => { - warn!( - error = %e, - "actor responded with error" - ); - Err(e) - } - } +impl Drop for HttpServerCore { + /// drop the client connection. Does not block or fail if the client has already been closed. + fn drop(&mut self) { + let _ = self.shutdown_tx.try_send(true); } } @@ -395,3 +401,79 @@ fn cors_filter(settings: &settings::ServiceSettings) -> Result Result { + let value = value.trim(); + let mut limit = None; + if value.is_empty() { + limit = Some(DEFAULT_MAX_CONTENT_LEN); + } else if let Ok(num) = value.parse::() { + limit = Some(num); + } else { + let (num, units) = value.split_at(value.len() - 1); + if let Ok(base_value) = num.trim().parse::() { + match units { + "k" | "K" => { + limit = Some(base_value * 1024); + } + "m" | "M" => { + limit = Some(base_value * 1024 * 1024); + } + "g" | "G" => { + limit = Some(base_value * 1024 * 1024 * 1024); + } + _ => {} + } + } + } + match limit { + Some(x) if x > 0 && x <= CONTENT_LEN_LIMIT => Ok(x), + Some(_) => { + Err(Error::Settings(format!("Invalid size in max_content_len '{}': value must be >0 and <= {}", value, settings::CONTENT_LEN_LIMIT))) + } + None => { + Err(Error::Settings(format!("Invalid size in max_content_len: '{}'. Should be a number, optionally followed by 'K', 'M', or 'G'. Example: '10M'. Value must be <= i32::MAX", value))) + } + } +} + +impl CallActorFn { + fn call( + &self, + lattice_id: String, + ld: Arc, + req: HttpRequest, + timeout: Option, + ) -> Pin> + Send + 'static>> { + Box::pin((self.0.as_ref())(lattice_id, ld, req, timeout)) + } +} + +#[test] +fn parse_max_content_len() { + // emtpy string returns default + assert_eq!(convert_human_size("").unwrap(), DEFAULT_MAX_CONTENT_LEN); + // simple number + assert_eq!(convert_human_size("4").unwrap(), 4); + assert_eq!(convert_human_size("12345678").unwrap(), 12345678); + // k, K, m, M, g, G suffix + assert_eq!(convert_human_size("2k").unwrap(), 2 * 1024); + assert_eq!(convert_human_size("2K").unwrap(), 2 * 1024); + assert_eq!(convert_human_size("10m").unwrap(), 10 * 1024 * 1024); + assert_eq!(convert_human_size("10M").unwrap(), 10 * 1024 * 1024); + + // allow space before units + assert_eq!(convert_human_size("10 M").unwrap(), 10 * 1024 * 1024); + + // remove surrounding white space + assert_eq!(convert_human_size(" 5 k ").unwrap(), 5 * 1024); + + // errors + assert!(convert_human_size("k").is_err()); + assert!(convert_human_size("0").is_err()); + assert!(convert_human_size("1mb").is_err()); + assert!(convert_human_size(&i32::MAX.to_string()).is_err()); + assert!(convert_human_size(&(i32::MAX as u64 + 1).to_string()).is_err()); +} diff --git a/httpserver-rs/src/settings.rs b/httpserver-rs/src/settings.rs index 95e58786..9f7b78bd 100644 --- a/httpserver-rs/src/settings.rs +++ b/httpserver-rs/src/settings.rs @@ -4,6 +4,8 @@ //! which determine how the configuration is parsed. //! //! For the key... +use base64::{engine::Engine as _, prelude::BASE64_STANDARD_NO_PAD}; +use serde::{de::Deserializer, de::Visitor, Deserialize, Serialize}; use std::net::{IpAddr, Ipv4Addr}; /// config_file: load configuration from file name. /// Interprets file as json or toml, based on file extension. @@ -19,8 +21,6 @@ use std::net::{IpAddr, Ipv4Addr}; use std::path::Path; use std::{collections::HashMap, fmt, io::ErrorKind, net::SocketAddr, ops::Deref, str::FromStr}; -use serde::{de::Deserializer, de::Visitor, Deserialize, Serialize}; - use crate::Error; const DEFAULT_ADDR: &str = "127.0.0.1:8000"; @@ -36,6 +36,13 @@ const CORS_ALLOWED_HEADERS: &[&str] = &[ ]; const CORS_EXPOSED_HEADERS: &[&str] = &[]; const CORS_DEFAULT_MAX_AGE_SECS: u64 = 300; +// Maximum content length. Can be overridden in settings or link definition +// Syntax: number, or number followed by 'K', 'M', or 'G' +// Default value is 100M (100*1024*1024) +pub const DEFAULT_MAX_CONTENT_LEN: u64 = 100 * 1024 * 1024; +// max possible value of content length. If sending to wasm32, memory is limited to 2GB, +// practically this should be quite a bit smaller. Setting to 1GB for now. +pub const CONTENT_LEN_LIMIT: u64 = 1024 * 1024 * 1024; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct ServiceSettings { @@ -60,6 +67,21 @@ pub struct ServiceSettings { /// If not set, uses the system-wide rpc timeout #[serde(default)] pub timeout_ms: Option, + + /// Max content length. Default "10m" (10MiB = 10485760 bytes) + /// Can be overridden by link def value max_content_len + /// Accepts number (bytes), or number with suffix 'k', 'm', or 'g', (upper or lower case) + /// representing multiples of 1024. For example, + /// - "500" = 5000 bytes, + /// - "5k" = 5 * 1024 bytes, + /// - "5m" = 5 * 1024*1024 bytes, + /// - "1g" = 1024*1024*1024 bytes + /// The value may not be higher than i32::MAX + pub max_content_len: Option, + + /// capture any other configuration values + #[serde(flatten)] + extra: HashMap, } impl Default for ServiceSettings { @@ -70,6 +92,8 @@ impl Default for ServiceSettings { cors: Cors::default(), log: Log::default(), timeout_ms: None, + max_content_len: Some(DEFAULT_MAX_CONTENT_LEN.to_string()), + extra: Default::default(), } } } @@ -87,7 +111,7 @@ macro_rules! merge { impl ServiceSettings { /// load Settings from a file with .toml or .json extension fn from_file>(fpath: P) -> Result { - let data = std::fs::read(&fpath).map_err(|e| { + let data = std::fs::read_to_string(&fpath).map_err(|e| { Error::Settings(format!("reading file {}: {}", &fpath.as_ref().display(), e)) })?; if let Some(ext) = fpath.as_ref().extension() { @@ -106,13 +130,13 @@ impl ServiceSettings { } /// load settings from json - fn from_json(data: &[u8]) -> Result { - serde_json::from_slice(data).map_err(|e| Error::Settings(format!("invalid json: {}", e))) + fn from_json(data: &str) -> Result { + serde_json::from_str(data).map_err(|e| Error::Settings(format!("invalid json: {}", e))) } /// load settings from toml file - fn from_toml(data: &[u8]) -> Result { - toml::from_slice(data).map_err(Error::SettingsToml) + fn from_toml(data: &str) -> Result { + toml::from_str(data).map_err(Error::SettingsToml) } /// Merge settings from other into self @@ -197,13 +221,16 @@ pub fn load_settings(values: &HashMap) -> Result tokio::task::JoinHandle tokio::task::JoinHandle(e) = { let prov = test_provider().await; - let topic = rpc_topic(&prov.origin(), &prov.host_data.lattice_rpc_prefix); + let topic = prov.mock_actor_rpc_topic(); // subscribe() returns a Stream of nats messages let mut sub = prov .nats_client @@ -119,7 +114,8 @@ async fn mock_echo_actor(num_requests: u32) -> tokio::task::JoinHandle tokio::task::JoinHandle= num_requests { @@ -259,7 +256,6 @@ async fn test_timeout(_: &TestOptions) -> RpcResult<()> { .await; let elapsed = start_time.elapsed(); eprintln!("GET /sleep returned in {} ms", &elapsed.as_millis()); - eprintln!("DEBUG /sleep response after timeout: {:#?}", &resp); assert!(resp.is_ok(), "expect ok response"); let resp = resp.unwrap();