diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d770e95..b3364cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,10 @@ jobs: with: key: windows-latest-test - uses: cargo-bins/cargo-binstall@main + - name: Install NASM for AWS-LC + uses: ilammy/setup-nasm@v1 + - name: Install bindgen-cli + run: cargo install --force --locked bindgen-cli - name: Test Setup run: | make certs @@ -29,7 +33,7 @@ jobs: - name: Test run: | Start-Process cmd -Args /c,"http-server --tls --tls-key certs/test-certs/server.key --tls-cert certs/test-certs/server.crt --tls-key-algorithm pkcs8" - cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry,http-client-json,__skip-http-client-cert-verification + cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry test: name: Check ${{ matrix.check }} on (${{ matrix.os }}) runs-on: ${{ matrix.os }} diff --git a/.gitignore b/.gitignore index 87c4f74..9825b5c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ target/ .docker-cargo target-docker .vscode/tasks.json +.vscode/settings.json .idea/ +Cargo.lock \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d004602..07ca0c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Release Notes +## 0.7.0 +* Update all depencencies to latest versions +* Timer sleeper only fires once +* Remove `http-client` +* Rename `native2_tls` feature to `native_tls` +* Note: `rustls` now uses `aws-lc` instead of `ring` + + ## 0.5.0 * Move to `memmap2` because `memmap` is unmaintained. * Enable `rustls` on `windows` diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 1e991e5..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,2179 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" -dependencies = [ - "async-lock 2.8.0", - "async-task", - "concurrent-queue", - "fastrand 1.9.0", - "futures-lite 1.13.0", - "slab", -] - -[[package]] -name = "async-fs" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" -dependencies = [ - "async-lock 3.3.0", - "blocking", - "futures-lite 2.0.0", -] - -[[package]] -name = "async-global-executor" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" -dependencies = [ - "async-channel", - "async-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "blocking", - "futures-lite 1.13.0", - "once_cell", - "tokio", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.9", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" -dependencies = [ - "async-lock 3.3.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.0.0", - "parking", - "polling 3.5.0", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-native-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9343dc5acf07e79ff82d0c37899f079db3534d99f189a1837c8e549c99405bec" -dependencies = [ - "futures-util", - "native-tls", - "thiserror", - "url", -] - -[[package]] -name = "async-net" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" -dependencies = [ - "async-io 2.3.2", - "blocking", - "futures-lite 2.0.0", -] - -[[package]] -name = "async-process" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "autocfg", - "blocking", - "cfg-if", - "event-listener 2.5.3", - "futures-lite 1.13.0", - "rustix 0.37.27", - "signal-hook", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-rustls" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd10f063fb367d26334e10c50c67ea31ac542b8c3402be2251db4cfc5d74ba66" -dependencies = [ - "futures-io", - "rustls", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-attributes", - "async-channel", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-task" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" - -[[package]] -name = "async-trait" -version = "0.1.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version", -] - -[[package]] -name = "atomic-waker" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" - -[[package]] -name = "blocking" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" -dependencies = [ - "async-channel", - "async-lock 2.8.0", - "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite 1.13.0", - "log", -] - -[[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "concurrent-queue" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if", - "wasm-bindgen", -] - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" - -[[package]] -name = "fluvio-future" -version = "0.6.3" -dependencies = [ - "anyhow", - "async-fs", - "async-io 1.13.0", - "async-lock 3.3.0", - "async-native-tls", - "async-net", - "async-rustls", - "async-std", - "async-trait", - "bytes", - "cfg-if", - "fluvio-future", - "fluvio-test-derive", - "fluvio-wasm-timer", - "flv-util", - "futures-lite 2.0.0", - "futures-timer", - "futures-util", - "http", - "hyper", - "lazy_static", - "log", - "memmap2", - "native-tls", - "nix", - "num_cpus", - "once_cell", - "openssl", - "openssl-sys", - "pin-project", - "pin-utils", - "portpicker", - "rustls-pemfile", - "serde", - "serde_json", - "socket2 0.5.3", - "thiserror", - "tokio", - "tokio-util", - "tracing", - "tracing-subscriber", - "tracing-wasm", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "webpki-roots", - "ws_stream_wasm", -] - -[[package]] -name = "fluvio-test-derive" -version = "0.1.1" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "fluvio-wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b768c170dc045fa587a8f948c91f9bcfb87f774930477c6215addf54317f137f" -dependencies = [ - "futures", - "js-sys", - "parking_lot", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "flv-util" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de89447c8b4aecfa4c0614d1a7be1c6ab4a0266b59bb2713fd746901f28d124e" -dependencies = [ - "log", - "tracing", -] - -[[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.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1155db57329dca6d018b61e76b1488ce9a2e5e44028cac420a5898f4fcef63" -dependencies = [ - "fastrand 2.0.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - -[[package]] -name = "futures-task" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" - -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - -[[package]] -name = "futures-util" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "getrandom" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "itoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "lock_api" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -dependencies = [ - "value-bag", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memmap2" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[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 = "nix" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abbbc55ad7b13aac85f9401c796dcda1b864e07fcad40ad47792eaa8932ea502" -dependencies = [ - "bitflags 2.4.0", - "cfg-if", - "libc", - "memoffset", - "pin-utils", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags 2.4.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-src" -version = "300.1.6+3.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" -dependencies = [ - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "parking" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" - -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", -] - -[[package]] -name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version", -] - -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" -dependencies = [ - "cfg-if", - "concurrent-queue", - "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "portpicker" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be97d76faf1bfab666e1375477b23fde79eccf0276e9b63b92a39d676a889ba9" -dependencies = [ - "rand", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.3.7", - "regex-syntax 0.7.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.7.5", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - -[[package]] -name = "ring" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.4.0", - "errno", - "libc", - "linux-raw-sys 0.4.13", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" -dependencies = [ - "log", - "ring 0.17.3", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.3", - "untrusted 0.9.0", -] - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "schannel" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - -[[package]] -name = "serde" -version = "1.0.193" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.193" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "serde_json" -version = "1.0.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" - -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "syn" -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.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" -dependencies = [ - "cfg-if", - "fastrand 2.0.0", - "redox_syscall 0.3.5", - "rustix 0.38.34", - "windows-sys 0.48.0", -] - -[[package]] -name = "thiserror" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" -dependencies = [ - "backtrace", - "bytes", - "num_cpus", - "pin-project-lite", - "tokio-macros", -] - -[[package]] -name = "tokio-macros" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "tokio-util" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" -dependencies = [ - "bytes", - "futures-core", - "futures-io", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "tracing-core" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "tracing-wasm" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" -dependencies = [ - "tracing", - "tracing-subscriber", - "wasm-bindgen", -] - -[[package]] -name = "try-lock" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - -[[package]] -name = "unicode-ident" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "value-bag" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.29", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "wasm-bindgen-test" -version = "0.3.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" -dependencies = [ - "console_error_panic_hook", - "js-sys", - "scoped-tls", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "web-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "ws_stream_wasm" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version", - "send_wrapper", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] diff --git a/Cargo.toml b/Cargo.toml index 256ca83..305c0cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-future" -version = "0.6.3" +version = "0.7.0" edition = "2021" authors = ["Fluvio Contributors "] description = "I/O futures for Fluvio project" @@ -12,130 +12,78 @@ resolver = "2" all-features = true [features] -task = ["async-std/default", "timer", "cfg-if"] +task = ["async-std/default", "cfg-if"] subscriber = ["tracing-subscriber", "tracing-subscriber/std", "tracing-subscriber/env-filter"] -fixture = ["subscriber", "task", "fluvio-test-derive"] +fixture = ["subscriber", "task", "fluvio-future-derive"] task_unstable = ["task", "async-std/unstable"] io = ["async-std/default"] sync = ["async-std/default"] future = ["async-std/default"] -net = ["futures-lite", "async-net", "async-trait", "cfg-if", "futures-util/io", "socket2"] +net = ["futures-lite", "async-net", "async-trait", "cfg-if", "futures-util/io", "socket2", "ws_stream_wasm"] tls = ["rust_tls"] -rust_tls = [ - "net", - "rustls-pemfile", - "async-rustls", - "pin-project", - "futures-util/io", -] -native2_tls = [ - "net", - "pin-project", - "async-native-tls", - "native-tls", - "openssl/vendored", - "futures-util/io", -] -openssl_tls = [ - "net", - "openssl", - "openssl-sys", - "pin-project", - "futures-util/io", -] -timer = ["async-io", "pin-project", "futures-lite"] +rust_tls = ["net", "rustls-pemfile", "futures-rustls", "pin-project", "futures-util/io"] +native_tls = ["net", "pin-project", "async-native-tls", "dep:native-tls", "openssl/vendored", "futures-util/io"] +openssl_tls = ["net", "openssl", "openssl-sys", "pin-project", "futures-util/io"] +timer = ["async-io", "pin-project", "futures-lite", "fluvio-wasm-timer"] fs = ["async-fs", "futures-lite", "pin-utils", "async-trait"] zero_copy = ["nix", "task_unstable"] mmap = ["fs", "memmap2", "task_unstable"] -retry = [] +retry = ["timer", "cfg-if", "async-trait", "futures-util/io"] doomsday = ["task", "sync"] -http-client = [ - "rust_tls", - "async-std/default", - "dep:bytes", - "dep:http", - "dep:hyper", - "dep:serde", - "dep:serde_json", - "dep:tokio", - "dep:once_cell", - "dep:webpki-roots", -] tokio1 = ["async-std/tokio1"] -http-client-json = ["http-client"] -# useful for tests -__skip-http-client-cert-verification = [] +attributes = [] [dependencies] anyhow = { version = "1.0" } -async-trait = { version = "0.1.40", optional = true } -bytes = { version = "1.6.0", optional = true } -cfg-if = { version = "1.0.0", optional = true } -futures-lite = { version = "2.0.0", optional = true } -futures-util = { version = "0.3.5", optional = true } -futures-timer = { version = "3.0.0", optional = true } -http = { version = "0.2.11", optional = true } # same as hyper -hyper = { version = "0.14", default-features = false, features = ["client", "http1", "http2"], optional = true } -log = "0.4.0" -once_cell = { version = "1.19.0", optional = true } +async-trait = { version = "0.1.80", optional = true } +cfg-if = { version = "1.0", optional = true } +fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0", optional = true } +futures-lite = { version = "2.3", optional = true } +futures-util = { version = "0.3.30", optional = true } +pin-project = { version = "1.1", optional = true } pin-utils = { version = "0.1.0", optional = true } -pin-project = { version = "1.0.8", optional = true } thiserror = "1.0" -tokio = { version = "1.37.0", default-features = false, optional = true } -tracing = { version = "0.1" } -tracing-subscriber = { version = "0.3", optional = true } -serde = { version = "1.0", optional = true } -serde_json = { version = "1.0", optional = true } -webpki-roots = { version = "0.25", optional = true } - -fluvio-test-derive = { path = "async-test-derive", version = "0.1.1", optional = true } - +tokio = { version = "1.38", default-features = false, optional = true } +tracing = { version = "0.1.40" } +tracing-subscriber = { version = "0.3.18", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] +async-fs = { version = "2.1", optional = true } +async-io = { version = "2.3", optional = true } async-native-tls = { version = "0.5.0", optional = true } -async-fs = { version = "2.1.2", optional = true } -async-io = { version = "1.1.2", optional = true } -async-net = { version = "2.0.0", optional = true } -async-rustls = { version = "0.4.1", features = ["dangerous_configuration"], optional = true } -async-std = { version = "1.12.0", default-features = false, optional = true } -memmap2 = { version = "0.9", optional = true } -native-tls = { version = "0.2.4", optional = true } +async-net = { version = "2.0", optional = true } +async-std = { version = "1.12", default-features = false, optional = true } +futures-rustls = { version = "0.26.0", optional = true } +memmap2 = { version = "0.9.4", optional = true } +native-tls = { version = "0.2.12", optional = true } +nix = { version = "0.29.0", optional = true, features = ["zerocopy"] } openssl = { version = "0.10.64", optional = true } -openssl-sys = { version = "0.9.102", optional = true, features = ["vendored"]} -nix = { version = "0.26.0", optional = true } -rustls-pemfile = { version = "1.0.0", optional = true } -socket2 = { version = "0.5.3", default-features = false, features = ["all"], optional = true } - +openssl-sys = { version = "0.9.102", optional = true, features = ["vendored"] } +rustls-pemfile = { version = "2.1", optional = true } +socket2 = { version = "0.5.7", default-features = false, features = ["all"], optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] -async-std = { version = "1.12.0", default-features = false, features = ["unstable"], optional = true } -ws_stream_wasm = "0.7.3" - -fluvio-wasm-timer = "0.2.5" +async-std = { version = "1.12", default-features = false, features = ["unstable"], optional = true } +fluvio-wasm-timer = { version = "0.2.5", optional = true } +ws_stream_wasm = { version = "0.7.4", optional = true } [dev-dependencies] -async-lock = "3.3.0" -async-std = { version = "1.12.0", features = ["attributes"] } -bytes = "1.6.0" -futures-util = { version = "0.3.5", features = ["sink", "io"] } -lazy_static = "1.2.0" -num_cpus = "1.10.1" -serde = { version = "1.0.189", features = ["derive"] } -tokio = { version = "1.37.0", features = ["macros"] } -tokio-util = { version = "0.7.0", features = ["codec", "compat"] } - -fluvio-test-derive = { path = "async-test-derive", version = "0.1.0" } -fluvio-future = { path = ".", features = ["net", "fixture", "timer", "fs", "retry", "http-client-json", "__skip-http-client-cert-verification"] } -flv-util = { version = "0.5.0", features = ["fixture"] } - +bytes = "1.6" +fluvio-future = { path = ".", features = ["net", "fixture", "timer", "fs", "retry"] } +fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0" } +flv-util = { version = "0.5.2", features = ["fixture"] } +futures-util = { version = "0.3.30", features = ["sink", "io"] } +lazy_static = "1.5" +num_cpus = "1.16" +serde = { version = "1.0", features = ["derive"] } +tokio = { version = "1.38", features = ["macros"] } +tokio-util = { version = "0.7.11", features = ["codec", "compat"] } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] portpicker = "0.1.1" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -tracing-wasm = "0.2.0" -wasm-bindgen-futures = "0.4.24" -wasm-bindgen-test = "0.3.24" - - +tracing-wasm = "0.2.1" +wasm-bindgen-futures = "0.4.42" +wasm-bindgen-test = "0.3.42" diff --git a/Makefile b/Makefile index 8416673..b996d15 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ test-macos: PFX_OPTS="" test-macos: certs cert-patch-macos test-derive setup-http-server run-test-macos run-test-macos: TEST_PORT=$$(cat tmp-PORT) cargo test \ - --features "task,subscriber,fixture,task_unstable,io,sync,future,net,tls,timer,fs, zero_copy, retry, doomsday, http-client, tokio1, http-client-json, __skip-http-client-cert-verification" + --features "task,subscriber,fixture,task_unstable,io,sync,future,net,tls,timer,fs,zero_copy,retry,doomsday,tokio1" $(MAKE) teardown-http-server install-wasm-pack: @@ -44,7 +44,7 @@ test-wasm-safari: install-wasm32 install-wasm-pack wasm-pack test --safari --headless test-derive: - cd async-test-derive; cargo test + cd fluvio-future-derive; cargo test check-wasm: install-wasm32 cargo build --target wasm32-unknown-unknown --all-features diff --git a/async-test-derive/Cargo.lock b/async-test-derive/Cargo.lock deleted file mode 100644 index 5dd4ef8..0000000 --- a/async-test-derive/Cargo.lock +++ /dev/null @@ -1,1075 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - -[[package]] -name = "async-channel" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5262ed948da60dd8956c6c5aca4d4163593dddb7b32d73267c93dab7b2e98940" -dependencies = [ - "async-channel", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "num_cpus", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" -dependencies = [ - "concurrent-queue", - "futures-lite", - "libc", - "log", - "once_cell", - "parking", - "polling", - "slab", - "socket2", - "waker-fn", - "winapi", -] - -[[package]] -name = "async-lock" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-process" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2c06e30a24e8c78a3987d07f0930edf76ef35e027e7bdb063fccafdad1f60c" -dependencies = [ - "async-io", - "blocking", - "cfg-if", - "event-listener", - "futures-lite", - "libc", - "once_cell", - "signal-hook", - "winapi", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel", - "async-global-executor", - "async-io", - "async-lock", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-task" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" - -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version", -] - -[[package]] -name = "atomic-waker" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "blocking" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" -dependencies = [ - "async-channel", - "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "once_cell", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - -[[package]] -name = "cc" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "concurrent-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "ctor" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "event-listener" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" - -[[package]] -name = "fastrand" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] - -[[package]] -name = "fluvio-future" -version = "0.6.2" -dependencies = [ - "anyhow", - "async-io", - "async-std", - "cfg-if", - "fluvio-test-derive", - "fluvio-wasm-timer", - "futures-lite", - "log", - "pin-project", - "thiserror", - "tracing", - "tracing-subscriber", - "ws_stream_wasm", -] - -[[package]] -name = "fluvio-test-derive" -version = "0.1.1" -dependencies = [ - "fluvio-future", - "proc-macro2", - "quote", - "syn", - "trybuild", -] - -[[package]] -name = "fluvio-wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b768c170dc045fa587a8f948c91f9bcfb87f774930477c6215addf54317f137f" -dependencies = [ - "futures", - "js-sys", - "parking_lot", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "futures" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" - -[[package]] -name = "futures-executor" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" - -[[package]] -name = "futures-lite" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-macro" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" - -[[package]] -name = "futures-task" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" - -[[package]] -name = "futures-util" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "gloo-timers" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "itoa" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" - -[[package]] -name = "js-sys" -version = "0.3.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" - -[[package]] -name = "lock_api" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", - "value-bag", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" - -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version", -] - -[[package]] -name = "pin-project" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "polling" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" -dependencies = [ - "cfg-if", - "libc", - "log", - "wepoll-ffi", - "winapi", -] - -[[package]] -name = "proc-macro2" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "ryu" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "semver" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" - -[[package]] -name = "send_wrapper" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930c0acf610d3fdb5e2ab6213019aaa04e227ebe9547b0649ba599b16d788bd7" - -[[package]] -name = "serde" -version = "1.0.138" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.138" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "signal-hook" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" - -[[package]] -name = "smallvec" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" - -[[package]] -name = "socket2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "syn" -version = "1.0.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" -dependencies = [ - "once_cell", -] - -[[package]] -name = "toml" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" -dependencies = [ - "serde", -] - -[[package]] -name = "tracing" -version = "0.1.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a713421342a5a666b7577783721d3117f1b69a393df803ee17bb73b1e122a59" -dependencies = [ - "ansi_term", - "matchers", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "trybuild" -version = "1.0.42" -source = "git+https://github.com/infinyon/trybuild?branch=check_option#271081028a8b10104c5ab6eb1861e35fd23e156e" -dependencies = [ - "glob", - "lazy_static", - "serde", - "serde_json", - "termcolor", - "toml", -] - -[[package]] -name = "unicode-ident" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "value-bag" -version = "1.0.0-alpha.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - -[[package]] -name = "wasm-bindgen" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" - -[[package]] -name = "web-sys" -version = "0.3.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "ws_stream_wasm" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47ca1ab42f5afed7fc332b22b6e932ca5414b209465412c8cdf0ad23bc0de645" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "pharos", - "rustc_version", - "send_wrapper", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] diff --git a/async-test-derive/LICENSE-APACHE b/async-test-derive/LICENSE-APACHE deleted file mode 100644 index 261eeb9..0000000 --- a/async-test-derive/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/.cargo/config b/config.toml similarity index 100% rename from .cargo/config rename to config.toml diff --git a/async-test-derive/Cargo.toml b/fluvio-future-derive/Cargo.toml similarity index 79% rename from async-test-derive/Cargo.toml rename to fluvio-future-derive/Cargo.toml index cd210e0..829aa56 100644 --- a/async-test-derive/Cargo.toml +++ b/fluvio-future-derive/Cargo.toml @@ -1,12 +1,13 @@ [package] -name = "fluvio-test-derive" -version = "0.1.1" +name = "fluvio-future-derive" +version = "0.1.0" edition = "2018" authors = ["Fluvio Contributors "] description = "Procedure macro to run async fn as test" -repository = "https://github.com/infinyon/flv-future" +repository = "https://github.com/infinyon/future-aio" license = "Apache-2.0" readme = "README.md" +resolver = "2" [lib] proc-macro = true diff --git a/async-test-derive/README.md b/fluvio-future-derive/README.md similarity index 100% rename from async-test-derive/README.md rename to fluvio-future-derive/README.md diff --git a/async-test-derive/src/lib.rs b/fluvio-future-derive/src/lib.rs similarity index 65% rename from async-test-derive/src/lib.rs rename to fluvio-future-derive/src/lib.rs index 04d5713..56747d8 100644 --- a/async-test-derive/src/lib.rs +++ b/fluvio-future-derive/src/lib.rs @@ -2,9 +2,52 @@ extern crate proc_macro; use proc_macro::TokenStream; use proc_macro2::Span; -use quote::quote; -use syn::Ident; -use syn::ItemFn; +use quote::{quote, quote_spanned}; +use syn::{Ident, ItemFn}; +use syn::spanned::Spanned; + +#[proc_macro_attribute] +pub fn main_async(_attr: TokenStream, item: TokenStream) -> TokenStream { + let input = syn::parse_macro_input!(item as syn::ItemFn); + + let ret = &input.sig.output; + let inputs = &input.sig.inputs; + let name = &input.sig.ident; + let body = &input.block; + let attrs = &input.attrs; + let vis = &input.vis; + + if name != "main" { + return TokenStream::from(quote_spanned! { name.span() => + compile_error!("only the main function can be tagged with #[fluvio_future::main_async]"), + }); + } + + if input.sig.asyncness.is_none() { + return TokenStream::from(quote_spanned! { input.span() => + compile_error!("the async keyword is missing from the function declaration"), + }); + } + + let result = quote! { + #vis fn main() #ret { + + ::fluvio_future::subscriber::init_logger(); + + #(#attrs)* + async fn main(#inputs) #ret { + #body + } + + ::fluvio_future::task::run_block_on(async { + main().await + }) + } + + }; + + result.into() +} #[proc_macro_attribute] pub fn test_async(args: TokenStream, item: TokenStream) -> TokenStream { @@ -99,4 +142,4 @@ mod generate { } } -} +} \ No newline at end of file diff --git a/async-test-derive/tests/parse.rs b/fluvio-future-derive/tests/parse.rs similarity index 100% rename from async-test-derive/tests/parse.rs rename to fluvio-future-derive/tests/parse.rs diff --git a/async-test-derive/ui-tests/pass_async.rs b/fluvio-future-derive/ui-tests/pass_async.rs similarity index 100% rename from async-test-derive/ui-tests/pass_async.rs rename to fluvio-future-derive/ui-tests/pass_async.rs diff --git a/async-test-derive/ui-tests/pass_ignore.rs b/fluvio-future-derive/ui-tests/pass_ignore.rs similarity index 100% rename from async-test-derive/ui-tests/pass_ignore.rs rename to fluvio-future-derive/ui-tests/pass_ignore.rs diff --git a/src/doomsday.rs b/src/doomsday.rs index 1529ae8..6d19a61 100644 --- a/src/doomsday.rs +++ b/src/doomsday.rs @@ -6,15 +6,10 @@ use std::{ time::{Duration, Instant}, }; -use log::info; -use tracing::{debug, error}; +use tracing::{debug, error, info}; use crate::sync::Mutex; -#[deprecated( - since = "0.5.1", - note = "please use `fluvio_future::task::JoinHandle` instead" -)] -pub use crate::task::JoinHandle; +use crate::task::JoinHandle; #[derive(Clone)] /// DoomsdayTimer will configurably panic or exit if it is not diff --git a/src/fs/bounded.rs b/src/fs/bounded.rs index c2953fd..409c0a6 100644 --- a/src/fs/bounded.rs +++ b/src/fs/bounded.rs @@ -9,7 +9,7 @@ use std::path::PathBuf; use std::fmt; -use log::trace; +use tracing::trace; use pin_utils::unsafe_pinned; use pin_utils::unsafe_unpinned; @@ -190,7 +190,7 @@ mod tests { use std::io::SeekFrom; use std::path::Path; - use log::debug; + use tracing::debug; use crate::test_async; use futures_lite::AsyncReadExt; diff --git a/src/fs/extension.rs b/src/fs/extension.rs index a7321c6..bedbfd1 100644 --- a/src/fs/extension.rs +++ b/src/fs/extension.rs @@ -8,7 +8,7 @@ use std::os::unix::io::AsRawFd; use async_trait::async_trait; use futures_lite::AsyncSeekExt; -use log::trace; +use tracing::trace; #[cfg(unix)] use crate::file_slice::AsyncFileSlice; @@ -88,14 +88,13 @@ mod tests { use std::io::SeekFrom; use std::io::Write; - use async_std::io::prelude::SeekExt; - use flv_util::fixture::ensure_clean_file; use super::AsyncFileExtension; use crate::fs::util as file_util; use crate::test_async; use futures_lite::AsyncReadExt; + use futures_lite::AsyncSeekExt; use futures_lite::AsyncWriteExt; // sync seek write and read diff --git a/src/fs/mmap.rs b/src/fs/mmap.rs index 413c441..2466bf8 100644 --- a/src/fs/mmap.rs +++ b/src/fs/mmap.rs @@ -26,6 +26,7 @@ impl MemoryMappedMutFile { .read(true) .write(true) .create(true) + .truncate(false) .open(inner_path) .unwrap(); diff --git a/src/http_client/async_std_compat.rs b/src/http_client/async_std_compat.rs deleted file mode 100644 index e92c0a1..0000000 --- a/src/http_client/async_std_compat.rs +++ /dev/null @@ -1,136 +0,0 @@ -#![allow(dead_code)] // only for http-client part 1 - -use std::{ - future::Future, - pin::Pin, - sync::Arc, - task::{Context, Poll}, -}; - -use anyhow::{anyhow, Error}; -use async_rustls::rustls::ClientConfig; -use async_std::io::{Read, Write}; -use hyper::{ - client::connect::{Connected, Connection}, - rt, - service::Service, - Uri, -}; - -use crate::{ - net::TcpStream, - rust_tls::{DefaultClientTlsStream, TlsConnector}, -}; - -const DEFAULT_PORT: u16 = 443; - -#[derive(Clone)] -pub struct CompatConnector(Arc); - -impl CompatConnector { - pub fn new(tls_config: ClientConfig) -> Self { - Self(Arc::new(TlsConnector::from(Arc::new(tls_config)))) - } -} - -impl Service for CompatConnector { - type Response = TlsStream; - type Error = Error; - type Future = - Pin> + Send + 'static>>; - - fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, uri: Uri) -> Self::Future { - let connector = self.0.clone(); - - let fut = async move { - let host = uri.host().ok_or_else(|| { - let uri = uri.clone(); - anyhow!("no host defined: {uri}") - })?; - - match uri.scheme_str() { - Some("https") => { - let port = uri.port_u16().unwrap_or(DEFAULT_PORT); - let tcp_stream = TcpStream::connect((host, port)) - .await - .map_err(|err| anyhow!("{err}"))?; - - let host = host - .try_into() - .map_err(|err| anyhow!("invalid DNS: {err}"))?; - let stream = connector.connect(host, tcp_stream).await?; - Ok(TlsStream(stream)) - } - Some(scheme) => Err(anyhow!("unsupported protocol: {scheme}")), - _ => Err(anyhow!("no scheme provided")), - } - }; - - Box::pin(fut) - } -} - -pub struct TlsStream(DefaultClientTlsStream); - -impl Connection for TlsStream { - fn connected(&self) -> Connected { - Connected::new() - } -} - -impl tokio::io::AsyncRead for TlsStream { - fn poll_read( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &mut tokio::io::ReadBuf<'_>, - ) -> Poll> { - match Pin::new(&mut self.0).poll_read(cx, buf.initialize_unfilled())? { - Poll::Ready(bytes_read) => { - buf.advance(bytes_read); - Poll::Ready(Ok(())) - } - Poll::Pending => Poll::Pending, - } - } -} - -impl tokio::io::AsyncWrite for TlsStream { - fn poll_write( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &[u8], - ) -> Poll> { - Pin::new(&mut self.0).poll_write(cx, buf) - } - - fn poll_flush( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll> { - Pin::new(&mut self.0).poll_flush(cx) - } - - fn poll_shutdown( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll> { - Pin::new(&mut self.0).poll_close(cx) - } -} - -#[derive(Clone)] -pub struct CompatExecutor; - -impl rt::Executor for CompatExecutor -where - F: Future + Send + 'static, - F::Output: Send, -{ - fn execute(&self, fut: F) { - async_std::task::spawn(fut); - } -} diff --git a/src/http_client/client.rs b/src/http_client/client.rs deleted file mode 100644 index 241c460..0000000 --- a/src/http_client/client.rs +++ /dev/null @@ -1,113 +0,0 @@ -use std::{str::FromStr, sync::Arc}; - -use anyhow::{anyhow, Result}; -use async_rustls::rustls::{OwnedTrustAnchor, RootCertStore}; -use hyper::{Body, Uri}; -use once_cell::sync::Lazy; - -use super::{ - async_std_compat::{self, CompatConnector}, - request::RequestBuilder, - USER_AGENT, -}; - -type HyperClient = Arc>; - -#[derive(Clone)] -pub struct Client { - pub(crate) hyper: HyperClient, -} - -#[cfg_attr(feature = "__skip-http-client-cert-verification", allow(dead_code))] -static ROOT_CERT_STORE: Lazy = Lazy::new(|| { - let mut store = RootCertStore::empty(); - store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); - store -}); - -impl Default for Client { - fn default() -> Self { - let tls = async_rustls::rustls::ClientConfig::builder().with_safe_defaults(); - - #[cfg(not(feature = "__skip-http-client-cert-verification"))] - let tls = tls.with_root_certificates(ROOT_CERT_STORE.to_owned()); - - #[cfg(feature = "__skip-http-client-cert-verification")] - let tls = - tls.with_custom_certificate_verifier(Arc::new(no_verifier::NoCertificateVerification)); - - let tls = tls.with_no_client_auth(); - - let https = async_std_compat::CompatConnector::new(tls); - - let client: hyper::Client<_, hyper::Body> = hyper::Client::builder() - .executor(async_std_compat::CompatExecutor) - .build(https); - - Client { - hyper: Arc::new(client), - } - } -} - -impl Client { - pub fn new() -> Self { - Self::default() - } - - pub fn get(&self, uri: impl AsRef) -> Result { - let uri = Uri::from_str(uri.as_ref())?; - let req = http::request::Builder::new().uri(uri); - Ok(RequestBuilder::new(self.clone(), req)) - } - - pub async fn send>( - &self, - req: http::Request, - ) -> Result, anyhow::Error> { - // convert http::Request into hyper::Request - let (mut parts, body) = req.into_parts(); - let body: hyper::Body = body.into(); - if !parts.headers.contains_key(http::header::USER_AGENT) { - let agent = http::header::HeaderValue::from_static(USER_AGENT); - parts.headers.append(http::header::USER_AGENT, agent); - } - let req = hyper::Request::::from_parts(parts, body); - self.hyper - .request(req) - .await - .map_err(|err| anyhow!("request error: {err:?}")) - } -} - -#[cfg(feature = "__skip-http-client-cert-verification")] -mod no_verifier { - use std::time::SystemTime; - - use async_rustls::rustls::{ - client::{ServerCertVerified, ServerCertVerifier}, - Certificate, Error, ServerName, - }; - - pub struct NoCertificateVerification; - - impl ServerCertVerifier for NoCertificateVerification { - fn verify_server_cert( - &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], - _server_name: &ServerName, - _scts: &mut dyn Iterator, - _ocsp_response: &[u8], - _now: SystemTime, - ) -> Result { - Ok(ServerCertVerified::assertion()) - } - } -} diff --git a/src/http_client/mod.rs b/src/http_client/mod.rs deleted file mode 100644 index 3150eb5..0000000 --- a/src/http_client/mod.rs +++ /dev/null @@ -1,28 +0,0 @@ -mod async_std_compat; -pub mod client; -mod request; - -use anyhow::Result; -pub use client::Client; -pub use hyper::StatusCode; -pub use request::ResponseExt; - -use hyper::{Body, Response}; - -pub const USER_AGENT: &str = "fluvio-futures-http/0.1"; - -/// for simple get requests -pub async fn get(uri: impl AsRef) -> Result> { - Client::new().get(uri)?.send().await -} - -/// for more complex http requests -/// send via a request struct -/// let req = http::Request::get(&uri) -/// .header("foo", "bar") -/// .body("")?; -/// let resp = http_client::send(&htreq).await.expect(&failmsg); -pub async fn send>(req: http::Request) -> Result> { - let client = Client::new(); - client.send(req).await -} diff --git a/src/http_client/request.rs b/src/http_client/request.rs deleted file mode 100644 index bda9446..0000000 --- a/src/http_client/request.rs +++ /dev/null @@ -1,99 +0,0 @@ -use std::{fmt, future::Future, pin::Pin}; - -use anyhow::{anyhow, Result}; -use futures_util::TryFutureExt; -use http::{request::Builder, HeaderName, HeaderValue}; -use hyper::{body::Bytes, Body, Response}; -use tracing::debug; - -use super::client::Client; -use super::USER_AGENT; - -pub struct RequestBuilder { - client: Client, - req_builder: Builder, -} - -impl RequestBuilder { - pub fn new(client: Client, req_builder: Builder) -> Self { - Self { - client, - req_builder, - } - } - - pub fn header(mut self, key: K, value: V) -> RequestBuilder - where - HeaderName: TryFrom, - >::Error: Into, - HeaderValue: TryFrom, - >::Error: Into, - { - self.req_builder = self.req_builder.header(key, value); - self - } - - pub async fn send(self) -> Result> { - let req = self - .req_builder - .header(http::header::USER_AGENT, USER_AGENT) - .body(hyper::Body::empty()) - .map_err(|err| anyhow!("hyper error: {err:?}"))?; - debug!(req=?req, "Request"); - self.client - .hyper - .request(req) - .map_err(|err| anyhow!("request error: {err:?}")) - .await - } -} - -// TODO: prefer static-dispatch once AFIT got stabilized in Rust v1.75 -type ResponseExtFuture = Pin + Send + 'static>>; - -pub trait ResponseExt { - fn bytes(self) -> ResponseExtFuture>; - - #[cfg(feature = "http-client-json")] - fn json(self) -> ResponseExtFuture> - where - Self: Sized + Send + 'static, - { - let fut = async move { - let bytes = self.bytes().await?; - serde_json::from_slice(&bytes).map_err(|err| anyhow!("serialization error: {err:?}")) - }; - - Box::pin(fut) - } - - fn body_string(self) -> ResponseExtFuture> - where - Self: Sized + Send + 'static, - { - let fut = async move { - let body = self.bytes().await?; - let body_str = std::str::from_utf8(&body)?; - Ok(body_str.to_string()) - }; - - Box::pin(fut) - } -} - -impl ResponseExt for Response -where - T: hyper::body::HttpBody + Send + 'static, - T::Data: Send, - T::Error: fmt::Debug, -{ - fn bytes(self) -> ResponseExtFuture> { - let fut = async move { - hyper::body::to_bytes(self.into_body()) - .map_err(|err| anyhow!("{err:?}")) - .await - }; - - Box::pin(fut) - } -} diff --git a/src/lib.rs b/src/lib.rs index f8e7c96..18f297d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,8 @@ #[cfg(unix)] pub mod file_slice; -#[cfg(all(feature = "fs", not(target_arch = "wasm32")))] +#[cfg(feature = "fs")] +#[cfg(not(target_arch = "wasm32"))] pub mod fs; #[cfg(feature = "io")] @@ -21,10 +22,10 @@ pub mod retry; mod test_util; #[cfg(any(test, feature = "fixture"))] -pub use fluvio_test_derive::test_async; +pub use fluvio_future_derive::test_async; #[cfg(any(test, feature = "fixture"))] -pub use fluvio_test_derive::test; +pub use fluvio_future_derive::test; #[cfg(all(unix, feature = "zero_copy"))] pub mod zero_copy; @@ -35,22 +36,19 @@ pub mod net; #[cfg(all(any(unix, windows), feature = "rust_tls"))] pub mod rust_tls; -#[cfg(all(any(unix, windows), feature = "rust_tls", not(feature = "native2_tls")))] +#[cfg(all(any(unix, windows), feature = "rust_tls", not(feature = "native_tls")))] pub use rust_tls as tls; -#[cfg(all(any(unix, windows), feature = "native2_tls"))] +#[cfg(all(any(unix, windows), feature = "native_tls"))] pub mod native_tls; -#[cfg(all(any(unix, windows), feature = "native2_tls", not(feature = "rust_tls")))] +#[cfg(all(any(unix, windows), feature = "native_tls", not(feature = "rust_tls")))] pub use crate::native_tls as tls; #[cfg(feature = "openssl_tls")] #[cfg(not(target_arch = "wasm32"))] pub mod openssl; -#[cfg(all(any(unix, windows), feature = "http-client"))] -pub mod http_client; - #[cfg(feature = "sync")] pub mod sync; @@ -75,8 +73,12 @@ pub mod subscriber { } #[cfg(feature = "doomsday")] +#[cfg(not(target_arch = "wasm32"))] pub mod doomsday; +#[cfg(feature = "attributes")] +pub use fluvio_future_derive::main_async; + /// re-export tracing pub mod tracing { diff --git a/src/native_tls.rs b/src/native_tls.rs index f9933e8..c8300f4 100644 --- a/src/native_tls.rs +++ b/src/native_tls.rs @@ -29,14 +29,12 @@ mod split { } mod connector { - use std::io::Error as IoError; use std::io::ErrorKind; use std::sync::Arc; - use async_native_tls::Error as NativeTlsError; use async_trait::async_trait; - use log::debug; + use tracing::debug; use crate::net::{ tcp_stream::{stream, stream_with_opts, SocketOpts}, @@ -46,23 +44,6 @@ mod connector { use super::*; - pub enum TlsError { - Io(IoError), - Native(NativeTlsError), - } - - impl From for TlsError { - fn from(error: IoError) -> Self { - Self::Io(error) - } - } - - impl From for TlsError { - fn from(error: NativeTlsError) -> TlsError { - Self::Native(error) - } - } - /// connect as anonymous client #[derive(Clone)] pub struct TlsAnonymousConnector(Arc); @@ -172,10 +153,8 @@ mod connector { pub use cert::*; mod cert { - use std::io::Error as IoError; - use std::io::ErrorKind; - use crate::net::certs::CertBuilder; + use anyhow::{Context, Result}; use native_tls::Certificate as NativeCertificate; use native_tls::Identity; use openssl::pkcs12::Pkcs12; @@ -193,20 +172,13 @@ mod cert { } impl X509PemBuilder { - pub fn build(self) -> Result { - let cert = Certificate::from_pem(&self.0).map_err(|err| { - IoError::new(ErrorKind::InvalidInput, format!("invalid cert: {}", err)) - })?; + pub fn build(self) -> Result { + let cert = Certificate::from_pem(&self.0).context("invalid cert")?; Ok(cert) } - pub fn build_native(self) -> Result { - NativeCertificate::from_pem(&self.0).map_err(|err| { - IoError::new( - ErrorKind::InvalidInput, - format!("invalid pem file: {}", err), - ) - }) + pub fn build_native(self) -> Result { + NativeCertificate::from_pem(&self.0).context("invalid pem file") } } @@ -219,10 +191,8 @@ mod cert { } impl PrivateKeyBuilder { - pub fn build(self) -> Result { - let key = PrivateKey::private_key_from_pem(&self.0).map_err(|err| { - IoError::new(ErrorKind::InvalidInput, format!("invalid key: {}", err)) - })?; + pub fn build(self) -> Result { + let key = PrivateKey::private_key_from_pem(&self.0).context("invalid key")?; Ok(key) } } @@ -239,7 +209,7 @@ mod cert { impl IdentityBuilder { /// load pk12 from x509 certs - pub fn from_x509(x509: X509PemBuilder, key: PrivateKeyBuilder) -> Result { + pub fn from_x509(x509: X509PemBuilder, key: PrivateKeyBuilder) -> Result { let server_key = key.build()?; let server_crt = x509.build()?; let p12 = Pkcs12::builder() @@ -247,21 +217,14 @@ mod cert { .pkey(&server_key) .cert(&server_crt) .build2(PASSWORD) - .map_err(|e| { - IoError::new( - ErrorKind::InvalidData, - format!("Failed to create Pkcs12: {}", e), - ) - })?; + .context("Failed to create Pkcs12")?; let der = p12.to_der()?; Ok(Self(der)) } - pub fn build(self) -> Result { - Identity::from_pkcs12(&self.0, PASSWORD).map_err(|e| { - IoError::new(ErrorKind::InvalidData, format!("Failed to load der: {}", e)) - }) + pub fn build(self) -> Result { + Identity::from_pkcs12(&self.0, PASSWORD).context("Failed to load der") } } } @@ -269,10 +232,7 @@ mod cert { pub use builder::*; mod builder { - - use std::io::Error as IoError; - use std::io::ErrorKind; - + use anyhow::{Context, Result}; use native_tls::Identity; use native_tls::TlsAcceptor as NativeTlsAcceptor; @@ -284,10 +244,9 @@ mod builder { pub struct ConnectorBuilder(TlsConnector); impl ConnectorBuilder { - pub fn identity(builder: IdentityBuilder) -> Result { + pub fn identity(builder: IdentityBuilder) -> Result { let identity = builder.build()?; let connector = TlsConnector::new().identity(identity); - //connector.min_protocol_version(Some()) Ok(Self(connector)) } @@ -313,7 +272,7 @@ mod builder { Self(connector) } - pub fn add_root_certificate(self, builder: X509PemBuilder) -> Result { + pub fn add_root_certificate(self, builder: X509PemBuilder) -> Result { let certificate = builder.build_native()?; let connector = self.0.add_root_certificate(certificate); Ok(Self(connector)) @@ -327,104 +286,25 @@ mod builder { pub struct AcceptorBuilder(Identity); impl AcceptorBuilder { - pub fn identity(builder: IdentityBuilder) -> Result { + pub fn identity(builder: IdentityBuilder) -> Result { let identity = builder.build()?; Ok(Self(identity)) } - pub fn build(self) -> Result { - let acceptor = NativeTlsAcceptor::new(self.0) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert"))?; + pub fn build(self) -> Result { + let acceptor = NativeTlsAcceptor::new(self.0).context("invalid cert")?; Ok(acceptor.into()) } } } -#[deprecated] -#[allow(deprecated)] -pub use stream::AllTcpStream; - -mod stream { - - use std::io; - use std::pin::Pin; - use std::task::{Context, Poll}; - - use super::DefaultClientTlsStream; - use super::TcpStream; - use futures_lite::{AsyncRead, AsyncWrite}; - use pin_project::pin_project; - - #[deprecated] - #[pin_project(project = EnumProj)] - pub enum AllTcpStream { - Tcp(#[pin] TcpStream), - Tls(#[pin] DefaultClientTlsStream), - } - - #[allow(deprecated)] - impl AllTcpStream { - pub fn tcp(stream: TcpStream) -> Self { - #[allow(deprecated)] - Self::Tcp(stream) - } - - pub fn tls(stream: DefaultClientTlsStream) -> Self { - #[allow(deprecated)] - Self::Tls(stream) - } - } - - #[allow(deprecated)] - impl AsyncRead for AllTcpStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_read(cx, buf), - EnumProj::Tls(stream) => stream.poll_read(cx, buf), - } - } - } - - #[allow(deprecated)] - impl AsyncWrite for AllTcpStream { - fn poll_write( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &[u8], - ) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_write(cx, buf), - EnumProj::Tls(stream) => stream.poll_write(cx, buf), - } - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_flush(cx), - EnumProj::Tls(stream) => stream.poll_flush(cx), - } - } - - fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_close(cx), - EnumProj::Tls(stream) => stream.poll_close(cx), - } - } - } -} - #[cfg(test)] mod test { - use std::io::Error as IoError; use std::net::SocketAddr; use std::time; + use anyhow::Result; use async_native_tls::TlsAcceptor; use async_native_tls::TlsConnector; use bytes::Buf; @@ -434,10 +314,10 @@ mod test { use futures_lite::future::zip; use futures_lite::stream::StreamExt; use futures_util::sink::SinkExt; - use log::debug; use tokio_util::codec::BytesCodec; use tokio_util::codec::Framed; use tokio_util::compat::FuturesAsyncReadCompatExt; + use tracing::debug; use crate::net::certs::CertBuilder; use crate::net::tcp_stream::stream; @@ -445,10 +325,8 @@ mod test { use crate::test_async; use crate::timer::sleep; - #[allow(deprecated)] use super::{ - AcceptorBuilder, AllTcpStream, ConnectorBuilder, IdentityBuilder, PrivateKeyBuilder, - X509PemBuilder, + AcceptorBuilder, ConnectorBuilder, IdentityBuilder, PrivateKeyBuilder, X509PemBuilder, }; const CA_PATH: &str = "certs/test-certs/ca.crt"; @@ -466,7 +344,7 @@ mod test { } #[test_async] - async fn test_native_tls_pk12() -> Result<(), IoError> { + async fn test_native_tls_pk12() -> Result<()> { const PK12_PORT: u16 = 9900; let acceptor = AcceptorBuilder::identity( @@ -507,7 +385,7 @@ mod test { #[test_async] #[cfg(not(windows))] - async fn test_native_tls_x509() -> Result<(), IoError> { + async fn test_native_tls_x509() -> Result<()> { const X500_PORT: u16 = 9910; let acceptor = AcceptorBuilder::identity( @@ -568,11 +446,7 @@ mod test { Ok(()) } - async fn test_tls( - port: u16, - acceptor: TlsAcceptor, - connector: TlsConnector, - ) -> Result<(), IoError> { + async fn test_tls(port: u16, acceptor: TlsAcceptor, connector: TlsConnector) -> Result<()> { const TEST_ITERATION: u16 = 2; let addr = format!("127.0.0.1:{}", port) @@ -606,7 +480,7 @@ mod test { // sleep 1 seconds so we don't lost connection sleep(time::Duration::from_secs(1)).await; - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let client_ft = async { @@ -619,9 +493,7 @@ mod test { .await .expect("tls failed"); - #[allow(deprecated)] - let all_stream = AllTcpStream::Tls(tls_stream); - let mut framed = Framed::new(all_stream.compat(), BytesCodec::new()); + let mut framed = Framed::new(tls_stream.compat(), BytesCodec::new()); debug!("client: got connection. waiting"); for i in 0..TEST_ITERATION { @@ -641,7 +513,7 @@ mod test { assert_eq!(values.len(), 2); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let _ = zip(client_ft, server_ft).await; diff --git a/src/net/mod.rs b/src/net/mod.rs index 260bb68..1791d27 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -9,19 +9,15 @@ pub use conn::*; #[cfg(not(target_arch = "wasm32"))] pub use unix_connector::DefaultTcpDomainConnector as DefaultDomainConnector; -#[cfg(not(target_arch = "wasm32"))] -#[deprecated(since = "0.3.3", note = "Please use the bar DefaultDomainConnector")] -pub use unix_connector::DefaultTcpDomainConnector; - #[cfg(target_arch = "wasm32")] pub use wasm_connector::DefaultDomainWebsocketConnector as DefaultDomainConnector; mod conn { - use std::io::Error as IoError; - use async_trait::async_trait; use futures_lite::io::{AsyncRead, AsyncWrite}; + use std::io::Error as IoError; + pub trait Connection: AsyncRead + AsyncWrite + Send + Sync + Unpin + SplitConnection {} impl Connection for T {} @@ -90,21 +86,21 @@ pub mod certs { use std::fs::File; use std::io::BufRead; use std::io::BufReader; - use std::io::Error as IoError; use std::path::Path; - use log::debug; + use anyhow::Result; + use tracing::debug; pub trait CertBuilder: Sized { fn new(bytes: Vec) -> Self; - fn from_reader(reader: &mut dyn BufRead) -> Result { + fn from_reader(reader: &mut dyn BufRead) -> Result { let mut bytes = vec![]; reader.read_to_end(&mut bytes)?; Ok(Self::new(bytes)) } - fn from_path(path: impl AsRef) -> Result { + fn from_path(path: impl AsRef) -> Result { debug!("loading cert from: {}", path.as_ref().display()); let mut reader = BufReader::new(File::open(path)?); Self::from_reader(&mut reader) @@ -119,6 +115,7 @@ mod wasm_connector { use futures_util::io::AsyncReadExt; use std::io::Error as IoError; use ws_stream_wasm::WsMeta; + #[derive(Clone, Default)] pub struct DefaultDomainWebsocketConnector {} impl DefaultDomainWebsocketConnector { @@ -152,10 +149,9 @@ mod wasm_connector { #[cfg(not(target_arch = "wasm32"))] mod unix_connector { - use std::io::Error as IoError; - use async_trait::async_trait; - use log::debug; + use std::io::Error as IoError; + use tracing::debug; use super::tcp_stream::stream; @@ -208,7 +204,7 @@ mod test { use futures_lite::future::zip; use futures_lite::stream::StreamExt; use futures_util::AsyncReadExt; - use log::debug; + use tracing::debug; use crate::net::tcp_stream::stream; use crate::net::TcpListener; diff --git a/src/net/tcp_stream.rs b/src/net/tcp_stream.rs index 4bd71bb..3ba84da 100644 --- a/src/net/tcp_stream.rs +++ b/src/net/tcp_stream.rs @@ -121,10 +121,10 @@ mod tests { use futures_lite::AsyncReadExt; use futures_util::SinkExt; use futures_util::StreamExt; - use log::debug; use tokio_util::codec::BytesCodec; use tokio_util::codec::Framed; use tokio_util::compat::FuturesAsyncReadCompatExt; + use tracing::debug; fn to_bytes(bytes: Vec) -> Bytes { let mut buf = BytesMut::with_capacity(bytes.len()); diff --git a/src/openssl/acceptor.rs b/src/openssl/acceptor.rs index 675700a..22ac124 100644 --- a/src/openssl/acceptor.rs +++ b/src/openssl/acceptor.rs @@ -1,12 +1,13 @@ -use futures_lite::io::{AsyncRead, AsyncWrite}; -use openssl::ssl; use std::fmt; use std::path::Path; use std::sync::Arc; +use anyhow::Result; +use futures_lite::io::{AsyncRead, AsyncWrite}; +use openssl::ssl; + use super::async_to_sync_wrapper::AsyncToSyncWrapper; use super::certificate::{Certificate, PrivateKey}; -use super::error::Result; use super::handshake::HandshakeFuture; use super::stream::TlsStream; diff --git a/src/openssl/certificate.rs b/src/openssl/certificate.rs index fa6ad8f..a3257e5 100644 --- a/src/openssl/certificate.rs +++ b/src/openssl/certificate.rs @@ -1,8 +1,7 @@ +use anyhow::Result; use openssl::pkey::{PKey, Private}; use openssl::x509::X509; -use super::error::Result; - #[derive(Debug)] pub struct Certificate(pub X509); diff --git a/src/openssl/connector.rs b/src/openssl/connector.rs index 3402a31..4f7d21f 100644 --- a/src/openssl/connector.rs +++ b/src/openssl/connector.rs @@ -1,12 +1,14 @@ use std::fmt; -use std::io; +use std::io::Error as IoError; +use std::io::ErrorKind; use std::path::Path; +use anyhow::{Context, Result}; use async_trait::async_trait; use futures_lite::io::{AsyncRead, AsyncWrite}; -use log::debug; use openssl::ssl; use openssl::x509::verify::X509VerifyFlags; +use tracing::debug; use crate::net::{ tcp_stream::{stream, stream_with_opts, SocketOpts}, @@ -16,7 +18,6 @@ use crate::net::{ use super::async_to_sync_wrapper::AsyncToSyncWrapper; use super::certificate::Certificate; -use super::error::Result; use super::handshake::HandshakeFuture; use super::stream::TlsStream; @@ -24,9 +25,7 @@ use super::stream::TlsStream; // TODO: simplification pub mod certs { - use std::io::Error as IoError; - use std::io::ErrorKind; - + use anyhow::{Context, Result}; use openssl::pkcs12::Pkcs12; use openssl::pkey::Private; @@ -41,7 +40,7 @@ pub mod certs { // copied from https://github.com/sfackler/rust-native-tls/blob/master/src/imp/openssl.rs mod identity_impl { - use crate::openssl::TlsError::CertReadError; + use anyhow::{anyhow, Result}; use openssl::pkcs12::Pkcs12; use openssl::pkey::{PKey, Private}; use openssl::x509::X509; @@ -54,17 +53,13 @@ pub mod certs { } impl Identity { - pub fn from_pkcs12(buf: &[u8], pass: &str) -> anyhow::Result { + pub fn from_pkcs12(buf: &[u8], pass: &str) -> Result { let pkcs12 = Pkcs12::from_der(buf)?; let parsed = pkcs12 .parse2(pass) - .map_err(|_| CertReadError(String::from("Couldn't read pkcs12")))?; - let pkey = parsed - .pkey - .ok_or(CertReadError(String::from("Missing private key")))?; - let cert = parsed - .cert - .ok_or(CertReadError(String::from("Missing cert")))?; + .map_err(|err| anyhow!("Couldn't read pkcs12 {err}"))?; + let pkey = parsed.pkey.ok_or(anyhow!("Missing private key"))?; + let cert = parsed.cert.ok_or(anyhow!("Missing cert"))?; Ok(Identity { pkey, cert, @@ -95,10 +90,8 @@ pub mod certs { } impl X509PemBuilder { - pub fn build(self) -> Result { - let cert = Certificate::from_pem(&self.0).map_err(|err| { - IoError::new(ErrorKind::InvalidInput, format!("invalid cert: {}", err)) - })?; + pub fn build(self) -> Result { + let cert = Certificate::from_pem(&self.0).context("invalid cert")?; Ok(cert) } } @@ -114,10 +107,8 @@ pub mod certs { } impl PrivateKeyBuilder { - pub fn build(self) -> Result { - let key = PrivateKey::private_key_from_pem(&self.0).map_err(|err| { - IoError::new(ErrorKind::InvalidInput, format!("invalid key: {}", err)) - })?; + pub fn build(self) -> Result { + let key = PrivateKey::private_key_from_pem(&self.0).context("invalid key")?; Ok(key) } } @@ -132,7 +123,7 @@ pub mod certs { impl IdentityBuilder { /// load pk12 from x509 certs - pub fn from_x509(x509: X509PemBuilder, key: PrivateKeyBuilder) -> Result { + pub fn from_x509(x509: X509PemBuilder, key: PrivateKeyBuilder) -> Result { let server_key = key.build()?; let server_crt = x509.build()?; let p12 = Pkcs12::builder() @@ -140,21 +131,14 @@ pub mod certs { .pkey(&server_key) .cert(server_crt.inner()) .build2(PASSWORD) - .map_err(|e| { - IoError::new( - ErrorKind::InvalidData, - format!("Failed to create Pkcs12: {}", e), - ) - })?; + .context("Failed to create Pkcs12")?; let der = p12.to_der()?; Ok(Self(der)) } - pub fn build(self) -> Result { - Identity::from_pkcs12(&self.0, PASSWORD).map_err(|e| { - IoError::new(ErrorKind::InvalidData, format!("Failed to load der: {}", e)) - }) + pub fn build(self) -> Result { + Identity::from_pkcs12(&self.0, PASSWORD).context("Failed to load der") } } } @@ -243,7 +227,7 @@ impl TlsConnectorBuilder { /// set identity pub fn with_identity(mut self, builder: certs::IdentityBuilder) -> Result { - let identity = builder.build()?; + let identity = builder.build().context("failed to build identity")?; self.inner.set_certificate(identity.cert())?; self.inner.set_private_key(identity.pkey())?; for cert in identity.chain().iter().rev() { @@ -276,7 +260,7 @@ impl TcpDomainConnector for TlsAnonymousConnector { async fn connect( &self, domain: &str, - ) -> io::Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { debug!("tcp connect: {}", domain); let socket_opts = SocketOpts { keepalive: Some(Default::default()), @@ -289,7 +273,12 @@ impl TcpDomainConnector for TlsAnonymousConnector { .0 .connect(domain, tcp_stream) .await - .map_err(|err| err.into_io_error())? + .map_err(|e| { + IoError::new( + ErrorKind::ConnectionRefused, + format!("failed to connect: {}", e), + ) + })? .split_connection(); Ok((write, read, fd)) @@ -321,7 +310,7 @@ impl TcpDomainConnector for TlsDomainConnector { async fn connect( &self, addr: &str, - ) -> io::Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { debug!("connect to tls addr: {}", addr); let tcp_stream = stream(addr).await?; let fd = tcp_stream.as_connection_fd(); @@ -330,7 +319,12 @@ impl TcpDomainConnector for TlsDomainConnector { .connector .connect(&self.domain, tcp_stream) .await - .map_err(|err| err.into_io_error())? + .map_err(|e| { + IoError::new( + ErrorKind::ConnectionRefused, + format!("failed to connect: {}", e), + ) + })? .split_connection(); debug!("connect to tls domain: {}", self.domain); diff --git a/src/openssl/error.rs b/src/openssl/error.rs deleted file mode 100644 index 9bc0910..0000000 --- a/src/openssl/error.rs +++ /dev/null @@ -1,39 +0,0 @@ -use std::fmt::Debug; - -use thiserror::Error; - -use super::async_to_sync_wrapper::AsyncToSyncWrapper; - -#[derive(Error, Debug)] -pub enum Error { - #[error("CertReadError: {0}")] - CertReadError(String), - - #[error("OpenSslError: {0}")] - OpenSslError(#[from] openssl::error::Error), - - #[error("HandshakeError: {0}")] - HandshakeError(Box), - - #[error("ErrorStack: {0}")] - ErrorStack(#[from] openssl::error::ErrorStack), - - #[error("IoError: {0}")] - IoError(#[from] std::io::Error), -} - -impl From>> - for Error -{ - fn from(handshake_error: openssl::ssl::HandshakeError>) -> Self { - Self::HandshakeError(Box::new(handshake_error)) - } -} - -impl Error { - pub fn into_io_error(self) -> std::io::Error { - std::io::Error::new(std::io::ErrorKind::Other, self) - } -} - -pub type Result = std::result::Result; diff --git a/src/openssl/handshake.rs b/src/openssl/handshake.rs index 209332f..3f42530 100644 --- a/src/openssl/handshake.rs +++ b/src/openssl/handshake.rs @@ -6,10 +6,10 @@ use std::result; use std::task::Context; use std::task::Poll; +use anyhow::{Error, Result}; use futures_lite::io::{AsyncRead, AsyncWrite}; use super::async_to_sync_wrapper::AsyncToSyncWrapper; -use super::error::Error; use super::stream::TlsStream; pub(super) enum HandshakeFuture { @@ -29,7 +29,7 @@ where >, Self: Unpin, { - type Output = Result, Error>; + type Output = Result>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let self_mut = self.get_mut(); @@ -47,7 +47,7 @@ where *self_mut = HandshakeFuture::MidHandshake(mid); Poll::Pending } - Err(e) => Poll::Ready(Err(Error::from(e))), + Err(e) => Poll::Ready(Err(Error::new(e))), } } HandshakeFuture::MidHandshake(mut stream) => { @@ -62,7 +62,7 @@ where *self_mut = HandshakeFuture::MidHandshake(mid); Poll::Pending } - Err(e) => Poll::Ready(Err(Error::from(e))), + Err(e) => Poll::Ready(Err(Error::new(e))), } } HandshakeFuture::Done => panic!("Future must not be polled after ready"), diff --git a/src/openssl/mod.rs b/src/openssl/mod.rs index 66ccda8..fd34b7b 100644 --- a/src/openssl/mod.rs +++ b/src/openssl/mod.rs @@ -2,7 +2,6 @@ mod acceptor; mod async_to_sync_wrapper; mod certificate; mod connector; -mod error; mod handshake; mod stream; @@ -14,22 +13,20 @@ pub use certificate::Certificate; pub use connector::{ certs, TlsAnonymousConnector, TlsConnector, TlsConnectorBuilder, TlsDomainConnector, }; -pub use error::Error as TlsError; pub use openssl::ssl::SslVerifyMode; -pub use stream::{AllTcpStream, TlsStream}; +pub use stream::TlsStream; pub type DefaultServerTlsStream = TlsStream; pub type DefaultClientTlsStream = TlsStream; mod split { - use async_net::TcpStream; use futures_util::AsyncReadExt; use super::*; use crate::net::{BoxReadConnection, BoxWriteConnection, SplitConnection}; - impl SplitConnection for TlsStream { + impl SplitConnection for TlsStream { fn split_connection(self) -> (BoxWriteConnection, BoxReadConnection) { let (read, write) = self.split(); (Box::new(write), Box::new(read)) diff --git a/src/openssl/stream.rs b/src/openssl/stream.rs index b976f02..28cd4fe 100644 --- a/src/openssl/stream.rs +++ b/src/openssl/stream.rs @@ -1,16 +1,12 @@ use std::fmt::Debug; use std::io; use std::io::Read; -use std::io::Result as IoResult; use std::io::Write; use std::pin::Pin; use std::task::{Context, Poll}; use futures_lite::{AsyncRead, AsyncWrite}; use openssl::ssl; -use pin_project::pin_project; - -use crate::net::TcpStream; use super::async_to_sync_wrapper::AsyncToSyncWrapper; use super::certificate::Certificate; @@ -73,55 +69,3 @@ fn result_to_poll(r: io::Result) -> Poll> { Err(e) => Poll::Ready(Err(e)), } } - -#[pin_project(project = EnumProj)] -pub enum AllTcpStream { - Tcp(#[pin] TcpStream), - Tls(#[pin] TlsStream), -} - -impl AllTcpStream { - pub fn tcp(stream: TcpStream) -> Self { - Self::Tcp(stream) - } - - pub fn tls(stream: TlsStream) -> Self { - Self::Tls(stream) - } -} - -impl AsyncRead for AllTcpStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_read(cx, buf), - EnumProj::Tls(stream) => stream.poll_read(cx, buf), - } - } -} - -impl AsyncWrite for AllTcpStream { - fn poll_write(self: Pin<&mut Self>, cx: &mut Context, buf: &[u8]) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_write(cx, buf), - EnumProj::Tls(stream) => stream.poll_write(cx, buf), - } - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_flush(cx), - EnumProj::Tls(stream) => stream.poll_flush(cx), - } - } - - fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_close(cx), - EnumProj::Tls(stream) => stream.poll_close(cx), - } - } -} diff --git a/src/openssl/test.rs b/src/openssl/test.rs index 8293f22..c3b614e 100644 --- a/src/openssl/test.rs +++ b/src/openssl/test.rs @@ -1,24 +1,23 @@ -use std::io::Error as IoError; use std::net::SocketAddr; use std::time; +use anyhow::Result; use bytes::BufMut; use bytes::Bytes; use bytes::BytesMut; use futures_lite::future::zip; use futures_lite::stream::StreamExt; use futures_util::SinkExt; -use log::debug; use tokio_util::codec::BytesCodec; use tokio_util::codec::Framed; use tokio_util::compat::FuturesAsyncReadCompatExt; +use tracing::debug; use crate::net::{tcp_stream::stream, TcpListener}; use crate::test_async; use crate::timer::sleep; -use super::TlsError; -use super::{AllTcpStream, TlsAcceptor, TlsConnector}; +use super::{TlsAcceptor, TlsConnector}; const CA_PATH: &str = "certs/test-certs/ca.crt"; const INTERMEDIATE_CA_PATH: &str = "certs/test-certs/intermediate-ca.crt"; @@ -31,7 +30,7 @@ fn to_bytes(bytes: Vec) -> Bytes { } #[test_async] -async fn test_tls() -> Result<(), TlsError> { +async fn test_tls() -> Result<()> { // Test the client against a server with CA intermediary cert chain // Requires X509VerifyFlags::PARTIAL_CHAIN or allow_partial: true (default) run_test( @@ -88,7 +87,7 @@ async fn test_tls() -> Result<(), TlsError> { Ok(()) } -async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), IoError> { +async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<()> { let addr = "127.0.0.1:19988".parse::().expect("parse"); let server_ft = async { @@ -135,7 +134,7 @@ async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), .expect("send failed"); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let client_ft = async { @@ -147,8 +146,7 @@ async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), .connect("localhost", tcp_stream) .await .expect("tls failed"); - let all_stream = AllTcpStream::Tls(tls_stream); - let mut framed = Framed::new(all_stream.compat(), BytesCodec::new()); + let mut framed = Framed::new(tls_stream.compat(), BytesCodec::new()); debug!("client: got connection. waiting"); for i in 0..ITER { @@ -170,7 +168,7 @@ async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), assert_eq!(message, format!("message{}reply", i)); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let _ = zip(client_ft, server_ft).await; diff --git a/src/rust_tls.rs b/src/rust_tls.rs index 476b422..84dfb19 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -1,9 +1,9 @@ use crate::net::TcpStream; -pub use async_rustls::client::TlsStream as ClientTlsStream; -pub use async_rustls::server::TlsStream as ServerTlsStream; -pub use async_rustls::TlsAcceptor; -pub use async_rustls::TlsConnector; +pub use futures_rustls::client::TlsStream as ClientTlsStream; +pub use futures_rustls::server::TlsStream as ServerTlsStream; +pub use futures_rustls::TlsAcceptor; +pub use futures_rustls::TlsConnector; pub type DefaultServerTlsStream = ServerTlsStream; pub type DefaultClientTlsStream = ClientTlsStream; @@ -38,61 +38,57 @@ mod cert { use std::fs::File; use std::io::BufRead; use std::io::BufReader; - use std::io::Error as IoError; - use std::io::ErrorKind; use std::path::Path; - use async_rustls::rustls::Certificate; - use async_rustls::rustls::PrivateKey; - use async_rustls::rustls::RootCertStore; + use anyhow::{anyhow, Context, Result}; + use futures_rustls::rustls::pki_types::CertificateDer; + use futures_rustls::rustls::pki_types::PrivateKeyDer; + use futures_rustls::rustls::RootCertStore; use rustls_pemfile::certs; - use rustls_pemfile::rsa_private_keys; + use rustls_pemfile::pkcs8_private_keys; - pub fn load_certs>(path: P) -> Result, IoError> { + pub fn load_certs>(path: P) -> Result>> { load_certs_from_reader(&mut BufReader::new(File::open(path)?)) } - pub fn load_certs_from_reader(rd: &mut dyn BufRead) -> Result, IoError> { - certs(rd) - .map(|v| v.into_iter().map(Certificate).collect()) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert")) + pub fn load_certs_from_reader(rd: &mut dyn BufRead) -> Result>> { + certs(rd).map(|r| r.context("invalid cert")).collect() } /// Load the passed keys file - pub fn load_keys>(path: P) -> Result, IoError> { + pub fn load_keys>(path: P) -> Result>> { load_keys_from_reader(&mut BufReader::new(File::open(path)?)) } - pub fn load_keys_from_reader(rd: &mut dyn BufRead) -> Result, IoError> { - rsa_private_keys(rd) - .map(|v| v.into_iter().map(PrivateKey).collect()) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid key")) + pub fn load_keys_from_reader(rd: &mut dyn BufRead) -> Result>> { + pkcs8_private_keys(rd) + .map(|r| r.map(|p| p.into()).context("invalid key")) + .collect() } - pub(crate) fn load_first_key>(path: P) -> Result { + pub(crate) fn load_first_key>(path: P) -> Result> { load_first_key_from_reader(&mut BufReader::new(File::open(path)?)) } - pub(crate) fn load_first_key_from_reader(rd: &mut dyn BufRead) -> Result { + pub(crate) fn load_first_key_from_reader( + rd: &mut dyn BufRead, + ) -> Result> { let mut keys = load_keys_from_reader(rd)?; if keys.is_empty() { - Err(IoError::new(ErrorKind::InvalidInput, "no keys found")) + Err(anyhow!("no keys found")) } else { Ok(keys.remove(0)) } } - pub fn load_root_ca>(path: P) -> Result { - let certs = load_certs(path) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid ca crt"))?; + pub fn load_root_ca>(path: P) -> Result { + let certs = load_certs(path).map_err(|err| err.context("invalid ca crt"))?; let mut root_store = RootCertStore::empty(); - for cert in &certs { - root_store - .add(cert) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid ca crt"))?; + for cert in certs { + root_store.add(cert).context("invalid ca crt")?; } Ok(root_store) @@ -101,12 +97,11 @@ mod cert { mod connector { use std::io::Error as IoError; - use std::io::ErrorKind; - use async_rustls::rustls::ServerName; use async_trait::async_trait; - use log::debug; + use futures_rustls::rustls::pki_types::ServerName; + use tracing::debug; use crate::net::{ tcp_stream::stream, AsConnectionFd, BoxReadConnection, BoxWriteConnection, ConnectionFd, @@ -135,17 +130,17 @@ mod connector { ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { let tcp_stream = stream(domain).await?; let fd = tcp_stream.as_connection_fd(); + + let server_name = ServerName::try_from(domain).map_err(|err| { + IoError::new( + ErrorKind::InvalidInput, + format!("Invalid Dns Name: {}", err), + ) + })?; + let (write, read) = self .0 - .connect( - ServerName::try_from(domain).map_err(|err| { - IoError::new( - ErrorKind::InvalidInput, - format!("Invalid Dns Name: {}", err), - ) - })?, - tcp_stream, - ) + .connect(server_name.to_owned(), tcp_stream) .await? .split_connection(); Ok((write, read, fd)) @@ -182,17 +177,17 @@ mod connector { let tcp_stream = stream(addr).await?; let fd = tcp_stream.as_connection_fd(); debug!("connect to tls domain: {}", self.domain); + + let server_name = ServerName::try_from(self.domain.as_str()).map_err(|err| { + IoError::new( + ErrorKind::InvalidInput, + format!("Invalid Dns Name: {}", err), + ) + })?; + let (write, read) = self .connector - .connect( - ServerName::try_from(self.domain.as_str()).map_err(|err| { - IoError::new( - ErrorKind::InvalidInput, - format!("Invalid Dns Name: {}", err), - ) - })?, - tcp_stream, - ) + .connect(server_name.to_owned(), tcp_stream) .await? .split_connection(); Ok((write, read, fd)) @@ -213,25 +208,31 @@ mod connector { mod builder { use std::io::Cursor; - use std::io::Error as IoError; - use std::io::ErrorKind; use std::path::Path; use std::sync::Arc; - use std::time::SystemTime; - - use async_rustls::rustls::client::ServerCertVerified; - use async_rustls::rustls::server::WantsServerCert; - use async_rustls::rustls::Certificate; - use async_rustls::rustls::ClientConfig; - use async_rustls::rustls::PrivateKey; - use async_rustls::rustls::RootCertStore; - use async_rustls::rustls::ServerConfig; - use async_rustls::rustls::ServerName; - use async_rustls::rustls::{client::ServerCertVerifier, ConfigBuilder}; - use async_rustls::rustls::{client::WantsTransparencyPolicyOrClientCert, Error as TlsError}; - use async_rustls::rustls::{server::AllowAnyAuthenticatedClient, WantsVerifier}; - use async_rustls::TlsAcceptor; - use async_rustls::TlsConnector; + + use futures_rustls::pki_types::UnixTime; + use futures_rustls::rustls::client::danger::HandshakeSignatureValid; + use futures_rustls::rustls::client::danger::ServerCertVerified; + use futures_rustls::rustls::client::danger::ServerCertVerifier; + use futures_rustls::rustls::client::WantsClientCert; + use futures_rustls::rustls::pki_types::CertificateDer; + use futures_rustls::rustls::pki_types::PrivateKeyDer; + use futures_rustls::rustls::pki_types::ServerName; + use futures_rustls::rustls::server::WantsServerCert; + use futures_rustls::rustls::server::WebPkiClientVerifier; + use futures_rustls::rustls::ClientConfig; + use futures_rustls::rustls::ConfigBuilder; + use futures_rustls::rustls::Error as TlsError; + use futures_rustls::rustls::RootCertStore; + use futures_rustls::rustls::ServerConfig; + use futures_rustls::rustls::SignatureScheme; + use futures_rustls::rustls::WantsVerifier; + use futures_rustls::TlsAcceptor; + use futures_rustls::TlsConnector; + + use anyhow::{Context, Result}; + use tracing::info; use super::load_root_ca; use super::{load_certs, load_first_key_from_reader}; @@ -243,7 +244,7 @@ mod builder { impl ConnectorBuilder { pub fn with_safe_defaults() -> ConnectorBuilderStage { - ConnectorBuilderStage(ClientConfig::builder().with_safe_defaults()) + ConnectorBuilderStage(ClientConfig::builder()) } } @@ -253,22 +254,23 @@ mod builder { pub fn load_ca_cert>( self, path: P, - ) -> Result, IoError> { + ) -> Result> { let certs = load_certs(path)?; - self.with_root_certificates(&certs) + self.with_root_certificates(certs) } pub fn load_ca_cert_from_bytes( self, buffer: &[u8], - ) -> Result, IoError> { + ) -> Result> { let certs = load_certs_from_reader(&mut Cursor::new(buffer))?; - self.with_root_certificates(&certs) + self.with_root_certificates(certs) } pub fn no_cert_verification(self) -> ConnectorBuilderWithConfig { let config = self .0 + .dangerous() .with_custom_certificate_verifier(Arc::new(NoCertificateVerification)) .with_no_client_auth(); @@ -277,14 +279,12 @@ mod builder { fn with_root_certificates( self, - certs: &[Certificate], - ) -> Result, IoError> { + certs: Vec, + ) -> Result> { let mut root_store = RootCertStore::empty(); for cert in certs { - root_store - .add(cert) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid ca crt"))?; + root_store.add(cert).context("invalid ca crt")?; } Ok(ConnectorBuilderStage( @@ -293,12 +293,12 @@ mod builder { } } - impl ConnectorBuilderStage { + impl ConnectorBuilderStage { pub fn load_client_certs>( self, cert_path: P, key_path: P, - ) -> Result { + ) -> Result { let certs = load_certs(cert_path)?; let key = load_first_key(key_path)?; self.with_single_cert(certs, key) @@ -308,7 +308,7 @@ mod builder { self, cert_buf: &[u8], key_buf: &[u8], - ) -> Result { + ) -> Result { let certs = load_certs_from_reader(&mut Cursor::new(cert_buf))?; let key = load_first_key_from_reader(&mut Cursor::new(key_buf))?; self.with_single_cert(certs, key) @@ -320,13 +320,13 @@ mod builder { fn with_single_cert( self, - certs: Vec, - key: PrivateKey, - ) -> Result { + certs: Vec>, + key: PrivateKeyDer<'static>, + ) -> Result { let config = self .0 .with_client_auth_cert(certs, key) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert"))?; + .context("invalid cert")?; Ok(ConnectorBuilderWithConfig(config)) } @@ -344,7 +344,7 @@ mod builder { impl AcceptorBuilder { pub fn with_safe_defaults() -> AcceptorBuilderStage { - AcceptorBuilderStage(ServerConfig::builder().with_safe_defaults()) + AcceptorBuilderStage(ServerConfig::builder()) } } @@ -360,12 +360,16 @@ mod builder { pub fn client_authenticate>( self, path: P, - ) -> Result, IoError> { + ) -> Result> { let root_store = load_root_ca(path)?; - Ok(AcceptorBuilderStage(self.0.with_client_cert_verifier( - Arc::new(AllowAnyAuthenticatedClient::new(root_store)), - ))) + let client_verifier = WebPkiClientVerifier::builder(root_store.into()) + .build() + .context("invalid verifier")?; + + Ok(AcceptorBuilderStage( + self.0.with_client_cert_verifier(client_verifier), + )) } } @@ -374,14 +378,14 @@ mod builder { self, cert_path: impl AsRef, key_path: impl AsRef, - ) -> Result { + ) -> Result { let certs = load_certs(cert_path)?; let key = load_first_key(key_path)?; let config = self .0 .with_single_cert(certs, key) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert"))?; + .context("invalid cert")?; Ok(AcceptorBuilderWithConfig(config)) } @@ -395,49 +399,77 @@ mod builder { } } + #[derive(Debug)] struct NoCertificateVerification; impl ServerCertVerifier for NoCertificateVerification { fn verify_server_cert( &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], + _end_entity: &CertificateDer, + _intermediates: &[CertificateDer], _server_name: &ServerName, - _scts: &mut dyn Iterator, _ocsp_response: &[u8], - _now: SystemTime, + _now: UnixTime, ) -> Result { - log::debug!("ignoring server cert"); + info!("ignoring server cert"); Ok(ServerCertVerified::assertion()) } + + fn verify_tls12_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &futures_rustls::rustls::DigitallySignedStruct, + ) -> Result { + info!("ignoring server cert"); + Ok(HandshakeSignatureValid::assertion()) + } + + fn verify_tls13_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &futures_rustls::rustls::DigitallySignedStruct, + ) -> Result { + info!("ignoring server cert"); + Ok(HandshakeSignatureValid::assertion()) + } + + fn supported_verify_schemes(&self) -> Vec { + let provider = futures_rustls::rustls::crypto::aws_lc_rs::default_provider(); + provider + .signature_verification_algorithms + .supported_schemes() + } } } #[cfg(test)] mod test { - use std::io::Error as IoError; use std::net::SocketAddr; use std::time; - use async_rustls::TlsAcceptor; - use async_rustls::TlsConnector; use bytes::BufMut; use bytes::Bytes; use bytes::BytesMut; use futures_lite::future::zip; use futures_lite::stream::StreamExt; + use futures_rustls::TlsAcceptor; + use futures_rustls::TlsConnector; use futures_util::sink::SinkExt; - use log::debug; use tokio_util::codec::BytesCodec; use tokio_util::codec::Framed; use tokio_util::compat::FuturesAsyncReadCompatExt; + use tracing::debug; use fluvio_future::net::tcp_stream::stream; use fluvio_future::net::TcpListener; use fluvio_future::test_async; use fluvio_future::timer::sleep; + use anyhow::Result; + use super::{AcceptorBuilder, ConnectorBuilder}; const CA_PATH: &str = "certs/test-certs/ca.crt"; @@ -450,7 +482,7 @@ mod test { } #[test_async(ignore)] - async fn test_rust_tls_all() -> Result<(), IoError> { + async fn test_rust_tls_all() -> Result<()> { test_rustls( AcceptorBuilder::with_safe_defaults() .no_client_authentication() @@ -481,7 +513,7 @@ mod test { Ok(()) } - async fn test_rustls(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), IoError> { + async fn test_rustls(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<()> { let addr = "127.0.0.1:19998".parse::().expect("parse"); let server_ft = async { @@ -525,7 +557,7 @@ mod test { .expect("send failed"); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let client_ft = async { @@ -560,7 +592,7 @@ mod test { assert_eq!(message, format!("message{}reply", i)); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let _ = zip(client_ft, server_ft).await; diff --git a/src/task.rs b/src/task.rs index 7a2aeed..c215f65 100644 --- a/src/task.rs +++ b/src/task.rs @@ -2,8 +2,6 @@ use std::future::Future; use async_std::task; -use crate::timer::sleep; - #[cfg(feature = "task_unstable")] pub use async_std::task::spawn_local; @@ -16,29 +14,6 @@ where task::block_on(spawn_closure); } -/// run future and wait forever -/// this is typically used in the server -pub fn main(spawn_closure: F) -where - F: Future + Send + 'static, -{ - use std::time::Duration; - - task::block_on(async { - spawn_closure.await; - // do infinite loop for now - loop { - cfg_if::cfg_if! { - if #[cfg(target_arch = "wasm32")] { - sleep(Duration::from_secs(3600)).await.unwrap(); - } else { - sleep(Duration::from_secs(3600)).await; - } - } - } - }); -} - cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { pub use async_std::task::spawn_local as spawn; @@ -75,7 +50,7 @@ mod basic_test { use std::time; use futures_lite::future::zip; - use log::debug; + use tracing::debug; use crate::task::spawn; use crate::test_async; diff --git a/src/test_util.rs b/src/test_util.rs index df7a055..4f1f045 100644 --- a/src/test_util.rs +++ b/src/test_util.rs @@ -6,11 +6,11 @@ macro_rules! assert_async_block { #[cfg(not(target_arch = "wasm32"))] match fluvio_future::task::run_block_on(ft) { - Ok(_) => log::debug!("finished run"), + Ok(_) => debug!("finished run"), Err(err) => assert!(false, "error {:?}", err), } #[cfg(target_arch = "wasm32")] - fluvio_future::task::run_block_on(ft); + fluvio_future::task::run_block_on(ft) }}; } @@ -24,7 +24,7 @@ mod test { use futures_lite::future::poll_fn; use futures_lite::Future; - use log::debug; + use tracing::debug; use crate::test_async; diff --git a/src/timer.rs b/src/timer.rs index 22b29bb..a4885e7 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -69,15 +69,16 @@ mod test { use std::time::Duration; use std::time::Instant; - use log::debug; use tokio::select; + use tracing::debug; - use fluvio_future::timer::sleep; + use crate::timer::sleep; /// test timer loop #[fluvio_future::test] async fn test_sleep() { - let mut sleep_count: u16 = 0; + let mut times_fired: u16 = 0; + let mut times_not_fired: u16 = 0; let time_now = Instant::now(); let mut sleep_ft = sleep(Duration::from_millis(10)); @@ -86,9 +87,13 @@ mod test { select! { _ = &mut sleep_ft => { // fire everytime but won't make cause more delay than initial 10 ms - sleep_count += 1; + times_fired += 1; debug!("timer fired"); } + + _ = sleep(Duration::from_millis(40)) => { + times_not_fired += 1; + } } } @@ -98,6 +103,7 @@ mod test { assert!(elapsed < Duration::from_millis(1000)); // make this generous to handle slow CI assert!(elapsed > Duration::from_millis(10)); - assert_eq!(sleep_count, 10); + assert_eq!(times_fired, 1); + assert_eq!(times_not_fired, 9); } } diff --git a/src/zero_copy.rs b/src/zero_copy.rs index 90ba16a..585c9c8 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -1,4 +1,5 @@ use std::io::Error as IoError; +use std::os::fd::BorrowedFd; use std::os::unix::io::{AsRawFd, RawFd}; use std::thread::sleep; use thiserror::Error; @@ -8,8 +9,7 @@ use nix::libc::off_t; use nix::sys::sendfile::sendfile; use nix::Error as NixError; -use log::debug; -use log::trace; +use tracing::{debug, error, trace}; use crate::task::spawn_blocking; @@ -48,8 +48,8 @@ impl ZeroCopy { impl ZeroCopy { pub async fn copy_slice(&self, source: &AsyncFileSlice) -> Result { let size = source.len(); - let target_fd = self.0; - let source_fd = source.fd(); + let target_raw_fd = self.0; + let source_raw_fd = source.fd(); #[cfg(target_os = "linux")] let ft = { @@ -59,15 +59,18 @@ impl ZeroCopy { let mut total_transferred: usize = 0; // total bytes transferred so far let mut current_offset = offset; + let target_fd = unsafe { BorrowedFd::borrow_raw(target_raw_fd) }; + let source_fd = unsafe { BorrowedFd::borrow_raw(source_raw_fd) }; + loop { let to_be_transfer = size as usize - total_transferred; trace!( - "trying: zero copy source fd: {} offset: {} len: {}, target: fd{}", - source_fd, + "trying: zero copy source fd: {} offset: {} len: {}, target fd: {}", + source_raw_fd, current_offset, to_be_transfer, - target_fd + target_raw_fd ); match sendfile( @@ -104,12 +107,12 @@ impl ZeroCopy { nix::errno::Errno::EAGAIN => { debug!( "EAGAIN, continuing source: {},target: {}", - source_fd, target_fd + source_raw_fd, target_raw_fd ); sleep(std::time::Duration::from_millis(10)); } _ => { - log::error!("error sendfile: {}", err); + error!("error sendfile: {}", err); return Err(err.into()); } }, @@ -127,15 +130,18 @@ impl ZeroCopy { let mut total_transferred = 0; let mut current_offset = offset; + let target_fd = unsafe { BorrowedFd::borrow_raw(target_raw_fd) }; + let source_fd = unsafe { BorrowedFd::borrow_raw(source_raw_fd) }; + loop { let to_be_transfer = (size - total_transferred) as i64; trace!( "mac zero copy source fd: {} offset: {} len: {}, target: fd{}", - source_fd, + source_raw_fd, current_offset, to_be_transfer, - target_fd + target_raw_fd ); let (res, bytes_transferred) = sendfile( @@ -172,7 +178,7 @@ impl ZeroCopy { debug!("EAGAIN, try again"); sleep(std::time::Duration::from_millis(10)); } else { - log::error!("error sendfile: {}", err); + error!("error sendfile: {}", err); return Err(err.into()); } } @@ -193,7 +199,7 @@ mod tests { use futures_lite::future::zip; use futures_util::stream::StreamExt; - use log::debug; + use tracing::debug; use crate::file_slice::AsyncFileSlice; use crate::fs::AsyncFileExtension; diff --git a/test-data/http-client/ip.json b/test-data/http-client/ip.json deleted file mode 100644 index 11301d8..0000000 --- a/test-data/http-client/ip.json +++ /dev/null @@ -1 +0,0 @@ -{"origin": "192.0.0.1"} diff --git a/test-data/plain.txt b/test-data/plain.txt deleted file mode 100644 index f8dc9f2..0000000 --- a/test-data/plain.txt +++ /dev/null @@ -1 +0,0 @@ -plain \ No newline at end of file diff --git a/tests/test_http_client.rs b/tests/test_http_client.rs deleted file mode 100644 index a330c30..0000000 --- a/tests/test_http_client.rs +++ /dev/null @@ -1,138 +0,0 @@ -#[cfg(all(any(unix, windows), feature = "http-client"))] -#[cfg(test)] -mod test_http_client { - use anyhow::{Error, Result}; - - use fluvio_future::http_client::{self, ResponseExt, StatusCode}; - use fluvio_future::test_async; - - static DEF_PORT: &str = "7878"; - static SERVER: &str = "https://127.0.0.1"; - static ENV_TEST_PORT: &str = "TEST_PORT"; - - fn https_server_url() -> Result { - let port = std::env::var(ENV_TEST_PORT).unwrap_or(DEF_PORT.to_string()); - let port: u16 = port.parse()?; - let port = port + 1; // http -> https - Ok(format!("{SERVER}:{port}")) - } - - #[test_async] - async fn simple_test() -> Result<(), Error> { - let server_url = https_server_url()?; - let res = http_client::get(&server_url).await; - - let failmsg = - format!("failed to get http-server, did you install and run it? {server_url}"); - let status = res.expect(&failmsg).status(); - assert_eq!(status, StatusCode::OK); - Ok(()) - } - - #[test_async] - async fn get_and_deserialize_to_struct() -> Result<(), Error> { - use std::net::{IpAddr, Ipv4Addr}; - - use serde::Deserialize; - - let server_url = https_server_url()?; - - #[allow(dead_code)] - #[derive(Deserialize, Debug, PartialEq)] - struct Ip { - origin: IpAddr, - } - - let failmsg = - format!("failed to get http-server, did you install and run it? {server_url}"); - let json = http_client::get(format!("{server_url}/test-data/http-client/ip.json")) - .await - .expect(&failmsg) - .json::() - .await - .expect("failed to parse IP address"); - - assert_eq!( - json, - Ip { - origin: IpAddr::V4(Ipv4Addr::new(192, 0, 0, 1)) - } - ); - Ok(()) - } - - #[test_async] - async fn get_with_header() -> Result<(), Error> { - let server_url = https_server_url()?; - let uri = format!("{server_url}/test-data/plain.txt"); - let htreq = http_client::Client::new().get(uri)?.header("foo", "bar"); - let resp = htreq.send().await?; - let body = resp.bytes().await?; - let body_str = std::str::from_utf8(&body)?; - assert_eq!("plain", body_str); - Ok(()) - } - - #[test_async] - async fn get_body_string() -> Result<(), Error> { - let server_url = https_server_url()?; - let uri = format!("{server_url}/test-data/plain.txt"); - let htreq = http_client::Client::new().get(uri)?; - let resp = htreq.send().await?; - let body = resp.body_string().await?; - assert_eq!("plain", &body); - Ok(()) - } - - #[test_async] - async fn send_get() -> Result<(), Error> { - let server_url = https_server_url()?; - let failmsg = - format!("failed to get http-server, did you install and run it? {server_url}"); - - let uri = format!("{server_url}/test-data/plain.txt"); - let htreq = http::Request::get(&uri).header("foo", "bar").body("")?; - - let resp = http_client::send(htreq).await.expect(&failmsg); - - let body = resp.bytes().await?; - let body_str = std::str::from_utf8(&body)?; - assert_eq!("plain", body_str); - Ok(()) - } - - #[test_async] - async fn send_put() -> Result<(), Error> { - let server_url = https_server_url()?; - let failmsg = - format!("failed to get http-server, did you install and run it? {server_url}"); - - let put_txt_content = "dataput"; - let uri = format!("{server_url}/test-put/put.txt"); - let htreq = http::Request::put(&uri).body(put_txt_content)?; - - let resp = http_client::send(htreq).await.expect(&failmsg); - // expected output from test server PUT, if it request was formtted - // and sent this ok for now - assert_eq!(resp.status(), http::StatusCode::METHOD_NOT_ALLOWED); - Ok(()) - } - - // ignored tests used for live local dev sanity check - // cargo test live -- --ignored - #[test_async(ignore)] - async fn live_https() -> Result<(), Error> { - let res = http_client::get("https://hub.infinyon.cloud").await; - - assert!(res.is_ok()); - Ok(()) - } - - #[test_async(ignore)] - async fn live_http_not_supported() -> Result<(), Error> { - let res = http_client::get("http://hub.infinyon.cloud").await; - - assert!(res.is_err()); - Ok(()) - } -}