From ccc06967c616cba54e8305b1772f8bcf14ca409d Mon Sep 17 00:00:00 2001 From: minghuaw Date: Sat, 15 Oct 2022 01:27:31 -0700 Subject: [PATCH 01/30] Update README.md --- volo-grpc/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/volo-grpc/README.md b/volo-grpc/README.md index b75c4b18..916db2d0 100644 --- a/volo-grpc/README.md +++ b/volo-grpc/README.md @@ -2,8 +2,8 @@ `volo-grpc` implements a Protobuf-based RPC framework. -Users rarely need to use volo-thrift directly. Instead, they should use the `Client` and `Server` in the generated code. +Users rarely need to use `volo-grpc` directly. Instead, they should use the `Client` and `Server` in the generated code. For extension developers, they may need to use some of the components in `volo-grpc`. -For detailed guides, please refer to the [guides](https://www.cloudwego.io/docs/volo/). \ No newline at end of file +For detailed guides, please refer to the [guides](https://www.cloudwego.io/docs/volo/). From f4547376e771e149ed04d7c3abfd77e0779a223f Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 11 Oct 2023 03:11:16 -0700 Subject: [PATCH 02/30] added variants for tls conn --- Cargo.lock | 145 +++++++++++++++++++++++++++++++++ volo-grpc/Cargo.toml | 10 +++ volo-grpc/src/server/mod.rs | 26 +++++- volo-grpc/src/transport/mod.rs | 3 + volo-grpc/src/transport/tls.rs | 28 +++++++ volo/Cargo.toml | 10 +++ volo/src/net/conn.rs | 80 ++++++++++++++++++ 7 files changed, 299 insertions(+), 3 deletions(-) create mode 100644 volo-grpc/src/transport/tls.rs diff --git a/Cargo.lock b/Cargo.lock index f82a7a57..50a20a76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -315,6 +315,16 @@ dependencies = [ "windows-sys", ] +[[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" @@ -552,6 +562,21 @@ 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" @@ -1152,6 +1177,24 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97af489e1e21b68de4c390ecca6703318bc1aa16e9733bcb62c089b73c6fbb1b" +[[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.4" @@ -1256,6 +1299,50 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +[[package]] +name = "openssl" +version = "0.10.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +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.33", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -1483,6 +1570,12 @@ 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 = "ppv-lite86" version = "0.2.17" @@ -1922,6 +2015,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -1944,6 +2046,29 @@ dependencies = [ "untrusted", ] +[[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" @@ -2225,6 +2350,16 @@ dependencies = [ "syn 2.0.33", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -2502,6 +2637,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "volo" version = "0.5.5" @@ -2523,6 +2664,8 @@ dependencies = [ "socket2 0.5.4", "thiserror", "tokio", + "tokio-native-tls", + "tokio-rustls", "tokio-stream", "tower", "tracing", @@ -2619,6 +2762,8 @@ dependencies = [ "pilota", "pin-project", "tokio", + "tokio-native-tls", + "tokio-rustls", "tokio-stream", "tokio-util", "tower", diff --git a/volo-grpc/Cargo.toml b/volo-grpc/Cargo.toml index 074a72f5..f342bfe0 100644 --- a/volo-grpc/Cargo.toml +++ b/volo-grpc/Cargo.toml @@ -54,5 +54,15 @@ tower = { workspace = true, features = [ ] } tracing.workspace = true +# Optional dependencies +tokio-rustls = { version = "0.24", optional = true } +tokio-native-tls = { version = "0.3", optional = true } + [dev-dependencies] tracing-subscriber.workspace = true + +[features] +default = ["rustls", "native-tls"] + +rustls = ["tokio-rustls"] +native-tls = ["tokio-native-tls"] \ No newline at end of file diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index eca757e5..46783fb4 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -18,7 +18,7 @@ use volo::{net::incoming::Incoming, spawn}; pub use self::router::Router; use crate::{ - body::Body, context::ServerContext, server::meta::MetaService, Request, Response, Status, + body::Body, context::ServerContext, server::meta::MetaService, Request, Response, Status, transport::TlsAcceptorConfig, }; /// A trait to provide a static reference to the service's @@ -36,6 +36,8 @@ pub struct Server { layer: L, http2_config: Http2Config, router: Router, + + tls: TlsAcceptorConfig, } impl Default for Server { @@ -51,11 +53,17 @@ impl Server { layer: Identity::new(), http2_config: Http2Config::default(), router: Router::new(), + tls: TlsAcceptorConfig::None, } } } impl Server { + pub fn tls_config(mut self, value: impl Into) -> Self { + self.tls = value.into(); + self + } + /// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`] option for HTTP2 /// stream-level flow control. /// @@ -174,6 +182,7 @@ impl Server { layer: Stack::new(layer, self.layer), http2_config: self.http2_config, router: self.router, + tls: self.tls, } } @@ -193,6 +202,7 @@ impl Server { layer: Stack::new(self.layer, layer), http2_config: self.http2_config, router: self.router, + tls: self.tls } } @@ -210,6 +220,7 @@ impl Server { layer: self.layer, http2_config: self.http2_config, router: self.router.add_service(s), + tls: self.tls } } @@ -277,9 +288,18 @@ impl Server { .http2_max_send_buf_size(self.http2_config.max_send_buf_size) .http2_max_header_list_size(self.http2_config.max_header_list_size); - let mut watch = rx.clone(); + let mut watch = rx.clone(); + let tls_config = self.tls.clone(); spawn(async move { - let mut http_conn = server.serve_connection(conn, service); + // let mut http_conn = server.serve_connection(conn, service); + let mut http_conn = match tls_config { + TlsAcceptorConfig::None => server.serve_connection(conn, service), + TlsAcceptorConfig::Rustls(tls_acceptor) => match tls_acceptor.accept(conn).await { + Ok(tls_stream) => server.serve_connection(tls_stream, service), + Err(_) => todo!(), + }, + TlsAcceptorConfig::NativeTls(_) => todo!(), + }; tokio::select! { _ = watch.changed() => { tracing::trace!("[VOLO] closing a pending connection"); diff --git a/volo-grpc/src/transport/mod.rs b/volo-grpc/src/transport/mod.rs index 03c4296d..100ed0c6 100644 --- a/volo-grpc/src/transport/mod.rs +++ b/volo-grpc/src/transport/mod.rs @@ -2,5 +2,8 @@ mod client; mod connect; +mod tls; pub use client::ClientTransport; + +pub(crate) use tls::TlsAcceptorConfig; \ No newline at end of file diff --git a/volo-grpc/src/transport/tls.rs b/volo-grpc/src/transport/tls.rs new file mode 100644 index 00000000..14079b5e --- /dev/null +++ b/volo-grpc/src/transport/tls.rs @@ -0,0 +1,28 @@ +#[derive(Clone)] +pub enum TlsAcceptorConfig { + None, + + #[cfg(feature = "rustls")] + Rustls(tokio_rustls::TlsAcceptor), + + #[cfg(feature = "native-tls")] + NativeTls(tokio_native_tls::TlsAcceptor), +} + +impl From<()> for TlsAcceptorConfig { + fn from(value: ()) -> Self { + Self::None + } +} + +impl From for TlsAcceptorConfig { + fn from(value: tokio_rustls::TlsAcceptor) -> Self { + Self::Rustls(value) + } +} + +impl From for TlsAcceptorConfig { + fn from(value: tokio_native_tls::TlsAcceptor) -> Self { + Self::NativeTls(value) + } +} \ No newline at end of file diff --git a/volo/Cargo.toml b/volo/Cargo.toml index 1665c4f9..f372cf73 100644 --- a/volo/Cargo.toml +++ b/volo/Cargo.toml @@ -41,3 +41,13 @@ tokio = { workspace = true, features = ["net", "time", "sync", "io-util"] } tokio-stream = { workspace = true, features = ["net"] } tower.workspace = true tracing.workspace = true + +# Optional dependencies +tokio-rustls = { version = "0.24", optional = true } +tokio-native-tls = { version = "0.3", optional = true } + +[features] +default = ["rustls", "native-tls"] + +rustls = ["tokio-rustls"] +native-tls = ["tokio-native-tls"] \ No newline at end of file diff --git a/volo/src/net/conn.rs b/volo/src/net/conn.rs index ed9efb78..f3b2b1d1 100644 --- a/volo/src/net/conn.rs +++ b/volo/src/net/conn.rs @@ -28,13 +28,24 @@ pub enum ConnStream { Tcp(#[pin] TcpStream), #[cfg(target_family = "unix")] Unix(#[pin] UnixStream), + #[cfg(feature = "rustls")] + Rustls(#[pin] tokio_rustls::TlsStream), + #[cfg(feature = "native-tls")] + NativeTls(#[pin] tokio_native_tls::TlsStream), } +type RustlsWriteHalf = tokio::io::WriteHalf>; +type NativeTlsWriteHalf = tokio::io::WriteHalf>; + #[pin_project(project = OwnedWriteHalfProj)] pub enum OwnedWriteHalf { Tcp(#[pin] tcp::OwnedWriteHalf), #[cfg(target_family = "unix")] Unix(#[pin] unix::OwnedWriteHalf), + #[cfg(feature = "rustls")] + Rustls(#[pin] RustlsWriteHalf), + #[cfg(feature = "native-tls")] + NativeTls(#[pin] NativeTlsWriteHalf), } impl AsyncWrite for OwnedWriteHalf { @@ -48,6 +59,10 @@ impl AsyncWrite for OwnedWriteHalf { OwnedWriteHalfProj::Tcp(half) => half.poll_write(cx, buf), #[cfg(target_family = "unix")] OwnedWriteHalfProj::Unix(half) => half.poll_write(cx, buf), + #[cfg(feature = "rustls")] + OwnedWriteHalfProj::Rustls(half) => half.poll_write(cx, buf), + #[cfg(feature = "native-tls")] + OwnedWriteHalfProj::NativeTls(half) => half.poll_write(cx, buf), } } @@ -57,6 +72,10 @@ impl AsyncWrite for OwnedWriteHalf { OwnedWriteHalfProj::Tcp(half) => half.poll_flush(cx), #[cfg(target_family = "unix")] OwnedWriteHalfProj::Unix(half) => half.poll_flush(cx), + #[cfg(feature = "rustls")] + OwnedWriteHalfProj::Rustls(half) => half.poll_flush(cx), + #[cfg(feature = "native-tls")] + OwnedWriteHalfProj::NativeTls(half) => half.poll_flush(cx), } } @@ -66,6 +85,10 @@ impl AsyncWrite for OwnedWriteHalf { OwnedWriteHalfProj::Tcp(half) => half.poll_shutdown(cx), #[cfg(target_family = "unix")] OwnedWriteHalfProj::Unix(half) => half.poll_shutdown(cx), + #[cfg(feature = "rustls")] + OwnedWriteHalfProj::Rustls(half) => half.poll_shutdown(cx), + #[cfg(feature = "native-tls")] + OwnedWriteHalfProj::NativeTls(half) => half.poll_shutdown(cx), } } @@ -79,6 +102,10 @@ impl AsyncWrite for OwnedWriteHalf { OwnedWriteHalfProj::Tcp(half) => half.poll_write_vectored(cx, bufs), #[cfg(target_family = "unix")] OwnedWriteHalfProj::Unix(half) => half.poll_write_vectored(cx, bufs), + #[cfg(feature = "rustls")] + OwnedWriteHalfProj::Rustls(half) => half.poll_write_vectored(cx, bufs), + #[cfg(feature = "native-tls")] + OwnedWriteHalfProj::NativeTls(half) => half.poll_write_vectored(cx, bufs), } } @@ -88,15 +115,26 @@ impl AsyncWrite for OwnedWriteHalf { Self::Tcp(half) => half.is_write_vectored(), #[cfg(target_family = "unix")] Self::Unix(half) => half.is_write_vectored(), + #[cfg(feature = "rustls")] + Self::Rustls(half) => half.is_write_vectored(), + #[cfg(feature = "native-tls")] + Self::NativeTls(half) => half.is_write_vectored(), } } } +type RustlsReadHalf = tokio::io::ReadHalf>; +type NativeTlsReadHalf = tokio::io::ReadHalf>; + #[pin_project(project = OwnedReadHalfProj)] pub enum OwnedReadHalf { Tcp(#[pin] tcp::OwnedReadHalf), #[cfg(target_family = "unix")] Unix(#[pin] unix::OwnedReadHalf), + #[cfg(feature = "rustls")] + Rustls(#[pin] RustlsReadHalf), + #[cfg(feature = "native-tls")] + NativeTls(#[pin] NativeTlsReadHalf), } impl AsyncRead for OwnedReadHalf { @@ -110,6 +148,10 @@ impl AsyncRead for OwnedReadHalf { OwnedReadHalfProj::Tcp(half) => half.poll_read(cx, buf), #[cfg(target_family = "unix")] OwnedReadHalfProj::Unix(half) => half.poll_read(cx, buf), + #[cfg(feature = "rustls")] + OwnedReadHalfProj::Rustls(half) => half.poll_read(cx, buf), + #[cfg(feature = "native-tls")] + OwnedReadHalfProj::NativeTls(half) => half.poll_read(cx, buf), } } } @@ -127,6 +169,16 @@ impl ConnStream { let (rh, wh) = stream.into_split(); (OwnedReadHalf::Unix(rh), OwnedWriteHalf::Unix(wh)) } + #[cfg(feature = "rustls")] + Self::Rustls(stream) => { + let (rh, wh) = tokio::io::split(stream); + (OwnedReadHalf::Rustls(rh), OwnedWriteHalf::Rustls(wh)) + }, + #[cfg(feature = "native-tls")] + Self::NativeTls(stream) => { + let (rh, wh) = tokio::io::split(stream); + (OwnedReadHalf::NativeTls(rh), OwnedWriteHalf::NativeTls(wh)) + }, } } } @@ -158,6 +210,10 @@ impl AsyncRead for ConnStream { IoStreamProj::Tcp(s) => s.poll_read(cx, buf), #[cfg(target_family = "unix")] IoStreamProj::Unix(s) => s.poll_read(cx, buf), + #[cfg(feature = "rustls")] + IoStreamProj::Rustls(s) => s.poll_read(cx, buf), + #[cfg(feature = "native-tls")] + IoStreamProj::NativeTls(s) => s.poll_read(cx, buf), } } } @@ -173,6 +229,10 @@ impl AsyncWrite for ConnStream { IoStreamProj::Tcp(s) => s.poll_write(cx, buf), #[cfg(target_family = "unix")] IoStreamProj::Unix(s) => s.poll_write(cx, buf), + #[cfg(feature = "rustls")] + IoStreamProj::Rustls(s) => s.poll_write(cx, buf), + #[cfg(feature = "native-tls")] + IoStreamProj::NativeTls(s) => s.poll_write(cx, buf), } } @@ -182,6 +242,10 @@ impl AsyncWrite for ConnStream { IoStreamProj::Tcp(s) => s.poll_flush(cx), #[cfg(target_family = "unix")] IoStreamProj::Unix(s) => s.poll_flush(cx), + #[cfg(feature = "rustls")] + IoStreamProj::Rustls(s) => s.poll_flush(cx), + #[cfg(feature = "native-tls")] + IoStreamProj::NativeTls(s) => s.poll_flush(cx), } } @@ -191,6 +255,10 @@ impl AsyncWrite for ConnStream { IoStreamProj::Tcp(s) => s.poll_shutdown(cx), #[cfg(target_family = "unix")] IoStreamProj::Unix(s) => s.poll_shutdown(cx), + #[cfg(feature = "rustls")] + IoStreamProj::Rustls(s) => s.poll_shutdown(cx), + #[cfg(feature = "native-tls")] + IoStreamProj::NativeTls(s) => s.poll_shutdown(cx), } } @@ -204,6 +272,10 @@ impl AsyncWrite for ConnStream { IoStreamProj::Tcp(s) => s.poll_write_vectored(cx, bufs), #[cfg(target_family = "unix")] IoStreamProj::Unix(s) => s.poll_write_vectored(cx, bufs), + #[cfg(feature = "rustls")] + IoStreamProj::Rustls(s) => s.poll_write_vectored(cx, bufs), + #[cfg(feature = "native-tls")] + IoStreamProj::NativeTls(s) => s.poll_write_vectored(cx, bufs), } } @@ -213,6 +285,10 @@ impl AsyncWrite for ConnStream { Self::Tcp(s) => s.is_write_vectored(), #[cfg(target_family = "unix")] Self::Unix(s) => s.is_write_vectored(), + #[cfg(feature = "rustls")] + Self::Rustls(s) => s.is_write_vectored(), + #[cfg(feature = "native-tls")] + Self::NativeTls(s) => s.is_write_vectored(), } } } @@ -224,6 +300,10 @@ impl ConnStream { Self::Tcp(s) => s.peer_addr().map(Address::from).ok(), #[cfg(target_family = "unix")] Self::Unix(s) => s.peer_addr().ok().and_then(|s| Address::try_from(s).ok()), + #[cfg(feature = "rustls")] + Self::Rustls(s) => s.get_ref().0.peer_addr().map(Address::from).ok(), + #[cfg(feature = "native-tls")] + Self::NativeTls(s) => s.get_ref().get_ref().get_ref().peer_addr().map(Address::from).ok(), } } } From bdcb0afb908ce28d32c2edfec475a6b664b13165 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 11 Oct 2023 11:53:51 -0700 Subject: [PATCH 03/30] server performs tls handshake if tls_config exists --- volo-grpc/src/server/mod.rs | 54 +++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index 46783fb4..ef67c95e 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -14,7 +14,7 @@ use motore::{ BoxError, }; pub use service::ServiceBuilder; -use volo::{net::incoming::Incoming, spawn}; +use volo::{net::{incoming::Incoming, conn::{Conn, ConnStream}}, spawn}; pub use self::router::Router; use crate::{ @@ -37,7 +37,7 @@ pub struct Server { http2_config: Http2Config, router: Router, - tls: TlsAcceptorConfig, + tls_config: TlsAcceptorConfig, } impl Default for Server { @@ -53,14 +53,14 @@ impl Server { layer: Identity::new(), http2_config: Http2Config::default(), router: Router::new(), - tls: TlsAcceptorConfig::None, + tls_config: TlsAcceptorConfig::None, } } } impl Server { pub fn tls_config(mut self, value: impl Into) -> Self { - self.tls = value.into(); + self.tls_config = value.into(); self } @@ -182,7 +182,7 @@ impl Server { layer: Stack::new(layer, self.layer), http2_config: self.http2_config, router: self.router, - tls: self.tls, + tls_config: self.tls_config, } } @@ -202,7 +202,7 @@ impl Server { layer: Stack::new(self.layer, layer), http2_config: self.http2_config, router: self.router, - tls: self.tls + tls_config: self.tls_config } } @@ -220,7 +220,7 @@ impl Server { layer: self.layer, http2_config: self.http2_config, router: self.router.add_service(s), - tls: self.tls + tls_config: self.tls_config } } @@ -252,7 +252,7 @@ impl Server { tokio::pin!(signal); let (tx, rx) = tokio::sync::watch::channel(()); - + loop { tokio::select! { _ = &mut signal => { @@ -264,10 +264,33 @@ impl Server { return Ok(()); }, conn = incoming.accept() => { - let conn = match conn? { + let conn: Conn = match conn? { Some(c) => c, None => return Ok(()), }; + let info = conn.info; + // Only perform TLS handshake if either rustls or native-tls is configured + let conn: Conn = match (conn.stream, &self.tls_config) { + (volo::net::conn::ConnStream::Tcp(tcp), TlsAcceptorConfig::Rustls(tls_acceptor)) => { + let stream = tls_acceptor.accept(tcp).await?; + Conn { + stream: ConnStream::Rustls(tokio_rustls::TlsStream::Server(stream)), + info + } + }, + (volo::net::conn::ConnStream::Tcp(tcp), TlsAcceptorConfig::NativeTls(tls_acceptor)) => { + let stream = tls_acceptor.accept(tcp).await?; + Conn { + stream: ConnStream::NativeTls(stream), + info, + } + }, + (stream, _) => Conn { + stream, + info + }, + }; + tracing::trace!("[VOLO] recv a connection from: {:?}", conn.info.peer_addr); let peer_addr = conn.info.peer_addr.clone(); @@ -288,18 +311,9 @@ impl Server { .http2_max_send_buf_size(self.http2_config.max_send_buf_size) .http2_max_header_list_size(self.http2_config.max_header_list_size); - let mut watch = rx.clone(); - let tls_config = self.tls.clone(); + let mut watch = rx.clone(); spawn(async move { - // let mut http_conn = server.serve_connection(conn, service); - let mut http_conn = match tls_config { - TlsAcceptorConfig::None => server.serve_connection(conn, service), - TlsAcceptorConfig::Rustls(tls_acceptor) => match tls_acceptor.accept(conn).await { - Ok(tls_stream) => server.serve_connection(tls_stream, service), - Err(_) => todo!(), - }, - TlsAcceptorConfig::NativeTls(_) => todo!(), - }; + let mut http_conn = server.serve_connection(conn, service); tokio::select! { _ = watch.changed() => { tracing::trace!("[VOLO] closing a pending connection"); From b97607c55964dbd61133c50b4c06d2a2bdcece29 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 13:42:47 -0700 Subject: [PATCH 04/30] need alt for make tls transport --- volo-grpc/src/transport/tls.rs | 10 ++-- volo/src/net/dial.rs | 96 ++++++++++++++++++++++++---------- 2 files changed, 74 insertions(+), 32 deletions(-) diff --git a/volo-grpc/src/transport/tls.rs b/volo-grpc/src/transport/tls.rs index 14079b5e..1dba7b15 100644 --- a/volo-grpc/src/transport/tls.rs +++ b/volo-grpc/src/transport/tls.rs @@ -1,7 +1,9 @@ -#[derive(Clone)] -pub enum TlsAcceptorConfig { - None, +pub struct ServerTlsConfig { + acceptor: Option, +} +#[derive(Clone)] +pub enum TlsAcceptor { #[cfg(feature = "rustls")] Rustls(tokio_rustls::TlsAcceptor), @@ -10,7 +12,7 @@ pub enum TlsAcceptorConfig { } impl From<()> for TlsAcceptorConfig { - fn from(value: ()) -> Self { + fn from(_value: ()) -> Self { Self::None } } diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index 8e51279b..5176b024 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -1,11 +1,11 @@ -use std::io; +use std::{io, net::SocketAddr}; use socket2::{Domain, Protocol, Socket, Type}; #[cfg(target_family = "unix")] use tokio::net::UnixStream; use tokio::{ io::{AsyncRead, AsyncWrite}, - net::TcpSocket, + net::{TcpSocket, TcpStream}, time::{timeout, Duration}, }; @@ -26,6 +26,7 @@ pub trait MakeTransport: Clone + Send + Sync + 'static { fn set_write_timeout(&mut self, timeout: Option); } + #[derive(Default, Debug, Clone, Copy)] pub struct DefaultMakeTransport { cfg: Config, @@ -98,36 +99,38 @@ impl MakeTransport for DefaultMakeTransport { } } +async fn make_tcp_connection(cfg: &Config, addr: SocketAddr) -> Result { + let domain = Domain::for_address(addr); + let socket = Socket::new(domain, Type::STREAM, Some(Protocol::TCP))?; + socket.set_nonblocking(true)?; + socket.set_read_timeout(cfg.read_timeout)?; + socket.set_write_timeout(cfg.write_timeout)?; + + #[cfg(unix)] + let socket = unsafe { + use std::os::unix::io::{FromRawFd, IntoRawFd}; + TcpSocket::from_raw_fd(socket.into_raw_fd()) + }; + #[cfg(windows)] + let socket = unsafe { + use std::os::windows::io::{FromRawSocket, IntoRawSocket}; + TcpSocket::from_raw_socket(socket.into_raw_socket()) + }; + + let connect = socket.connect(addr); + + if let Some(conn_timeout) = cfg.connect_timeout { + timeout(conn_timeout, connect).await? + } else { + connect.await + } +} + impl DefaultMakeTransport { pub async fn make_connection(&self, addr: Address) -> Result { match addr { Address::Ip(addr) => { - let stream = { - let domain = Domain::for_address(addr); - let socket = Socket::new(domain, Type::STREAM, Some(Protocol::TCP))?; - socket.set_nonblocking(true)?; - socket.set_read_timeout(self.cfg.read_timeout)?; - socket.set_write_timeout(self.cfg.write_timeout)?; - - #[cfg(unix)] - let socket = unsafe { - use std::os::unix::io::{FromRawFd, IntoRawFd}; - TcpSocket::from_raw_fd(socket.into_raw_fd()) - }; - #[cfg(windows)] - let socket = unsafe { - use std::os::windows::io::{FromRawSocket, IntoRawSocket}; - TcpSocket::from_raw_socket(socket.into_raw_socket()) - }; - - let connect = socket.connect(addr); - - if let Some(conn_timeout) = self.cfg.connect_timeout { - timeout(conn_timeout, connect).await?? - } else { - connect.await? - } - }; + let stream = make_tcp_connection(&self.cfg, addr).await?; stream.set_nodelay(true)?; Ok(Conn::from(stream)) } @@ -136,3 +139,40 @@ impl DefaultMakeTransport { } } } + +#[cfg(any(feature = "rustls", feature = "native-tls"))] +pub struct DefaultTlsMakeTransport { + cfg: Config, + tls_connector: C, +} + +#[cfg(feature = "rustls")] +impl DefaultTlsMakeTransport { + pub fn new(tls_connector: tokio_rustls::TlsConnector) -> Self { + Self { + cfg: Config::default(), + tls_connector, + } + } + + pub async fn make_connection(&self, addr: Address) -> Result { + match addr { + Address::Ip(addr) => { + let tcp = make_tcp_connection(&self.cfg, addr).await?; + + }, + #[cfg(target_family = "unix")] + Address::Unix(addr) => UnixStream::connect(addr).await.map(Conn::from), + } + } +} + +#[cfg(feature = "native-tls")] +impl DefaultTlsMakeTransport { + pub fn new(tls_connector: tokio_native_tls::TlsConnector) -> Self { + Self { + cfg: Config::default(), + tls_connector, + } + } +} \ No newline at end of file From 800b0fbe9e8ac034e30d354d9f835a20d7aa9fc0 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 14:46:06 -0700 Subject: [PATCH 05/30] modified ServerTlsConfig, added ClientTlsConfig --- .gitignore | 2 ++ volo-grpc/src/server/mod.rs | 16 +++++++++------- volo-grpc/src/transport/mod.rs | 6 ++---- volo-grpc/src/transport/tls.rs | 21 ++++++++++---------- volo/Cargo.toml | 3 ++- volo/src/net/conn.rs | 16 ++++++++++++++++ volo/src/net/dial.rs | 35 ++++++++++++++++++++++++++++------ 7 files changed, 70 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 81fce4ad..7738755a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .vscode .idea /target + +**Cargo.lock \ No newline at end of file diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index ef67c95e..e0be388d 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -18,7 +18,7 @@ use volo::{net::{incoming::Incoming, conn::{Conn, ConnStream}}, spawn}; pub use self::router::Router; use crate::{ - body::Body, context::ServerContext, server::meta::MetaService, Request, Response, Status, transport::TlsAcceptorConfig, + body::Body, context::ServerContext, server::meta::MetaService, Request, Response, Status, transport::tls::{ServerTlsConfig, TlsAcceptor}, }; /// A trait to provide a static reference to the service's @@ -37,7 +37,7 @@ pub struct Server { http2_config: Http2Config, router: Router, - tls_config: TlsAcceptorConfig, + tls_config: ServerTlsConfig, } impl Default for Server { @@ -53,13 +53,15 @@ impl Server { layer: Identity::new(), http2_config: Http2Config::default(), router: Router::new(), - tls_config: TlsAcceptorConfig::None, + tls_config: ServerTlsConfig { + acceptor: None, + }, } } } impl Server { - pub fn tls_config(mut self, value: impl Into) -> Self { + pub fn tls_config(mut self, value: impl Into) -> Self { self.tls_config = value.into(); self } @@ -270,15 +272,15 @@ impl Server { }; let info = conn.info; // Only perform TLS handshake if either rustls or native-tls is configured - let conn: Conn = match (conn.stream, &self.tls_config) { - (volo::net::conn::ConnStream::Tcp(tcp), TlsAcceptorConfig::Rustls(tls_acceptor)) => { + let conn: Conn = match (conn.stream, &self.tls_config.acceptor) { + (volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::Rustls(tls_acceptor))) => { let stream = tls_acceptor.accept(tcp).await?; Conn { stream: ConnStream::Rustls(tokio_rustls::TlsStream::Server(stream)), info } }, - (volo::net::conn::ConnStream::Tcp(tcp), TlsAcceptorConfig::NativeTls(tls_acceptor)) => { + (volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::NativeTls(tls_acceptor))) => { let stream = tls_acceptor.accept(tcp).await?; Conn { stream: ConnStream::NativeTls(stream), diff --git a/volo-grpc/src/transport/mod.rs b/volo-grpc/src/transport/mod.rs index 100ed0c6..c29a198d 100644 --- a/volo-grpc/src/transport/mod.rs +++ b/volo-grpc/src/transport/mod.rs @@ -2,8 +2,6 @@ mod client; mod connect; -mod tls; +pub(crate) mod tls; -pub use client::ClientTransport; - -pub(crate) use tls::TlsAcceptorConfig; \ No newline at end of file +pub use client::ClientTransport; \ No newline at end of file diff --git a/volo-grpc/src/transport/tls.rs b/volo-grpc/src/transport/tls.rs index 1dba7b15..803668fe 100644 --- a/volo-grpc/src/transport/tls.rs +++ b/volo-grpc/src/transport/tls.rs @@ -1,5 +1,6 @@ +#[derive(Clone)] pub struct ServerTlsConfig { - acceptor: Option, + pub acceptor: Option, } #[derive(Clone)] @@ -11,20 +12,18 @@ pub enum TlsAcceptor { NativeTls(tokio_native_tls::TlsAcceptor), } -impl From<()> for TlsAcceptorConfig { - fn from(_value: ()) -> Self { - Self::None - } -} - -impl From for TlsAcceptorConfig { +impl From for ServerTlsConfig { fn from(value: tokio_rustls::TlsAcceptor) -> Self { - Self::Rustls(value) + Self { + acceptor: Some(TlsAcceptor::Rustls(value)), + } } } -impl From for TlsAcceptorConfig { +impl From for ServerTlsConfig { fn from(value: tokio_native_tls::TlsAcceptor) -> Self { - Self::NativeTls(value) + Self { + acceptor: Some(TlsAcceptor::NativeTls(value)), + } } } \ No newline at end of file diff --git a/volo/Cargo.toml b/volo/Cargo.toml index f372cf73..895ed1e2 100644 --- a/volo/Cargo.toml +++ b/volo/Cargo.toml @@ -43,11 +43,12 @@ tower.workspace = true tracing.workspace = true # Optional dependencies +librustls = { package = "rustls", version = "0.21", optional = true } tokio-rustls = { version = "0.24", optional = true } tokio-native-tls = { version = "0.3", optional = true } [features] default = ["rustls", "native-tls"] -rustls = ["tokio-rustls"] +rustls = ["tokio-rustls", "librustls"] native-tls = ["tokio-native-tls"] \ No newline at end of file diff --git a/volo/src/net/conn.rs b/volo/src/net/conn.rs index f3b2b1d1..4d888911 100644 --- a/volo/src/net/conn.rs +++ b/volo/src/net/conn.rs @@ -199,6 +199,22 @@ impl From for ConnStream { } } +#[cfg(feature = "rustls")] +impl From> for ConnStream { + #[inline] + fn from(s: tokio_rustls::TlsStream) -> Self { + Self::Rustls(s) + } +} + +#[cfg(feature = "native-tls")] +impl From> for ConnStream { + #[inline] + fn from(s: tokio_native_tls::TlsStream) -> Self { + Self::NativeTls(s) + } +} + impl AsyncRead for ConnStream { #[inline] fn poll_read( diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index 5176b024..dd897553 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -140,18 +140,24 @@ impl DefaultMakeTransport { } } +#[cfg(any(feature = "rustls", feature = "native-tls"))] +pub struct ClientTlsConfig { + domain: String, + connector: C, +} + #[cfg(any(feature = "rustls", feature = "native-tls"))] pub struct DefaultTlsMakeTransport { cfg: Config, - tls_connector: C, + tls_config: ClientTlsConfig, } #[cfg(feature = "rustls")] impl DefaultTlsMakeTransport { - pub fn new(tls_connector: tokio_rustls::TlsConnector) -> Self { + pub fn new(tls_config: ClientTlsConfig) -> Self { Self { cfg: Config::default(), - tls_connector, + tls_config, } } @@ -159,7 +165,11 @@ impl DefaultTlsMakeTransport { match addr { Address::Ip(addr) => { let tcp = make_tcp_connection(&self.cfg, addr).await?; - + let domain = librustls::ServerName::try_from(&self.tls_config.domain[..]) + .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; + self.tls_config.connector.connect(domain, tcp).await + .map(tokio_rustls::TlsStream::Client) + .map(Conn::from) }, #[cfg(target_family = "unix")] Address::Unix(addr) => UnixStream::connect(addr).await.map(Conn::from), @@ -169,10 +179,23 @@ impl DefaultTlsMakeTransport { #[cfg(feature = "native-tls")] impl DefaultTlsMakeTransport { - pub fn new(tls_connector: tokio_native_tls::TlsConnector) -> Self { + pub fn new(tls_config: ClientTlsConfig) -> Self { Self { cfg: Config::default(), - tls_connector, + tls_config + } + } + + pub async fn make_connection(&self, addr: Address) -> Result { + match addr { + Address::Ip(addr) => { + let tcp = make_tcp_connection(&self.cfg, addr).await?; + self.tls_config.connector.connect(&self.tls_config.domain[..], tcp).await + .map(Conn::from) + .map_err(|e| io::Error::new(io::ErrorKind::Other, e)) + }, + #[cfg(target_family = "unix")] + Address::Unix(addr) => UnixStream::connect(addr).await.map(Conn::from), } } } \ No newline at end of file From ea49ee561d3180fc37c03eaf7b5e351bb01efb64 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 15:04:29 -0700 Subject: [PATCH 06/30] adding tls_config method --- volo-grpc/src/client/mod.rs | 18 ++++++++++++++++++ volo-grpc/src/server/mod.rs | 10 ++++------ volo-grpc/src/transport/tls.rs | 6 +++--- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/volo-grpc/src/client/mod.rs b/volo-grpc/src/client/mod.rs index 534d7fd8..045bac33 100644 --- a/volo-grpc/src/client/mod.rs +++ b/volo-grpc/src/client/mod.rs @@ -48,6 +48,12 @@ pub struct ClientBuilder { mk_client: C, mk_lb: LB, _marker: PhantomData, + + #[cfg(all(feature = "rustls", not(feature = "native-tls")))] + tls_config: Option>, + + #[cfg(all(feature = "native-tls", not(feature = "rustls")))] + tls_config: Option>, } impl @@ -388,6 +394,18 @@ impl ClientBuilder { _marker: self._marker, } } + + #[cfg(all(feature = "rustls", not(feature = "native-tls")))] + pub fn tls_config(mut self, tls_config: volo::net::dial::ClientTlsConfig) -> Self { + self.tls_config = Some(tls_config); + self + } + + #[cfg(all(feature = "native-tls", not(feature = "rustls")))] + pub fn tls_config(mut self, tls_config: volo::net::dial::ClientTlsConfig) -> Self { + self.tls_config = Some(tls_config); + self + } } impl ClientBuilder diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index e0be388d..cd624654 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -37,7 +37,7 @@ pub struct Server { http2_config: Http2Config, router: Router, - tls_config: ServerTlsConfig, + tls_config: Option, } impl Default for Server { @@ -53,16 +53,14 @@ impl Server { layer: Identity::new(), http2_config: Http2Config::default(), router: Router::new(), - tls_config: ServerTlsConfig { - acceptor: None, - }, + tls_config: None, } } } impl Server { pub fn tls_config(mut self, value: impl Into) -> Self { - self.tls_config = value.into(); + self.tls_config = Some(value.into()); self } @@ -272,7 +270,7 @@ impl Server { }; let info = conn.info; // Only perform TLS handshake if either rustls or native-tls is configured - let conn: Conn = match (conn.stream, &self.tls_config.acceptor) { + let conn: Conn = match (conn.stream, self.tls_config.as_ref().map(|o| &o.acceptor)) { (volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::Rustls(tls_acceptor))) => { let stream = tls_acceptor.accept(tcp).await?; Conn { diff --git a/volo-grpc/src/transport/tls.rs b/volo-grpc/src/transport/tls.rs index 803668fe..b1f591c4 100644 --- a/volo-grpc/src/transport/tls.rs +++ b/volo-grpc/src/transport/tls.rs @@ -1,6 +1,6 @@ #[derive(Clone)] pub struct ServerTlsConfig { - pub acceptor: Option, + pub acceptor: TlsAcceptor, } #[derive(Clone)] @@ -15,7 +15,7 @@ pub enum TlsAcceptor { impl From for ServerTlsConfig { fn from(value: tokio_rustls::TlsAcceptor) -> Self { Self { - acceptor: Some(TlsAcceptor::Rustls(value)), + acceptor: TlsAcceptor::Rustls(value), } } } @@ -23,7 +23,7 @@ impl From for ServerTlsConfig { impl From for ServerTlsConfig { fn from(value: tokio_native_tls::TlsAcceptor) -> Self { Self { - acceptor: Some(TlsAcceptor::NativeTls(value)), + acceptor: TlsAcceptor::NativeTls(value), } } } \ No newline at end of file From a95a2c3be00989a57aaf1a69e68c3419b045f7ef Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 21:09:03 -0700 Subject: [PATCH 07/30] changed client tls connector to an enum --- volo-grpc/src/client/mod.rs | 39 ++++++++++++++------- volo/src/net/dial.rs | 67 ++++++++++++++++++------------------- 2 files changed, 58 insertions(+), 48 deletions(-) diff --git a/volo-grpc/src/client/mod.rs b/volo-grpc/src/client/mod.rs index 045bac33..780bb5a3 100644 --- a/volo-grpc/src/client/mod.rs +++ b/volo-grpc/src/client/mod.rs @@ -49,11 +49,8 @@ pub struct ClientBuilder { mk_lb: LB, _marker: PhantomData, - #[cfg(all(feature = "rustls", not(feature = "native-tls")))] - tls_config: Option>, - - #[cfg(all(feature = "native-tls", not(feature = "rustls")))] - tls_config: Option>, + #[cfg(any(feature = "rustls", feature = "native-tls"))] + tls_config: Option, } impl @@ -79,6 +76,9 @@ impl mk_client: service_client, mk_lb: LbConfig::new(WeightedRandomBalance::new(), DummyDiscover {}), _marker: PhantomData, + + #[cfg(any(feature = "rustls", feature = "native-tls"))] + tls_config: None, } } } @@ -99,6 +99,9 @@ impl ClientBuilder, T, mk_client: self.mk_client, mk_lb: self.mk_lb.load_balance(load_balance), _marker: PhantomData, + + #[cfg(any(feature = "rustls", feature = "native-tls"))] + tls_config: self.tls_config, } } @@ -117,6 +120,9 @@ impl ClientBuilder, T, mk_client: self.mk_client, mk_lb: self.mk_lb.discover(discover), _marker: PhantomData, + + #[cfg(any(feature = "rustls", feature = "native-tls"))] + tls_config: self.tls_config, } } } @@ -289,6 +295,9 @@ impl ClientBuilder { mk_client: self.mk_client, mk_lb: mk_load_balance, _marker: PhantomData, + + #[cfg(any(feature = "rustls", feature = "native-tls"))] + tls_config: self.tls_config, } } @@ -330,6 +339,9 @@ impl ClientBuilder { mk_client: self.mk_client, mk_lb: self.mk_lb, _marker: self._marker, + + #[cfg(any(feature = "rustls", feature = "native-tls"))] + tls_config: self.tls_config, } } @@ -361,6 +373,9 @@ impl ClientBuilder { mk_client: self.mk_client, mk_lb: self.mk_lb, _marker: self._marker, + + #[cfg(any(feature = "rustls", feature = "native-tls"))] + tls_config: self.tls_config, } } @@ -392,17 +407,15 @@ impl ClientBuilder { mk_client: self.mk_client, mk_lb: self.mk_lb, _marker: self._marker, - } - } - #[cfg(all(feature = "rustls", not(feature = "native-tls")))] - pub fn tls_config(mut self, tls_config: volo::net::dial::ClientTlsConfig) -> Self { - self.tls_config = Some(tls_config); - self + #[cfg(any(feature = "rustls", feature = "native-tls"))] + tls_config: self.tls_config, + } } - #[cfg(all(feature = "native-tls", not(feature = "rustls")))] - pub fn tls_config(mut self, tls_config: volo::net::dial::ClientTlsConfig) -> Self { + /// Sets the [`ClientTlsConfig`] for the client. + #[cfg(any(feature = "rustls", feature = "native-tls"))] + pub fn tls_config(mut self, tls_config: volo::net::dial::ClientTlsConfig) -> Self { self.tls_config = Some(tls_config); self } diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index dd897553..bbc157f6 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -140,21 +140,30 @@ impl DefaultMakeTransport { } } +/// A wrapper around [`tokio_rustls::TlsConnector`] and [`tokio_native_tls::TlsConnector`]. +pub enum TlsConnector { + #[cfg(feature = "rustls")] + Rustls(tokio_rustls::TlsConnector), + #[cfg(feature = "native-tls")] + NativeTls(tokio_native_tls::TlsConnector), +} + +/// TLS config for client #[cfg(any(feature = "rustls", feature = "native-tls"))] -pub struct ClientTlsConfig { +pub struct ClientTlsConfig { domain: String, - connector: C, + connector: TlsConnector, } #[cfg(any(feature = "rustls", feature = "native-tls"))] -pub struct DefaultTlsMakeTransport { +pub struct DefaultTlsMakeTransport { cfg: Config, - tls_config: ClientTlsConfig, + tls_config: ClientTlsConfig, } -#[cfg(feature = "rustls")] -impl DefaultTlsMakeTransport { - pub fn new(tls_config: ClientTlsConfig) -> Self { +#[cfg(any(feature = "rustls", feature = "native-tls"))] +impl DefaultTlsMakeTransport { + pub fn new(tls_config: ClientTlsConfig) -> Self { Self { cfg: Config::default(), tls_config, @@ -165,37 +174,25 @@ impl DefaultTlsMakeTransport { match addr { Address::Ip(addr) => { let tcp = make_tcp_connection(&self.cfg, addr).await?; - let domain = librustls::ServerName::try_from(&self.tls_config.domain[..]) - .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; - self.tls_config.connector.connect(domain, tcp).await - .map(tokio_rustls::TlsStream::Client) - .map(Conn::from) + + match &self.tls_config.connector { + TlsConnector::Rustls(connector) => { + let domain = librustls::ServerName::try_from(&self.tls_config.domain[..]) + .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; + connector.connect(domain, tcp).await + .map(tokio_rustls::TlsStream::Client) + .map(Conn::from) + }, + TlsConnector::NativeTls(connector) => { + let tcp = make_tcp_connection(&self.cfg, addr).await?; + connector.connect(&self.tls_config.domain[..], tcp).await + .map(Conn::from) + .map_err(|e| io::Error::new(io::ErrorKind::Other, e)) + } + } }, #[cfg(target_family = "unix")] Address::Unix(addr) => UnixStream::connect(addr).await.map(Conn::from), } } } - -#[cfg(feature = "native-tls")] -impl DefaultTlsMakeTransport { - pub fn new(tls_config: ClientTlsConfig) -> Self { - Self { - cfg: Config::default(), - tls_config - } - } - - pub async fn make_connection(&self, addr: Address) -> Result { - match addr { - Address::Ip(addr) => { - let tcp = make_tcp_connection(&self.cfg, addr).await?; - self.tls_config.connector.connect(&self.tls_config.domain[..], tcp).await - .map(Conn::from) - .map_err(|e| io::Error::new(io::ErrorKind::Other, e)) - }, - #[cfg(target_family = "unix")] - Address::Unix(addr) => UnixStream::connect(addr).await.map(Conn::from), - } - } -} \ No newline at end of file From f86268ae3c21154db435caa899d089988d08e9d1 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 21:09:50 -0700 Subject: [PATCH 08/30] stop tracking Cargo.lock --- Cargo.lock | 3069 ---------------------------------------------------- 1 file changed, 3069 deletions(-) delete mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 50a20a76..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,3069 +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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anstream" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" - -[[package]] -name = "anstyle-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "anstyle-wincon" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" -dependencies = [ - "anstyle", - "windows-sys", -] - -[[package]] -name = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - -[[package]] -name = "async-broadcast" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" -dependencies = [ - "event-listener", - "futures-core", -] - -[[package]] -name = "async-recursion" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[package]] -name = "async-stream" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[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.33", -] - -[[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.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[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 = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -dependencies = [ - "serde", -] - -[[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 = "chrono" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "windows-targets", -] - -[[package]] -name = "clap" -version = "4.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", - "terminal_size", -] - -[[package]] -name = "clap_derive" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[package]] -name = "clap_lex" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - -[[package]] -name = "colored" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" -dependencies = [ - "is-terminal", - "lazy_static", - "windows-sys", -] - -[[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 = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", -] - -[[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 = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.0", - "lock_api", - "once_cell", - "parking_lot_core 0.9.8", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "directories" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "env_logger" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - -[[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.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "examples" -version = "0.0.0" -dependencies = [ - "anyhow", - "async-stream", - "async-trait", - "lazy_static", - "metainfo", - "pilota", - "tokio", - "tokio-stream", - "tracing", - "tracing-subscriber", - "volo", - "volo-gen", - "volo-grpc", - "volo-thrift", -] - -[[package]] -name = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" - -[[package]] -name = "faststr" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284eac9300ad17d2492e1e87219768b8ab97fb2c74a61cdbc0ced31d3f711159" -dependencies = [ - "bytes", - "serde", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[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 = "fsio" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0" -dependencies = [ - "dunce", - "rand", -] - -[[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-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[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-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 = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[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 = "h2" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 1.9.3", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "http" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" -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 = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[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", - "socket2 0.4.9", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[package]] -name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[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 = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "integer-encoding" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" -dependencies = [ - "async-trait", - "tokio", -] - -[[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", -] - -[[package]] -name = "ipnet" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" - -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.13", - "windows-sys", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[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 = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.148" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" - -[[package]] -name = "libm" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linkedbytes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20a196eed38906d45351c7ed2cced83bb31e48637449d30ef397f6d35c09190d" -dependencies = [ - "bytes", - "faststr", - "tokio", -] - -[[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.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" - -[[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" - -[[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 = "matchit" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" - -[[package]] -name = "memchr" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "metainfo" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e688d0297eb1f8bb438cc9145f24d8dd1d1fce1bb02857ec140f6d7bb9bf404a" -dependencies = [ - "faststr", - "fxhash", - "paste", - "tokio", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" -dependencies = [ - "libc", - "wasi", - "windows-sys", -] - -[[package]] -name = "motore" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "110e416ff69dbeaf664c3cfe17800058a6636115dcefe7d8176a429eabc3a3c4" -dependencies = [ - "futures", - "motore-macros", - "pin-project", - "tokio", - "tower", -] - -[[package]] -name = "motore-macros" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d94e11446e793bddb50dfb5d129cca79f0ca3ed515e0d1914e8d8ae55716e9" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "mur3" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97af489e1e21b68de4c390ecca6703318bc1aa16e9733bcb62c089b73c6fbb1b" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normpath" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" -dependencies = [ - "windows-sys", -] - -[[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-traits" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" -dependencies = [ - "autocfg", - "libm", -] - -[[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 = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[package]] -name = "object" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "openssl" -version = "0.10.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" -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.33", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[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 0.8.6", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core 0.9.8", -] - -[[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 = "parking_lot_core" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.3.5", - "smallvec", - "windows-targets", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.0.0", -] - -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_macros", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared", - "rand", -] - -[[package]] -name = "phf_macros" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pilota" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6bdd97afd388beda3267ee10487cd8d6d8f44e88b29c8e837ce3bf925eb362e" -dependencies = [ - "anyhow", - "async-recursion", - "async-trait", - "bytes", - "derivative", - "faststr", - "integer-encoding", - "lazy_static", - "linkedbytes", - "paste", - "proptest", - "serde", - "smallvec", - "thiserror", - "tokio", -] - -[[package]] -name = "pilota-build" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8151d64b6ecf41e035e151391b374810572f574c5ab272fa31b5222ff4476748" -dependencies = [ - "anyhow", - "dashmap", - "faststr", - "fxhash", - "heck 0.4.1", - "itertools 0.10.5", - "lazy_static", - "normpath", - "paste", - "petgraph", - "phf", - "pilota-thrift-parser", - "proc-macro2", - "protobuf-parse2", - "protobuf2", - "quote", - "rayon", - "salsa", - "scoped-tls", - "serde", - "serde_yaml", - "syn 2.0.33", - "toml", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "pilota-thrift-parser" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6248d1c9c5eb01b579ae6b9373eca87919a205e41d7b815758cdf323d97029f0" -dependencies = [ - "nom", -] - -[[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.33", -] - -[[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 = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "pretty_env_logger" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c" -dependencies = [ - "env_logger", - "log", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - -[[package]] -name = "proc-macro2" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proptest" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" -dependencies = [ - "bit-set", - "bitflags 1.3.2", - "byteorder", - "lazy_static", - "num-traits", - "rand", - "rand_chacha", - "rand_xorshift", - "regex-syntax 0.6.29", - "rusty-fork", - "tempfile", - "unarray", -] - -[[package]] -name = "protobuf-parse2" -version = "4.0.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5df535ab890834ebe9cc42b680bf38d8fed1345fb576f60e48b42bb93aadcb" -dependencies = [ - "anyhow", - "indexmap 1.9.3", - "log", - "protobuf-support2", - "protobuf2", - "tempfile", - "thiserror", - "which", -] - -[[package]] -name = "protobuf-support2" -version = "4.0.0-alpha.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6e937299e45024fae149d242cee9719048e4890dbc28c0d1838ed0aba8c3ec" -dependencies = [ - "thiserror", -] - -[[package]] -name = "protobuf2" -version = "4.0.0-alpha.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc090e26a62f7d66cfc6cd8715ab0973f57287293488a8d05e68fd4d5bb4ad05" -dependencies = [ - "once_cell", - "protobuf-support2", - "thiserror", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[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 = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rayon" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - -[[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 = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall 0.2.16", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.3.8", - "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.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" -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 = "reqwest" -version = "0.11.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" -dependencies = [ - "base64 0.21.4", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots 0.25.2", - "winreg", -] - -[[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", - "untrusted", - "web-sys", - "winapi", -] - -[[package]] -name = "run_script" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829f98fdc58d78989dd9af83be28bc15c94a7d77f9ecdb54abbbc0b1829ba9c7" -dependencies = [ - "fsio", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys", -] - -[[package]] -name = "rustix" -version = "0.38.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" -dependencies = [ - "bitflags 2.4.0", - "errno", - "libc", - "linux-raw-sys 0.4.7", - "windows-sys", -] - -[[package]] -name = "rustls" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.5", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" -dependencies = [ - "base64 0.21.4", -] - -[[package]] -name = "rustls-webpki" -version = "0.100.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", -] - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "salsa" -version = "0.17.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b223dccb46c32753144d0b51290da7230bb4aedcd8379d6b4c9a474c18bf17a" -dependencies = [ - "crossbeam-utils", - "indexmap 1.9.3", - "lock_api", - "log", - "oorandom", - "parking_lot 0.11.2", - "rustc-hash", - "salsa-macros", - "smallvec", -] - -[[package]] -name = "salsa-macros" -version = "0.17.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6c2e352df550bf019da7b16164ed2f7fa107c39653d1311d1bba42d1582ff7" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" -dependencies = [ - "windows-sys", -] - -[[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", - "untrusted", -] - -[[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 = "serde" -version = "1.0.188" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.188" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[package]] -name = "serde_json" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_yaml" -version = "0.9.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" -dependencies = [ - "indexmap 2.0.0", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - -[[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-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[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.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" -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", - "redox_syscall 0.3.5", - "rustix 0.38.13", - "windows-sys", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "terminal_size" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" -dependencies = [ - "rustix 0.37.23", - "windows-sys", -] - -[[package]] -name = "thiserror" -version = "1.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[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.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot 0.12.1", - "pin-project-lite", - "signal-hook-registry", - "socket2 0.5.4", - "tokio-macros", - "windows-sys", -] - -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[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 = "toml" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.0.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[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", - "log", - "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.33", -] - -[[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 = "try-lock" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[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.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - -[[package]] -name = "unsafe-libyaml" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "update-informer" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f8811797a24ff123db3c6e1087aa42551d03d772b3724be421ad063da1f5f3f" -dependencies = [ - "directories", - "reqwest", - "semver", - "serde", - "serde_json", - "ureq", -] - -[[package]] -name = "ureq" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" -dependencies = [ - "base64 0.21.4", - "flate2", - "log", - "once_cell", - "rustls", - "rustls-webpki 0.100.3", - "serde", - "serde_json", - "url", - "webpki-roots 0.23.1", -] - -[[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 = "url_path" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10477a8879b7fc3bb4fb54fa6adcfd6191de561b13d5413fec9cc0239fd1c882" - -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "volo" -version = "0.5.5" -dependencies = [ - "async-broadcast", - "async-trait", - "dashmap", - "faststr", - "futures", - "lazy_static", - "libc", - "metainfo", - "motore", - "mur3", - "nix", - "once_cell", - "pin-project", - "rand", - "socket2 0.5.4", - "thiserror", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "tokio-stream", - "tower", - "tracing", -] - -[[package]] -name = "volo-build" -version = "0.6.2" -dependencies = [ - "anyhow", - "async-trait", - "dirs", - "heck 0.4.1", - "itertools 0.11.0", - "lazy_static", - "nom", - "normpath", - "once_cell", - "paste", - "pathdiff", - "pilota-build", - "proc-macro2", - "quote", - "serde", - "serde_yaml", - "syn 1.0.109", - "tempfile", - "url_path", - "volo", - "walkdir", -] - -[[package]] -name = "volo-cli" -version = "0.6.2" -dependencies = [ - "anyhow", - "clap", - "colored", - "heck 0.4.1", - "itertools 0.11.0", - "lazy_static", - "log", - "normpath", - "pilota-thrift-parser", - "pretty_env_logger", - "regex", - "run_script", - "same-file", - "serde", - "serde_yaml", - "update-informer", - "volo-build", -] - -[[package]] -name = "volo-gen" -version = "0.0.0" -dependencies = [ - "anyhow", - "async-trait", - "futures", - "pilota", - "tokio", - "volo", - "volo-build", - "volo-grpc", - "volo-thrift", -] - -[[package]] -name = "volo-grpc" -version = "0.6.0" -dependencies = [ - "anyhow", - "async-stream", - "async-trait", - "base64 0.13.1", - "bytes", - "flate2", - "futures", - "futures-util", - "fxhash", - "h2", - "hex", - "http", - "http-body", - "hyper", - "hyper-timeout", - "matchit", - "metainfo", - "motore", - "percent-encoding", - "pilota", - "pin-project", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "tokio-stream", - "tokio-util", - "tower", - "tracing", - "tracing-subscriber", - "volo", -] - -[[package]] -name = "volo-http" -version = "0.0.0" - -[[package]] -name = "volo-macros" -version = "0.3.0" - -[[package]] -name = "volo-thrift" -version = "0.7.3" -dependencies = [ - "anyhow", - "async-trait", - "bytes", - "chrono", - "futures", - "fxhash", - "lazy_static", - "linked-hash-map", - "linkedbytes", - "metainfo", - "motore", - "num_enum", - "parking_lot 0.12.1", - "paste", - "pilota", - "pin-project", - "thiserror", - "tokio", - "tracing", - "volo", -] - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - -[[package]] -name = "walkdir" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", -] - -[[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.33", - "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.33", - "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 = "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.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.3", -] - -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.13", -] - -[[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 = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[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_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[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_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "winnow" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys", -] From a5ec21cff3adb2e6334d164cd4f7bf02cd8d2f7f Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 21:31:27 -0700 Subject: [PATCH 09/30] wrap native tls acceptor/connector with Arc --- volo-grpc/src/lib.rs | 1 + volo-grpc/src/server/mod.rs | 6 ++++++ volo-grpc/src/transport/tls.rs | 28 ++++++++++++++++++++++-- volo/src/lib.rs | 1 + volo/src/net/dial.rs | 39 +++++++++++++++++++++++++++++++++- 5 files changed, 72 insertions(+), 3 deletions(-) diff --git a/volo-grpc/src/lib.rs b/volo-grpc/src/lib.rs index 0290d133..3e7979f9 100644 --- a/volo-grpc/src/lib.rs +++ b/volo-grpc/src/lib.rs @@ -3,6 +3,7 @@ )] #![cfg_attr(not(doctest), doc = include_str!("../README.md"))] #![feature(impl_trait_in_assoc_type)] +#![feature(doc_cfg)] pub mod body; pub mod client; diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index cd624654..cb4f08b2 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -37,6 +37,7 @@ pub struct Server { http2_config: Http2Config, router: Router, + #[cfg(any(feature = "rustls", feature = "native-tls"))] tls_config: Option, } @@ -59,6 +60,11 @@ impl Server { } impl Server { + /// Sets the TLS configuration for the server. + /// + /// If not set, the server will not use TLS. + #[doc(cfg(any(feature = "rustls", feature = "native-tls")))] + #[cfg(any(feature = "rustls", feature = "native-tls"))] pub fn tls_config(mut self, value: impl Into) -> Self { self.tls_config = Some(value.into()); self diff --git a/volo-grpc/src/transport/tls.rs b/volo-grpc/src/transport/tls.rs index b1f591c4..88fc1ae8 100644 --- a/volo-grpc/src/transport/tls.rs +++ b/volo-grpc/src/transport/tls.rs @@ -1,17 +1,29 @@ +/// TLS configuration for a server. +#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] +#[cfg(any(feature = "rustls", feature = "native-tls"))] #[derive(Clone)] pub struct ServerTlsConfig { pub acceptor: TlsAcceptor, } +/// A wrapper around [`tokio_rustls::TlsAcceptor`] and [`tokio_native_tls::TlsAcceptor`]. +#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] +#[cfg(any(feature = "rustls", feature = "native-tls"))] #[derive(Clone)] pub enum TlsAcceptor { + /// `tokio_rustls::TlsAcceptor` internally uses `Arc` + #[doc(cfg(feature = "rustls"))] #[cfg(feature = "rustls")] Rustls(tokio_rustls::TlsAcceptor), + /// This takes an `Arc` because it does not internally use `Arc` + #[doc(cfg(feature = "native-tls"))] #[cfg(feature = "native-tls")] - NativeTls(tokio_native_tls::TlsAcceptor), + NativeTls(std::sync::Arc), } +#[doc(cfg(feature = "rustls"))] +#[cfg(feature = "rustls")] impl From for ServerTlsConfig { fn from(value: tokio_rustls::TlsAcceptor) -> Self { Self { @@ -20,10 +32,22 @@ impl From for ServerTlsConfig { } } +#[doc(cfg(feature = "native-tls"))] +#[cfg(feature = "native-tls")] +impl From> for ServerTlsConfig { + fn from(value: std::sync::Arc) -> Self { + Self { + acceptor: TlsAcceptor::NativeTls(value), + } + } +} + +#[doc(cfg(feature = "native-tls"))] +#[cfg(feature = "native-tls")] impl From for ServerTlsConfig { fn from(value: tokio_native_tls::TlsAcceptor) -> Self { Self { - acceptor: TlsAcceptor::NativeTls(value), + acceptor: TlsAcceptor::NativeTls(std::sync::Arc::new(value)), } } } \ No newline at end of file diff --git a/volo/src/lib.rs b/volo/src/lib.rs index 920fce1a..11b032cd 100644 --- a/volo/src/lib.rs +++ b/volo/src/lib.rs @@ -3,6 +3,7 @@ html_logo_url = "https://github.com/cloudwego/volo/raw/main/.github/assets/logo.png?sanitize=true" )] #![cfg_attr(not(doctest), doc = include_str!("../README.md"))] +#![feature(doc_cfg)] pub use async_trait::async_trait; pub use motore::{layer, layer::Layer, service, Service}; diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index bbc157f6..5924a419 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -141,26 +141,38 @@ impl DefaultMakeTransport { } /// A wrapper around [`tokio_rustls::TlsConnector`] and [`tokio_native_tls::TlsConnector`]. +#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] +#[cfg(any(feature = "rustls", feature = "native-tls"))] +#[derive(Clone)] pub enum TlsConnector { + #[doc(cfg(feature = "rustls"))] #[cfg(feature = "rustls")] Rustls(tokio_rustls::TlsConnector), + + /// This takes an `Arc` because `tokio_native_tls::TlsConnector` does not internally use `Arc` + #[doc(cfg(feature = "native-tls"))] #[cfg(feature = "native-tls")] - NativeTls(tokio_native_tls::TlsConnector), + NativeTls(std::sync::Arc), } /// TLS config for client +#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] #[cfg(any(feature = "rustls", feature = "native-tls"))] +#[derive(Clone)] pub struct ClientTlsConfig { domain: String, connector: TlsConnector, } +#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] #[cfg(any(feature = "rustls", feature = "native-tls"))] +#[derive(Clone)] pub struct DefaultTlsMakeTransport { cfg: Config, tls_config: ClientTlsConfig, } +#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] #[cfg(any(feature = "rustls", feature = "native-tls"))] impl DefaultTlsMakeTransport { pub fn new(tls_config: ClientTlsConfig) -> Self { @@ -196,3 +208,28 @@ impl DefaultTlsMakeTransport { } } } + +#[async_trait::async_trait] +impl MakeTransport for DefaultTlsMakeTransport { + type ReadHalf = OwnedReadHalf; + + type WriteHalf = OwnedWriteHalf; + + async fn make_transport(&self, addr: Address) -> io::Result<(Self::ReadHalf, Self::WriteHalf)> { + let conn = self.make_connection(addr).await?; + let (read, write) = conn.stream.into_split(); + Ok((read, write)) + } + + fn set_connect_timeout(&mut self, timeout: Option) { + self.cfg = self.cfg.with_connect_timeout(timeout); + } + + fn set_read_timeout(&mut self, timeout: Option) { + self.cfg = self.cfg.with_read_timeout(timeout); + } + + fn set_write_timeout(&mut self, timeout: Option) { + self.cfg = self.cfg.with_write_timeout(timeout); + } +} \ No newline at end of file From 4d446077aeb217b7e5ee10470f4c5648cad90601 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 21:32:48 -0700 Subject: [PATCH 10/30] cargo fmt --- volo-grpc/src/client/mod.rs | 2 +- volo-grpc/src/server/mod.rs | 22 ++++++++++++++++------ volo-grpc/src/transport/mod.rs | 2 +- volo-grpc/src/transport/tls.rs | 4 ++-- volo/src/net/conn.rs | 12 +++++++++--- volo/src/net/dial.rs | 17 ++++++++++------- 6 files changed, 39 insertions(+), 20 deletions(-) diff --git a/volo-grpc/src/client/mod.rs b/volo-grpc/src/client/mod.rs index 780bb5a3..b1a0b870 100644 --- a/volo-grpc/src/client/mod.rs +++ b/volo-grpc/src/client/mod.rs @@ -409,7 +409,7 @@ impl ClientBuilder { _marker: self._marker, #[cfg(any(feature = "rustls", feature = "native-tls"))] - tls_config: self.tls_config, + tls_config: self.tls_config, } } diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index cb4f08b2..ec82ccba 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -14,11 +14,21 @@ use motore::{ BoxError, }; pub use service::ServiceBuilder; -use volo::{net::{incoming::Incoming, conn::{Conn, ConnStream}}, spawn}; +use volo::{ + net::{ + conn::{Conn, ConnStream}, + incoming::Incoming, + }, + spawn, +}; pub use self::router::Router; use crate::{ - body::Body, context::ServerContext, server::meta::MetaService, Request, Response, Status, transport::tls::{ServerTlsConfig, TlsAcceptor}, + body::Body, + context::ServerContext, + server::meta::MetaService, + transport::tls::{ServerTlsConfig, TlsAcceptor}, + Request, Response, Status, }; /// A trait to provide a static reference to the service's @@ -61,7 +71,7 @@ impl Server { impl Server { /// Sets the TLS configuration for the server. - /// + /// /// If not set, the server will not use TLS. #[doc(cfg(any(feature = "rustls", feature = "native-tls")))] #[cfg(any(feature = "rustls", feature = "native-tls"))] @@ -208,7 +218,7 @@ impl Server { layer: Stack::new(self.layer, layer), http2_config: self.http2_config, router: self.router, - tls_config: self.tls_config + tls_config: self.tls_config, } } @@ -226,7 +236,7 @@ impl Server { layer: self.layer, http2_config: self.http2_config, router: self.router.add_service(s), - tls_config: self.tls_config + tls_config: self.tls_config, } } @@ -258,7 +268,7 @@ impl Server { tokio::pin!(signal); let (tx, rx) = tokio::sync::watch::channel(()); - + loop { tokio::select! { _ = &mut signal => { diff --git a/volo-grpc/src/transport/mod.rs b/volo-grpc/src/transport/mod.rs index c29a198d..1c422cb2 100644 --- a/volo-grpc/src/transport/mod.rs +++ b/volo-grpc/src/transport/mod.rs @@ -4,4 +4,4 @@ mod client; mod connect; pub(crate) mod tls; -pub use client::ClientTransport; \ No newline at end of file +pub use client::ClientTransport; diff --git a/volo-grpc/src/transport/tls.rs b/volo-grpc/src/transport/tls.rs index 88fc1ae8..e7beed38 100644 --- a/volo-grpc/src/transport/tls.rs +++ b/volo-grpc/src/transport/tls.rs @@ -15,7 +15,7 @@ pub enum TlsAcceptor { #[doc(cfg(feature = "rustls"))] #[cfg(feature = "rustls")] Rustls(tokio_rustls::TlsAcceptor), - + /// This takes an `Arc` because it does not internally use `Arc` #[doc(cfg(feature = "native-tls"))] #[cfg(feature = "native-tls")] @@ -50,4 +50,4 @@ impl From for ServerTlsConfig { acceptor: TlsAcceptor::NativeTls(std::sync::Arc::new(value)), } } -} \ No newline at end of file +} diff --git a/volo/src/net/conn.rs b/volo/src/net/conn.rs index 4d888911..e6d4afc5 100644 --- a/volo/src/net/conn.rs +++ b/volo/src/net/conn.rs @@ -173,12 +173,12 @@ impl ConnStream { Self::Rustls(stream) => { let (rh, wh) = tokio::io::split(stream); (OwnedReadHalf::Rustls(rh), OwnedWriteHalf::Rustls(wh)) - }, + } #[cfg(feature = "native-tls")] Self::NativeTls(stream) => { let (rh, wh) = tokio::io::split(stream); (OwnedReadHalf::NativeTls(rh), OwnedWriteHalf::NativeTls(wh)) - }, + } } } } @@ -319,7 +319,13 @@ impl ConnStream { #[cfg(feature = "rustls")] Self::Rustls(s) => s.get_ref().0.peer_addr().map(Address::from).ok(), #[cfg(feature = "native-tls")] - Self::NativeTls(s) => s.get_ref().get_ref().get_ref().peer_addr().map(Address::from).ok(), + Self::NativeTls(s) => s + .get_ref() + .get_ref() + .get_ref() + .peer_addr() + .map(Address::from) + .ok(), } } } diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index 5924a419..4c0a1ce8 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -26,7 +26,6 @@ pub trait MakeTransport: Clone + Send + Sync + 'static { fn set_write_timeout(&mut self, timeout: Option); } - #[derive(Default, Debug, Clone, Copy)] pub struct DefaultMakeTransport { cfg: Config, @@ -186,23 +185,27 @@ impl DefaultTlsMakeTransport { match addr { Address::Ip(addr) => { let tcp = make_tcp_connection(&self.cfg, addr).await?; - + match &self.tls_config.connector { TlsConnector::Rustls(connector) => { let domain = librustls::ServerName::try_from(&self.tls_config.domain[..]) .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; - connector.connect(domain, tcp).await + connector + .connect(domain, tcp) + .await .map(tokio_rustls::TlsStream::Client) .map(Conn::from) - }, + } TlsConnector::NativeTls(connector) => { let tcp = make_tcp_connection(&self.cfg, addr).await?; - connector.connect(&self.tls_config.domain[..], tcp).await + connector + .connect(&self.tls_config.domain[..], tcp) + .await .map(Conn::from) .map_err(|e| io::Error::new(io::ErrorKind::Other, e)) } } - }, + } #[cfg(target_family = "unix")] Address::Unix(addr) => UnixStream::connect(addr).await.map(Conn::from), } @@ -232,4 +235,4 @@ impl MakeTransport for DefaultTlsMakeTransport { fn set_write_timeout(&mut self, timeout: Option) { self.cfg = self.cfg.with_write_timeout(timeout); } -} \ No newline at end of file +} From 25bf7829dc0be3018b994449df61b771d500dca1 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 21:37:48 -0700 Subject: [PATCH 11/30] added #[cfg] to deal w/ unused imports --- volo/src/net/incoming.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/volo/src/net/incoming.rs b/volo/src/net/incoming.rs index 989155cb..3329c8e3 100644 --- a/volo/src/net/incoming.rs +++ b/volo/src/net/incoming.rs @@ -116,9 +116,12 @@ impl Stream for DefaultIncoming { #[cfg(target_family = "unix")] mod unix_helper { + #[cfg(target_os = "linux")] use std::{ fs::File, io::{BufRead, BufReader}, + }; + use std::{ net::{SocketAddr, TcpListener}, os::{ fd::{AsRawFd, FromRawFd, IntoRawFd}, @@ -169,6 +172,7 @@ mod unix_helper { (values[0], values[1]) } + #[cfg(target_os = "linux")] pub fn split_at_bytes(s: &str, t: &str) -> Vec { let mut result = Vec::new(); let mut last = 0; @@ -186,6 +190,7 @@ mod unix_helper { result } + #[cfg(target_os = "linux")] pub fn get_fields(s: &str) -> Vec { split_at_bytes(s, " \r\t\n") } From ecc8da407e6e7cf971efc1e2f70c830dcc7cc90d Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 22:25:55 -0700 Subject: [PATCH 12/30] replace cfg attr w/ macro --- volo-grpc/Cargo.toml | 2 +- volo-grpc/src/cfg.rs | 29 ++++++ volo-grpc/src/lib.rs | 3 + volo-grpc/src/server/mod.rs | 21 +++-- volo/Cargo.toml | 2 +- volo/src/cfg.rs | 29 ++++++ volo/src/lib.rs | 3 + volo/src/net/conn.rs | 40 ++++++--- volo/src/net/dial.rs | 172 +++++++++++++++++------------------- 9 files changed, 188 insertions(+), 113 deletions(-) create mode 100644 volo-grpc/src/cfg.rs create mode 100644 volo/src/cfg.rs diff --git a/volo-grpc/Cargo.toml b/volo-grpc/Cargo.toml index f342bfe0..b0d028fa 100644 --- a/volo-grpc/Cargo.toml +++ b/volo-grpc/Cargo.toml @@ -62,7 +62,7 @@ tokio-native-tls = { version = "0.3", optional = true } tracing-subscriber.workspace = true [features] -default = ["rustls", "native-tls"] +default = [] rustls = ["tokio-rustls"] native-tls = ["tokio-native-tls"] \ No newline at end of file diff --git a/volo-grpc/src/cfg.rs b/volo-grpc/src/cfg.rs new file mode 100644 index 00000000..971221cb --- /dev/null +++ b/volo-grpc/src/cfg.rs @@ -0,0 +1,29 @@ +macro_rules! cfg_rustls { + ($($item:item)*) => { + $( + #[cfg(feature = "rustls")] + #[doc(cfg(feature = "rustls"))] + $item + )* + } +} + +macro_rules! cfg_native_tls { + ($($item:item)*) => { + $( + #[cfg(feature = "native-tls")] + #[doc(cfg(feature = "native-tls"))] + $item + )* + } +} + +macro_rules! cfg_rustls_or_native_tls { + ($($item:item)*) => { + $( + #[cfg(any(feature = "rustls", feature = "native-tls"))] + #[doc(cfg(any(feature = "rustls", feature = "native-tls")))] + $item + )* + } +} \ No newline at end of file diff --git a/volo-grpc/src/lib.rs b/volo-grpc/src/lib.rs index 3e7979f9..8b20d6b3 100644 --- a/volo-grpc/src/lib.rs +++ b/volo-grpc/src/lib.rs @@ -5,6 +5,9 @@ #![feature(impl_trait_in_assoc_type)] #![feature(doc_cfg)] +#[macro_use] +mod cfg; + pub mod body; pub mod client; pub mod codec; diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index ec82ccba..230e1898 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -64,20 +64,22 @@ impl Server { layer: Identity::new(), http2_config: Http2Config::default(), router: Router::new(), + + #[cfg(any(feature = "rustls", feature = "native-tls"))] tls_config: None, } } } impl Server { - /// Sets the TLS configuration for the server. - /// - /// If not set, the server will not use TLS. - #[doc(cfg(any(feature = "rustls", feature = "native-tls")))] - #[cfg(any(feature = "rustls", feature = "native-tls"))] - pub fn tls_config(mut self, value: impl Into) -> Self { - self.tls_config = Some(value.into()); - self + cfg_rustls_or_native_tls! { + /// Sets the TLS configuration for the server. + /// + /// If not set, the server will not use TLS. + pub fn tls_config(mut self, value: impl Into) -> Self { + self.tls_config = Some(value.into()); + self + } } /// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`] option for HTTP2 @@ -198,6 +200,7 @@ impl Server { layer: Stack::new(layer, self.layer), http2_config: self.http2_config, router: self.router, + #[cfg(any(feature = "rustls", feature = "native-tls"))] tls_config: self.tls_config, } } @@ -218,6 +221,7 @@ impl Server { layer: Stack::new(self.layer, layer), http2_config: self.http2_config, router: self.router, + #[cfg(any(feature = "rustls", feature = "native-tls"))] tls_config: self.tls_config, } } @@ -236,6 +240,7 @@ impl Server { layer: self.layer, http2_config: self.http2_config, router: self.router.add_service(s), + #[cfg(any(feature = "rustls", feature = "native-tls"))] tls_config: self.tls_config, } } diff --git a/volo/Cargo.toml b/volo/Cargo.toml index 895ed1e2..eb980b17 100644 --- a/volo/Cargo.toml +++ b/volo/Cargo.toml @@ -48,7 +48,7 @@ tokio-rustls = { version = "0.24", optional = true } tokio-native-tls = { version = "0.3", optional = true } [features] -default = ["rustls", "native-tls"] +default = [] rustls = ["tokio-rustls", "librustls"] native-tls = ["tokio-native-tls"] \ No newline at end of file diff --git a/volo/src/cfg.rs b/volo/src/cfg.rs new file mode 100644 index 00000000..971221cb --- /dev/null +++ b/volo/src/cfg.rs @@ -0,0 +1,29 @@ +macro_rules! cfg_rustls { + ($($item:item)*) => { + $( + #[cfg(feature = "rustls")] + #[doc(cfg(feature = "rustls"))] + $item + )* + } +} + +macro_rules! cfg_native_tls { + ($($item:item)*) => { + $( + #[cfg(feature = "native-tls")] + #[doc(cfg(feature = "native-tls"))] + $item + )* + } +} + +macro_rules! cfg_rustls_or_native_tls { + ($($item:item)*) => { + $( + #[cfg(any(feature = "rustls", feature = "native-tls"))] + #[doc(cfg(any(feature = "rustls", feature = "native-tls")))] + $item + )* + } +} \ No newline at end of file diff --git a/volo/src/lib.rs b/volo/src/lib.rs index 11b032cd..bb0edd17 100644 --- a/volo/src/lib.rs +++ b/volo/src/lib.rs @@ -5,6 +5,9 @@ #![cfg_attr(not(doctest), doc = include_str!("../README.md"))] #![feature(doc_cfg)] +#[macro_use] +mod cfg; + pub use async_trait::async_trait; pub use motore::{layer, layer::Layer, service, Service}; pub use tokio::main; diff --git a/volo/src/net/conn.rs b/volo/src/net/conn.rs index e6d4afc5..8c39dc9e 100644 --- a/volo/src/net/conn.rs +++ b/volo/src/net/conn.rs @@ -34,8 +34,13 @@ pub enum ConnStream { NativeTls(#[pin] tokio_native_tls::TlsStream), } -type RustlsWriteHalf = tokio::io::WriteHalf>; -type NativeTlsWriteHalf = tokio::io::WriteHalf>; +cfg_rustls! { + type RustlsWriteHalf = tokio::io::WriteHalf>; +} + +cfg_native_tls! { + type NativeTlsWriteHalf = tokio::io::WriteHalf>; +} #[pin_project(project = OwnedWriteHalfProj)] pub enum OwnedWriteHalf { @@ -123,8 +128,13 @@ impl AsyncWrite for OwnedWriteHalf { } } -type RustlsReadHalf = tokio::io::ReadHalf>; -type NativeTlsReadHalf = tokio::io::ReadHalf>; +cfg_rustls! { + type RustlsReadHalf = tokio::io::ReadHalf>; +} + +cfg_native_tls! { + type NativeTlsReadHalf = tokio::io::ReadHalf>; +} #[pin_project(project = OwnedReadHalfProj)] pub enum OwnedReadHalf { @@ -199,19 +209,21 @@ impl From for ConnStream { } } -#[cfg(feature = "rustls")] -impl From> for ConnStream { - #[inline] - fn from(s: tokio_rustls::TlsStream) -> Self { - Self::Rustls(s) +cfg_rustls! { + impl From> for ConnStream { + #[inline] + fn from(s: tokio_rustls::TlsStream) -> Self { + Self::Rustls(s) + } } } -#[cfg(feature = "native-tls")] -impl From> for ConnStream { - #[inline] - fn from(s: tokio_native_tls::TlsStream) -> Self { - Self::NativeTls(s) +cfg_native_tls! { + impl From> for ConnStream { + #[inline] + fn from(s: tokio_native_tls::TlsStream) -> Self { + Self::NativeTls(s) + } } } diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index 4c0a1ce8..fa455cd4 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -139,100 +139,94 @@ impl DefaultMakeTransport { } } -/// A wrapper around [`tokio_rustls::TlsConnector`] and [`tokio_native_tls::TlsConnector`]. -#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] -#[cfg(any(feature = "rustls", feature = "native-tls"))] -#[derive(Clone)] -pub enum TlsConnector { - #[doc(cfg(feature = "rustls"))] - #[cfg(feature = "rustls")] - Rustls(tokio_rustls::TlsConnector), - - /// This takes an `Arc` because `tokio_native_tls::TlsConnector` does not internally use `Arc` - #[doc(cfg(feature = "native-tls"))] - #[cfg(feature = "native-tls")] - NativeTls(std::sync::Arc), -} - -/// TLS config for client -#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] -#[cfg(any(feature = "rustls", feature = "native-tls"))] -#[derive(Clone)] -pub struct ClientTlsConfig { - domain: String, - connector: TlsConnector, -} - -#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] -#[cfg(any(feature = "rustls", feature = "native-tls"))] -#[derive(Clone)] -pub struct DefaultTlsMakeTransport { - cfg: Config, - tls_config: ClientTlsConfig, -} - -#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] -#[cfg(any(feature = "rustls", feature = "native-tls"))] -impl DefaultTlsMakeTransport { - pub fn new(tls_config: ClientTlsConfig) -> Self { - Self { - cfg: Config::default(), - tls_config, +cfg_rustls_or_native_tls! { + /// A wrapper around [`tokio_rustls::TlsConnector`] and [`tokio_native_tls::TlsConnector`]. + #[derive(Clone)] + pub enum TlsConnector { + #[doc(cfg(feature = "rustls"))] + #[cfg(feature = "rustls")] + Rustls(tokio_rustls::TlsConnector), + + /// This takes an `Arc` because `tokio_native_tls::TlsConnector` does not internally use `Arc` + #[doc(cfg(feature = "native-tls"))] + #[cfg(feature = "native-tls")] + NativeTls(std::sync::Arc), + } + + /// TLS config for client + #[derive(Clone)] + pub struct ClientTlsConfig { + domain: String, + connector: TlsConnector, + } + + #[derive(Clone)] + pub struct DefaultTlsMakeTransport { + cfg: Config, + tls_config: ClientTlsConfig, + } + + impl DefaultTlsMakeTransport { + pub fn new(tls_config: ClientTlsConfig) -> Self { + Self { + cfg: Config::default(), + tls_config, + } } - } - - pub async fn make_connection(&self, addr: Address) -> Result { - match addr { - Address::Ip(addr) => { - let tcp = make_tcp_connection(&self.cfg, addr).await?; - - match &self.tls_config.connector { - TlsConnector::Rustls(connector) => { - let domain = librustls::ServerName::try_from(&self.tls_config.domain[..]) - .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; - connector - .connect(domain, tcp) - .await - .map(tokio_rustls::TlsStream::Client) - .map(Conn::from) - } - TlsConnector::NativeTls(connector) => { - let tcp = make_tcp_connection(&self.cfg, addr).await?; - connector - .connect(&self.tls_config.domain[..], tcp) - .await - .map(Conn::from) - .map_err(|e| io::Error::new(io::ErrorKind::Other, e)) + + pub async fn make_connection(&self, addr: Address) -> Result { + match addr { + Address::Ip(addr) => { + let tcp = make_tcp_connection(&self.cfg, addr).await?; + + match &self.tls_config.connector { + TlsConnector::Rustls(connector) => { + let domain = librustls::ServerName::try_from(&self.tls_config.domain[..]) + .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; + connector + .connect(domain, tcp) + .await + .map(tokio_rustls::TlsStream::Client) + .map(Conn::from) + } + TlsConnector::NativeTls(connector) => { + let tcp = make_tcp_connection(&self.cfg, addr).await?; + connector + .connect(&self.tls_config.domain[..], tcp) + .await + .map(Conn::from) + .map_err(|e| io::Error::new(io::ErrorKind::Other, e)) + } } } + #[cfg(target_family = "unix")] + Address::Unix(addr) => UnixStream::connect(addr).await.map(Conn::from), } - #[cfg(target_family = "unix")] - Address::Unix(addr) => UnixStream::connect(addr).await.map(Conn::from), } } -} - -#[async_trait::async_trait] -impl MakeTransport for DefaultTlsMakeTransport { - type ReadHalf = OwnedReadHalf; - - type WriteHalf = OwnedWriteHalf; - - async fn make_transport(&self, addr: Address) -> io::Result<(Self::ReadHalf, Self::WriteHalf)> { - let conn = self.make_connection(addr).await?; - let (read, write) = conn.stream.into_split(); - Ok((read, write)) - } - - fn set_connect_timeout(&mut self, timeout: Option) { - self.cfg = self.cfg.with_connect_timeout(timeout); - } - - fn set_read_timeout(&mut self, timeout: Option) { - self.cfg = self.cfg.with_read_timeout(timeout); - } - - fn set_write_timeout(&mut self, timeout: Option) { - self.cfg = self.cfg.with_write_timeout(timeout); + + #[async_trait::async_trait] + impl MakeTransport for DefaultTlsMakeTransport { + type ReadHalf = OwnedReadHalf; + + type WriteHalf = OwnedWriteHalf; + + async fn make_transport(&self, addr: Address) -> io::Result<(Self::ReadHalf, Self::WriteHalf)> { + let conn = self.make_connection(addr).await?; + let (read, write) = conn.stream.into_split(); + Ok((read, write)) + } + + fn set_connect_timeout(&mut self, timeout: Option) { + self.cfg = self.cfg.with_connect_timeout(timeout); + } + + fn set_read_timeout(&mut self, timeout: Option) { + self.cfg = self.cfg.with_read_timeout(timeout); + } + + fn set_write_timeout(&mut self, timeout: Option) { + self.cfg = self.cfg.with_write_timeout(timeout); + } } } From a8fb05c6fdbee83575a0876f493af8bfb1eefe79 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 23:08:47 -0700 Subject: [PATCH 13/30] pub re-export TlsAcceptor and ServerTlsConfig --- volo-grpc/src/transport/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/volo-grpc/src/transport/mod.rs b/volo-grpc/src/transport/mod.rs index 1c422cb2..2810b975 100644 --- a/volo-grpc/src/transport/mod.rs +++ b/volo-grpc/src/transport/mod.rs @@ -2,6 +2,7 @@ mod client; mod connect; -pub(crate) mod tls; +mod tls; pub use client::ClientTransport; +pub use tls::{ServerTlsConfig, TlsAcceptor}; From a1cb98588eee21b12a01d2b473fb9ab225af2a0d Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 23:09:22 -0700 Subject: [PATCH 14/30] added more cfg for rustls and native-tls --- volo-grpc/src/server/mod.rs | 54 ++++++++++++++++++++++--------------- volo/src/net/dial.rs | 2 ++ 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index 230e1898..643553db 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -16,7 +16,7 @@ use motore::{ pub use service::ServiceBuilder; use volo::{ net::{ - conn::{Conn, ConnStream}, + conn::Conn, incoming::Incoming, }, spawn, @@ -27,10 +27,15 @@ use crate::{ body::Body, context::ServerContext, server::meta::MetaService, - transport::tls::{ServerTlsConfig, TlsAcceptor}, Request, Response, Status, }; +cfg_rustls_or_native_tls! { + use volo::net::conn::ConnStream; + + use crate::transport::{ServerTlsConfig, TlsAcceptor}; +} + /// A trait to provide a static reference to the service's /// name. This is used for routing service's within the router. pub trait NamedService { @@ -289,27 +294,32 @@ impl Server { Some(c) => c, None => return Ok(()), }; - let info = conn.info; - // Only perform TLS handshake if either rustls or native-tls is configured - let conn: Conn = match (conn.stream, self.tls_config.as_ref().map(|o| &o.acceptor)) { - (volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::Rustls(tls_acceptor))) => { - let stream = tls_acceptor.accept(tcp).await?; - Conn { - stream: ConnStream::Rustls(tokio_rustls::TlsStream::Server(stream)), + #[cfg(any(feature = "rustls", feature = "native-tls"))] + let conn: Conn = { + let info = conn.info; + // Only perform TLS handshake if either rustls or native-tls is configured + match (conn.stream, self.tls_config.as_ref().map(|o| &o.acceptor)) { + #[cfg(feature = "rustls")] + (volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::Rustls(tls_acceptor))) => { + let stream = tls_acceptor.accept(tcp).await?; + Conn { + stream: ConnStream::Rustls(tokio_rustls::TlsStream::Server(stream)), + info + } + }, + #[cfg(feature = "native-tls")] + (volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::NativeTls(tls_acceptor))) => { + let stream = tls_acceptor.accept(tcp).await?; + Conn { + stream: ConnStream::NativeTls(stream), + info, + } + }, + (stream, _) => Conn { + stream, info - } - }, - (volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::NativeTls(tls_acceptor))) => { - let stream = tls_acceptor.accept(tcp).await?; - Conn { - stream: ConnStream::NativeTls(stream), - info, - } - }, - (stream, _) => Conn { - stream, - info - }, + }, + } }; tracing::trace!("[VOLO] recv a connection from: {:?}", conn.info.peer_addr); diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index fa455cd4..e6f36b0d 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -180,6 +180,7 @@ cfg_rustls_or_native_tls! { let tcp = make_tcp_connection(&self.cfg, addr).await?; match &self.tls_config.connector { + #[cfg(feature = "rustls")] TlsConnector::Rustls(connector) => { let domain = librustls::ServerName::try_from(&self.tls_config.domain[..]) .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; @@ -189,6 +190,7 @@ cfg_rustls_or_native_tls! { .map(tokio_rustls::TlsStream::Client) .map(Conn::from) } + #[cfg(feature = "native-tls")] TlsConnector::NativeTls(connector) => { let tcp = make_tcp_connection(&self.cfg, addr).await?; connector From 06d3a865ca6873d57493f1808d929d27fc6d23b5 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 23:37:51 -0700 Subject: [PATCH 15/30] changed cfg attr to macro --- volo-grpc/src/transport/tls.rs | 81 ++++++++++++++++------------------ 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/volo-grpc/src/transport/tls.rs b/volo-grpc/src/transport/tls.rs index e7beed38..6f92486a 100644 --- a/volo-grpc/src/transport/tls.rs +++ b/volo-grpc/src/transport/tls.rs @@ -1,53 +1,50 @@ -/// TLS configuration for a server. -#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] -#[cfg(any(feature = "rustls", feature = "native-tls"))] -#[derive(Clone)] -pub struct ServerTlsConfig { - pub acceptor: TlsAcceptor, -} - -/// A wrapper around [`tokio_rustls::TlsAcceptor`] and [`tokio_native_tls::TlsAcceptor`]. -#[doc(cfg(any(feature = "rustls", feature = "native-tls")))] -#[cfg(any(feature = "rustls", feature = "native-tls"))] -#[derive(Clone)] -pub enum TlsAcceptor { - /// `tokio_rustls::TlsAcceptor` internally uses `Arc` - #[doc(cfg(feature = "rustls"))] - #[cfg(feature = "rustls")] - Rustls(tokio_rustls::TlsAcceptor), - - /// This takes an `Arc` because it does not internally use `Arc` - #[doc(cfg(feature = "native-tls"))] - #[cfg(feature = "native-tls")] - NativeTls(std::sync::Arc), +cfg_rustls_or_native_tls! { + /// TLS configuration for a server. + #[derive(Clone)] + pub struct ServerTlsConfig { + pub acceptor: TlsAcceptor, + } + + /// A wrapper around [`tokio_rustls::TlsAcceptor`] and [`tokio_native_tls::TlsAcceptor`]. + #[derive(Clone)] + pub enum TlsAcceptor { + /// `tokio_rustls::TlsAcceptor` internally uses `Arc` + #[doc(cfg(feature = "rustls"))] + #[cfg(feature = "rustls")] + Rustls(tokio_rustls::TlsAcceptor), + + /// This takes an `Arc` because it does not internally use `Arc` + #[doc(cfg(feature = "native-tls"))] + #[cfg(feature = "native-tls")] + NativeTls(std::sync::Arc), + } } -#[doc(cfg(feature = "rustls"))] -#[cfg(feature = "rustls")] -impl From for ServerTlsConfig { - fn from(value: tokio_rustls::TlsAcceptor) -> Self { - Self { - acceptor: TlsAcceptor::Rustls(value), +cfg_rustls! { + impl From for ServerTlsConfig { + fn from(value: tokio_rustls::TlsAcceptor) -> Self { + Self { + acceptor: TlsAcceptor::Rustls(value), + } } } } -#[doc(cfg(feature = "native-tls"))] -#[cfg(feature = "native-tls")] -impl From> for ServerTlsConfig { - fn from(value: std::sync::Arc) -> Self { - Self { - acceptor: TlsAcceptor::NativeTls(value), +cfg_native_tls! { + impl From> for ServerTlsConfig { + fn from(value: std::sync::Arc) -> Self { + Self { + acceptor: TlsAcceptor::NativeTls(value), + } } } -} - -#[doc(cfg(feature = "native-tls"))] -#[cfg(feature = "native-tls")] -impl From for ServerTlsConfig { - fn from(value: tokio_native_tls::TlsAcceptor) -> Self { - Self { - acceptor: TlsAcceptor::NativeTls(std::sync::Arc::new(value)), + + impl From for ServerTlsConfig { + fn from(value: tokio_native_tls::TlsAcceptor) -> Self { + Self { + acceptor: TlsAcceptor::NativeTls(std::sync::Arc::new(value)), + } } } } + From 593f0c28beffd6045c468899159794a79649f1e2 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 23:38:13 -0700 Subject: [PATCH 16/30] made client tls config fields public --- volo/src/net/dial.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index e6f36b0d..dcf1bfea 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -156,8 +156,8 @@ cfg_rustls_or_native_tls! { /// TLS config for client #[derive(Clone)] pub struct ClientTlsConfig { - domain: String, - connector: TlsConnector, + pub domain: String, + pub connector: TlsConnector, } #[derive(Clone)] From 177a54405d54f35498b834a5d96a733d64934b78 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Tue, 24 Oct 2023 23:47:54 -0700 Subject: [PATCH 17/30] added constructors --- volo/src/net/dial.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index dcf1bfea..f02c4cfa 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -159,6 +159,15 @@ cfg_rustls_or_native_tls! { pub domain: String, pub connector: TlsConnector, } + + impl ClientTlsConfig { + pub fn new(domain: impl Into, connector: impl Into) -> Self { + Self { + domain: domain.into(), + connector: connector.into(), + } + } + } #[derive(Clone)] pub struct DefaultTlsMakeTransport { @@ -232,3 +241,25 @@ cfg_rustls_or_native_tls! { } } } + +cfg_rustls! { + impl From for TlsConnector { + fn from(value: tokio_rustls::TlsConnector) -> Self { + Self::Rustls(value) + } + } +} + +cfg_native_tls! { + impl From> for TlsConnector { + fn from(value: std::sync::Arc) -> Self { + Self::NativeTls(value) + } + } + + impl From for TlsConnector { + fn from(value: tokio_native_tls::TlsConnector) -> Self { + Self::NativeTls(std::sync::Arc::new(value)) + } + } +} \ No newline at end of file From f5f0b429577c2b6b69d0b964258d7f0582209ffa Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 02:28:30 -0700 Subject: [PATCH 18/30] added tls connector --- volo-grpc/src/client/mod.rs | 11 ++++ volo-grpc/src/transport/client.rs | 31 ++++++++++ volo-grpc/src/transport/connect.rs | 96 ++++++++++++++++++++---------- volo/src/net/dial.rs | 28 ++++++--- 4 files changed, 126 insertions(+), 40 deletions(-) diff --git a/volo-grpc/src/client/mod.rs b/volo-grpc/src/client/mod.rs index b1a0b870..f2268526 100644 --- a/volo-grpc/src/client/mod.rs +++ b/volo-grpc/src/client/mod.rs @@ -457,8 +457,19 @@ where { /// Builds a new [`Client`]. pub fn build(self) -> C::Target { + #[cfg(not(any(feature = "rustls", feature = "native-tls")))] let transport = MetaService::new(ClientTransport::new(&self.http2_config, &self.rpc_config)); + #[cfg(any(feature = "rustls", feature = "native-tls"))] + let transport = match self.tls_config { + Some(tls_config) => MetaService::new(ClientTransport::new_with_tls( + &self.http2_config, + &self.rpc_config, + tls_config, + )), + None => MetaService::new(ClientTransport::new(&self.http2_config, &self.rpc_config)), + }; + let transport = self.outer_layer.layer(BoxCloneService::new( self.mk_lb.make().layer(self.inner_layer.layer(transport)), )); diff --git a/volo-grpc/src/transport/client.rs b/volo-grpc/src/transport/client.rs index 089ae4d9..9b3e1ee0 100644 --- a/volo-grpc/src/transport/client.rs +++ b/volo-grpc/src/transport/client.rs @@ -65,6 +65,37 @@ impl ClientTransport { _marker: PhantomData, } } + + #[cfg(any(feature = "rustls", feature = "native-tls"))] + pub fn new_with_tls( + http2_config: &Http2Config, + rpc_config: &Config, + tls_config: volo::net::dial::ClientTlsConfig, + ) -> Self { + let config = volo::net::dial::Config::new( + rpc_config.connect_timeout, + rpc_config.read_timeout, + rpc_config.write_timeout, + ); + let http = HyperClient::builder() + .http2_only(!http2_config.accept_http1) + .http2_initial_stream_window_size(http2_config.init_stream_window_size) + .http2_initial_connection_window_size(http2_config.init_connection_window_size) + .http2_max_frame_size(http2_config.max_frame_size) + .http2_adaptive_window(http2_config.adaptive_window) + .http2_keep_alive_interval(http2_config.http2_keepalive_interval) + .http2_keep_alive_timeout(http2_config.http2_keepalive_timeout) + .http2_keep_alive_while_idle(http2_config.http2_keepalive_while_idle) + .http2_max_concurrent_reset_streams(http2_config.max_concurrent_reset_streams) + .http2_max_send_buf_size(http2_config.max_send_buf_size) + .retry_canceled_requests(http2_config.retry_canceled_requests) + .build(Connector::new_with_tls(Some(config), tls_config)); + + ClientTransport { + http_client: http, + _marker: PhantomData, + } + } } impl Service> for ClientTransport diff --git a/volo-grpc/src/transport/connect.rs b/volo-grpc/src/transport/connect.rs index 649ec505..467d4551 100644 --- a/volo-grpc/src/transport/connect.rs +++ b/volo-grpc/src/transport/connect.rs @@ -12,12 +12,16 @@ use hyper::client::connect::{Connected, Connection}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use volo::net::{ conn::Conn, - dial::{Config, DefaultMakeTransport, MakeTransport}, + dial::{Config, DefaultMakeTransport, MakeTransport, TlsMakeTransport, ClientTlsConfig}, Address, }; #[derive(Clone, Debug)] -pub struct Connector(DefaultMakeTransport); +pub enum Connector { + Default(DefaultMakeTransport), + #[cfg(any(feature = "rustls", feature = "native-tls"))] + Tls(TlsMakeTransport), +} impl Connector { pub fn new(cfg: Option) -> Self { @@ -27,7 +31,18 @@ impl Connector { mt.set_read_timeout(cfg.read_timeout); mt.set_write_timeout(cfg.write_timeout); } - Self(mt) + Self::Default(mt) + } + + #[cfg(any(feature = "rustls", feature = "native-tls"))] + pub fn new_with_tls(cfg: Option, tls_config: ClientTlsConfig) -> Self { + let mut mt = TlsMakeTransport::new(cfg.unwrap_or_default(), tls_config); + if let Some(cfg) = cfg { + mt.set_connect_timeout(cfg.connect_timeout); + mt.set_read_timeout(cfg.read_timeout); + mt.set_write_timeout(cfg.write_timeout); + } + Self::Tls(mt) } } @@ -49,40 +64,55 @@ impl tower::Service for Connector { } fn call(&mut self, uri: hyper::Uri) -> Self::Future { - let mk_conn = self.0; - Box::pin(async move { - let authority = uri.authority().expect("authority required").as_str(); - let target: Address = match uri.scheme_str() { - Some("http") => Address::Ip(authority.parse::().map_err(|_| { - io::Error::new( - io::ErrorKind::InvalidInput, - "authority must be valid SocketAddr", - ) - })?), - #[cfg(target_family = "unix")] - Some("http+unix") => { - let bytes = Vec::from_hex(authority).map_err(|_| { - io::Error::new( - io::ErrorKind::InvalidInput, - "authority must be hex-encoded path", - ) - })?; - Address::Unix(Cow::Owned( - String::from_utf8(bytes) - .map_err(|_| { + macro_rules! box_pin_call { + ($mk_conn:ident) => { + Box::pin(async move { + let authority = uri.authority().expect("authority required").as_str(); + let target: Address = match uri.scheme_str() { + Some("http") => Address::Ip(authority.parse::().map_err(|_| { + io::Error::new( + io::ErrorKind::InvalidInput, + "authority must be valid SocketAddr", + ) + })?), + #[cfg(target_family = "unix")] + Some("http+unix") => { + let bytes = Vec::from_hex(authority).map_err(|_| { io::Error::new( io::ErrorKind::InvalidInput, - "authority must be valid UTF-8", + "authority must be hex-encoded path", ) - })? - .into(), - )) - } - _ => unimplemented!(), + })?; + Address::Unix(Cow::Owned( + String::from_utf8(bytes) + .map_err(|_| { + io::Error::new( + io::ErrorKind::InvalidInput, + "authority must be valid UTF-8", + ) + })? + .into(), + )) + } + _ => unimplemented!(), + }; + + Ok(ConnectionWrapper($mk_conn.make_connection(target).await?)) + }) }; - - Ok(ConnectionWrapper(mk_conn.make_connection(target).await?)) - }) + } + + match self { + Self::Default(mk_conn) => { + let mk_conn = mk_conn.clone(); + box_pin_call!(mk_conn) + }, + #[cfg(any(feature = "rustls", feature = "native-tls"))] + Self::Tls(mk_conn) => { + let mk_conn = mk_conn.clone(); + box_pin_call!(mk_conn) + }, + } } } diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index f02c4cfa..f0771681 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -139,6 +139,8 @@ impl DefaultMakeTransport { } } + + cfg_rustls_or_native_tls! { /// A wrapper around [`tokio_rustls::TlsConnector`] and [`tokio_native_tls::TlsConnector`]. #[derive(Clone)] @@ -153,8 +155,20 @@ cfg_rustls_or_native_tls! { NativeTls(std::sync::Arc), } + impl std::fmt::Debug for TlsConnector { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + #[cfg(feature = "rustls")] + Self::Rustls(_) => f.debug_tuple("Rustls").finish(), + + #[cfg(feature = "native-tls")] + Self::NativeTls(_) => f.debug_tuple("NativeTls").finish(), + } + } + } + /// TLS config for client - #[derive(Clone)] + #[derive(Debug, Clone)] pub struct ClientTlsConfig { pub domain: String, pub connector: TlsConnector, @@ -169,16 +183,16 @@ cfg_rustls_or_native_tls! { } } - #[derive(Clone)] - pub struct DefaultTlsMakeTransport { + #[derive(Debug, Clone)] + pub struct TlsMakeTransport { cfg: Config, tls_config: ClientTlsConfig, } - impl DefaultTlsMakeTransport { - pub fn new(tls_config: ClientTlsConfig) -> Self { + impl TlsMakeTransport { + pub fn new(cfg: Config, tls_config: ClientTlsConfig) -> Self { Self { - cfg: Config::default(), + cfg, tls_config, } } @@ -217,7 +231,7 @@ cfg_rustls_or_native_tls! { } #[async_trait::async_trait] - impl MakeTransport for DefaultTlsMakeTransport { + impl MakeTransport for TlsMakeTransport { type ReadHalf = OwnedReadHalf; type WriteHalf = OwnedWriteHalf; From 9fb6683787ec3fbafca05e48bbbb6e7e3c4385f6 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 02:32:58 -0700 Subject: [PATCH 19/30] added example for tls --- examples/Cargo.toml | 22 +++++- examples/data/tls/ca.pem | 28 +++++++ examples/data/tls/server.key | 28 +++++++ examples/data/tls/server.pem | 27 +++++++ .../src/hello_grpc_tls/grpc_tls_client.rs | 52 +++++++++++++ .../src/hello_grpc_tls/grpc_tls_server.rs | 73 +++++++++++++++++++ 6 files changed, 228 insertions(+), 2 deletions(-) create mode 100644 examples/data/tls/ca.pem create mode 100644 examples/data/tls/server.key create mode 100644 examples/data/tls/server.pem create mode 100644 examples/src/hello_grpc_tls/grpc_tls_client.rs create mode 100644 examples/src/hello_grpc_tls/grpc_tls_server.rs diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 96c07038..bf9da682 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -22,6 +22,16 @@ path = "src/hello/thrift_server.rs" name = "hello-thrift-client" path = "src/hello/thrift_client.rs" +# hello tls +[[bin]] +name = "hello-tls-grpc-server" +path = "src/hello_grpc_tls/grpc_tls_server.rs" +required-features = ["tls"] +[[bin]] +name = "hello-tls-grpc-client" +path = "src/hello_grpc_tls/grpc_tls_client.rs" +required-features = ["tls"] + # compression [[bin]] name = "compresion-grpc-server" @@ -75,8 +85,16 @@ tracing.workspace = true tracing-subscriber.workspace = true pilota.workspace = true -volo = { path = "../volo" } -volo-grpc = { path = "../volo-grpc" } +volo = { path = "../volo", features = ["rustls"] } # feature "rustls" is only needed for the tls example +volo-grpc = { path = "../volo-grpc", features = ["rustls"] } # feature "rustls" is only needed for the tls example volo-thrift = { path = "../volo-thrift" } volo-gen = { path = "./volo-gen" } + +# TLS dependencies +rustls = { version = "0.21", optional = true} +rustls-pemfile = { version = "1", optional = true } +tokio-rustls = { version = "0.24", optional = true } + +[features] +tls = ["rustls", "rustls-pemfile", "tokio-rustls"] \ No newline at end of file diff --git a/examples/data/tls/ca.pem b/examples/data/tls/ca.pem new file mode 100644 index 00000000..d8195609 --- /dev/null +++ b/examples/data/tls/ca.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE3DCCA0SgAwIBAgIRAObeYbJFiVQSGR8yk44dsOYwDQYJKoZIhvcNAQELBQAw +gYUxHjAcBgNVBAoTFW1rY2VydCBkZXZlbG9wbWVudCBDQTEtMCsGA1UECwwkbHVj +aW9ATHVjaW9zLVdvcmstTUJQIChMdWNpbyBGcmFuY28pMTQwMgYDVQQDDCtta2Nl +cnQgbHVjaW9ATHVjaW9zLVdvcmstTUJQIChMdWNpbyBGcmFuY28pMB4XDTE5MDky +OTIzMzUzM1oXDTI5MDkyOTIzMzUzM1owgYUxHjAcBgNVBAoTFW1rY2VydCBkZXZl +bG9wbWVudCBDQTEtMCsGA1UECwwkbHVjaW9ATHVjaW9zLVdvcmstTUJQIChMdWNp +byBGcmFuY28pMTQwMgYDVQQDDCtta2NlcnQgbHVjaW9ATHVjaW9zLVdvcmstTUJQ +IChMdWNpbyBGcmFuY28pMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA +y/vE61ItbN/1qMYt13LMf+le1svwfkCCOPsygk7nWeRXmomgUpymqn1LnWiuB0+e +4IdVH2f5E9DknWEpPhKIDMRTCbz4jTwQfHrxCb8EGj3I8oO73pJO5S/xCedM9OrZ +qWcYWwN0GQ8cO/ogazaoZf1uTrRNHyzRyQsKyb412kDBTNEeldJZ2ljKgXXvh4HO +2ZIk9K/ZAaAf6VN8K/89rlJ9/KPgRVNsyAapE+Pb8XXKtpzeFiEcUfuXVYWtkoW+ +xyn/Zu8A1L2CXMQ1sARh7P/42BTMKr5pfraYgcBGxKXLrxoySpxCO9KqeVveKy1q +fPm5FCwFsXDr0koFLrCiR58mcIO/04Q9DKKTV4Z2a+LoqDJRY37KfBSc8sDMPhw5 +k7g3WPoa6QwXRjZTCA5fHWVgLOtcwLsnju5tBE4LDxwF6s+1wPF8NI5yUfufcEjJ +Z6JBwgoWYosVj27Lx7KBNLU/57PX9ryee691zmtswt0tP0WVBAgalhYWg99RXoa3 +AgMBAAGjRTBDMA4GA1UdDwEB/wQEAwICBDASBgNVHRMBAf8ECDAGAQH/AgEAMB0G +A1UdDgQWBBQdvlE4Bdcsjc9oaxjDCRu5FiuZkzANBgkqhkiG9w0BAQsFAAOCAYEA +BP/6o1kPINksMJZSSXgNCPZskDLyGw7auUZBnQ0ocDT3W6gXQvT/27LM1Hxoj9Eh +qU1TYdEt7ppecLQSGvzQ02MExG7H75art75oLiB+A5agDira937YbK4MCjqW481d +bDhw6ixJnY1jIvwjEZxyH6g94YyL927aSPch51fys0kSnjkFzC2RmuzDADScc4XH +5P1+/3dnIm3M5yfpeUzoaOrTXNmhn8p0RDIGrZ5kA5eISIGGD3Mm8FDssUNKndtO +g4ojHUsxb14icnAYGeye1NOhGiqN6TEFcgr6MPd0XdFNZ5c0HUaBCfN6bc+JxDV5 +MKZVJdNeJsYYwilgJNHAyZgCi30JC20xeYVtTF7CEEsMrFDGJ70Kz7o/FnRiFsA1 +ZSwVVWhhkHG2VkT4vlo0O3fYeZpenYicvy+wZNTbGK83gzHWqxxNC1z3Etg5+HRJ +F9qeMWPyfA3IHYXygiMcviyLcyNGG/SJ0EhUpYBN/Gg7wI5yFkcsxUDPPzd23O0M +-----END CERTIFICATE----- diff --git a/examples/data/tls/server.key b/examples/data/tls/server.key new file mode 100644 index 00000000..80984ef9 --- /dev/null +++ b/examples/data/tls/server.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDyptbMyYWztgta +t1MXLMzIkaQdeeVbs1Y/qCpAdwZe/Y5ZpbzjGIjCxbB6vNRSnEbYKpytKHPzYfM7 +8d8K8bPvpnqXIiTXFT0JQlw1OHLC1fr4e598GJumAmpMYFrtqv0fbmUFTuQGbHxe +OH2vji0bvr3NKZubMfkEZP3X4sNXXoXIuW2LaS8OMGKoJaeCBvdbszEiSGj/v9Bj +pM0yLTH89NNMX1T+FtTKnuXag5g7pr6lzJj83+MzAGy4nOjseSuUimuiyG90/C5t +A5wC0Qh5RbDnkFYhC44Kxof/i6+jnfateIPNiIIwQV+2f6G/aK1hgjekT10m/eoR +YDTf+e5ZAgMBAAECggEACODt7yRYjhDVLYaTtb9f5t7dYG67Y7WWLFIc6arxQryI +XuNfm/ej2WyeXn9WTYeGWBaHERbv1zH4UnMxNBdP/C7dQXZwXqZaS2JwOUpNeK+X +tUvgtAu6dkKUXSMRcKzXAjVp4N3YHhwOGOx8PNY49FDwZPdmyDD16aFAYIvdle6/ +PSMrj38rB1sbQQdmRob2FjJBSDZ44nsr+/nilrcOFNfNnWv7tQIWYVXNcLfdK/WJ +ZCDFhA8lr/Yon6MEq6ApTj2ZYRRGXPd6UeASJkmTZEUIUbeDcje/MO8cHkREpuRH +wm3pCjR7OdO4vc+/d/QmEvu5ns6wbTauelYnL616YQKBgQD414gJtpCHauNEUlFB +v/R3DzPI5NGp9PAqovOD8nCbI49Mw61gP/ExTIPKiR5uUX/5EL04uspaNkuohXk+ +ys0G5At0NfV7W39lzhvALEaSfleybvYxppbBrc20/q8Gvi/i30NY+1LM3RdtMiEw +hKHjU0SnFhJq0InFg3AO/iCeTQKBgQD5obkbzpOidSsa55aNsUlO2qjiUY9leq9b +irAohIZ8YnuuixYvkOeSeSz1eIrA4tECeAFSgTZxYe1Iz+USru2Xg/0xNte11dJD +rBoH/yMn2gDvBK7xQ6uFMPTeYtKG0vfvpXZYSWZzGntyrHTwFk6UV+xdrt9MBdd1 +XdSn7bwOPQKBgC9VQAko8uDvUf+C8PXiv2uONrl13PPJJY3WpR9qFEVOREnDxszS +HNzVwxPZdTJiykbkCjoqPadfQJDzopZxGQLAifU29lTamKcSx3CMe3gOFDxaovXa +zD5XAxP0hfJwZsdu1G6uj5dsTrJ0oJ+L+wc0pZBqwGIU/L/XOo9/g1DZAoGAUebL +kuH98ik7EUK2VJq8EJERI9/ailLsQb6I+WIxtZGiPqwHhWencpkrNQZtj8dbB9JT +rLwUHrMgZOlAoRafgTyez4zMzS3wJJ/Mkp8U67hM4h7JPwMSvUpIrMYDiJSjIA9L +er/qSw1/Pypx22uWMHmAZWRAgvLPtAQrB0Wqk4kCgYEAr2H1PvfbwZwkSvlMt5o8 +WLnBbxcM3AKglLRbkShxxgiZYdEP71/uOtRMiL26du5XX8evItITN0DsvmXL/kcd +h29LK7LM5uLw7efz0Qxs03G6kEyIHVkacowHi5I5Ul1qI61SoV3yMB1TjIU+bXZt +0ZjC07totO0fqPOLQxonjQg= +-----END PRIVATE KEY----- diff --git a/examples/data/tls/server.pem b/examples/data/tls/server.pem new file mode 100644 index 00000000..4cc97bcf --- /dev/null +++ b/examples/data/tls/server.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEmDCCAwCgAwIBAgIQVEJFCgU/CZk9JEwTucWPpzANBgkqhkiG9w0BAQsFADCB +hTEeMBwGA1UEChMVbWtjZXJ0IGRldmVsb3BtZW50IENBMS0wKwYDVQQLDCRsdWNp +b0BMdWNpb3MtV29yay1NQlAgKEx1Y2lvIEZyYW5jbykxNDAyBgNVBAMMK21rY2Vy +dCBsdWNpb0BMdWNpb3MtV29yay1NQlAgKEx1Y2lvIEZyYW5jbykwHhcNMTkwNjAx +MDAwMDAwWhcNMjkwOTI5MjMzNTM0WjBYMScwJQYDVQQKEx5ta2NlcnQgZGV2ZWxv +cG1lbnQgY2VydGlmaWNhdGUxLTArBgNVBAsMJGx1Y2lvQEx1Y2lvcy1Xb3JrLU1C +UCAoTHVjaW8gRnJhbmNvKTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +APKm1szJhbO2C1q3UxcszMiRpB155VuzVj+oKkB3Bl79jlmlvOMYiMLFsHq81FKc +RtgqnK0oc/Nh8zvx3wrxs++mepciJNcVPQlCXDU4csLV+vh7n3wYm6YCakxgWu2q +/R9uZQVO5AZsfF44fa+OLRu+vc0pm5sx+QRk/dfiw1dehci5bYtpLw4wYqglp4IG +91uzMSJIaP+/0GOkzTItMfz000xfVP4W1Mqe5dqDmDumvqXMmPzf4zMAbLic6Ox5 +K5SKa6LIb3T8Lm0DnALRCHlFsOeQViELjgrGh/+Lr6Od9q14g82IgjBBX7Z/ob9o +rWGCN6RPXSb96hFgNN/57lkCAwEAAaOBrzCBrDAOBgNVHQ8BAf8EBAMCBaAwEwYD +VR0lBAwwCgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBQdvlE4 +Bdcsjc9oaxjDCRu5FiuZkzBWBgNVHREETzBNggtleGFtcGxlLmNvbYINKi5leGFt +cGxlLmNvbYIMZXhhbXBsZS50ZXN0gglsb2NhbGhvc3SHBH8AAAGHEAAAAAAAAAAA +AAAAAAAAAAEwDQYJKoZIhvcNAQELBQADggGBAKb2TJ8l+e1eraNwZWizLw5fccAf +y59J1JAWdLxZyAI/bkiTlVO3DQoPZpw7XwLhefCvILkwKAL4TtIGGVC9yTb5Q5eg +rqGO3FC0yg1fn65Kf1VpVxxUVyoiM5PQ4pFJb4AicAv88rCOLD9FFuE0PKOKU/dm +Tw0WgPStoh9wsJ1RXUuTJYZs1nd1kMBlfv9NbLilnL+cR2sLktS54X5XagsBYVlf +oapRb0JtABOoQhX3U8QMq8UF8yzceRHNTN9yfLOUrW26s9nKtlWVniNhw1uPxZw9 +RHM7w9/4+a9LXtEDYg4IP/1mm0ywBoUqy1O6hA73uId+Yi/kFBks/GyYaGjKgYcO +23B75tkPGYEdGuGZYLzZNHbXg4V0UxFQG3KA1pUiSnD3bN2Rxs+CMpzORnOeK3xi +EooKgAPYsehItoQOMPpccI2xHdSAMWtwUgOKrefUQujkx2Op+KFlspF0+WJ6AZEe +2D4hyWaEZsvvILXapwqHDCuN3/jSUlTIqUoE1w== +-----END CERTIFICATE----- diff --git a/examples/src/hello_grpc_tls/grpc_tls_client.rs b/examples/src/hello_grpc_tls/grpc_tls_client.rs new file mode 100644 index 00000000..3e2fa610 --- /dev/null +++ b/examples/src/hello_grpc_tls/grpc_tls_client.rs @@ -0,0 +1,52 @@ +//! Run with `cargo run --example hello-tls-grpc-client --features tls` + +#![feature(impl_trait_in_assoc_type)] + +use std::{net::SocketAddr, path::Path, sync::Arc}; + +use pilota::FastStr; +use rustls::{Certificate, RootCertStore}; +use rustls_pemfile::certs; +use volo::net::dial::ClientTlsConfig; + +fn load_certs(path: impl AsRef) -> std::io::Result> { + certs(&mut std::io::BufReader::new(std::fs::File::open(path)?)) + .map(|v| v.into_iter().map(Certificate).collect()) + .map_err(|_| std::io::Error::new(std::io::ErrorKind::InvalidInput, "invalid cert").into()) +} + +#[volo::main] +async fn main() { + // The key and certificate are copied from + // https://github.com/hyperium/tonic/tree/master/examples/data/tls + let data_dir = std::path::PathBuf::from_iter([std::env!("CARGO_MANIFEST_DIR"), "data"]); + let root_cert = load_certs(data_dir.join("tls/ca.pem")).unwrap(); + let mut root_certs = RootCertStore::empty(); + root_certs.add(&root_cert[0]).unwrap(); + + let client_config = rustls::ClientConfig::builder() + .with_safe_default_cipher_suites() + .with_safe_default_kx_groups() + .with_safe_default_protocol_versions() + .unwrap() + .with_root_certificates(root_certs) + .with_no_client_auth(); + let client_config = Arc::new(client_config); + let connector = tokio_rustls::TlsConnector::from(client_config); + let tls_config = ClientTlsConfig::new("example.com", connector); + + let addr: SocketAddr = "127.0.0.1:8080".parse().unwrap(); + let client = volo_gen::proto_gen::hello::GreeterClientBuilder::new("hello") + .tls_config(tls_config) + .address(addr) + .build(); + + let req = volo_gen::proto_gen::hello::HelloRequest { + name: FastStr::from_static_str("Volo"), + }; + let resp = client.say_hello(req).await; + match resp { + Ok(info) => println!("{info:?}"), + Err(e) => eprintln!("{e:?}"), + } +} diff --git a/examples/src/hello_grpc_tls/grpc_tls_server.rs b/examples/src/hello_grpc_tls/grpc_tls_server.rs new file mode 100644 index 00000000..b7b27512 --- /dev/null +++ b/examples/src/hello_grpc_tls/grpc_tls_server.rs @@ -0,0 +1,73 @@ +//! Run with `cargo run --example hello-tls-grpc-server --features tls` + +#![feature(impl_trait_in_assoc_type)] + +use std::{net::SocketAddr, path::Path, sync::Arc}; + +use rustls::{Certificate, PrivateKey}; +use rustls_pemfile::{certs, pkcs8_private_keys}; +use volo_grpc::{ + server::{Server, ServiceBuilder}, + transport::ServerTlsConfig, +}; + +pub struct S; + +#[volo::async_trait] +impl volo_gen::proto_gen::hello::Greeter for S { + async fn say_hello( + &self, + req: volo_grpc::Request, + ) -> Result, volo_grpc::Status> + { + let resp = volo_gen::proto_gen::hello::HelloReply { + message: format!("Hello, {}!", req.get_ref().name).into(), + }; + Ok(volo_grpc::Response::new(resp)) + } +} + +fn load_certs(path: impl AsRef) -> std::io::Result> { + certs(&mut std::io::BufReader::new(std::fs::File::open(path)?)) + .map(|v| v.into_iter().map(Certificate).collect()) + .map_err(|_| std::io::Error::new(std::io::ErrorKind::InvalidInput, "invalid cert").into()) +} + +fn load_keys(path: impl AsRef) -> std::io::Result> { + pkcs8_private_keys(&mut std::io::BufReader::new(std::fs::File::open(path)?)) + .map(|v| v.into_iter().map(PrivateKey).collect()) + .map_err(|_| std::io::Error::new(std::io::ErrorKind::InvalidInput, "invalid key").into()) +} + +#[volo::main] +async fn main() { + // TLS configuration + // + // The key and certificate are copied from + // https://github.com/hyperium/tonic/tree/master/examples/data/tls + let data_dir = std::path::PathBuf::from_iter([std::env!("CARGO_MANIFEST_DIR"), "data"]); + let certs = load_certs(data_dir.join("tls/server.pem")).unwrap(); + let private_key = load_keys(data_dir.join("tls/server.key")).unwrap()[0].clone(); + + let mut server_config = rustls::ServerConfig::builder() + .with_safe_defaults() + .with_no_client_auth() + .with_single_cert(certs, private_key) + .expect("bad certificate/key"); + server_config.alpn_protocols = vec![b"h2".to_vec()]; + + let server_config = Arc::new(server_config); + let acceptor = tokio_rustls::TlsAcceptor::from(server_config); + let tls_config = ServerTlsConfig::from(acceptor); + + // Server address + let addr: SocketAddr = "[::]:8080".parse().unwrap(); + let addr = volo::net::Address::from(addr); + + Server::new() + .tls_config(tls_config) + .add_service(ServiceBuilder::new(volo_gen::proto_gen::hello::GreeterServer::new(S)).build()) + .run(addr) + .await + .unwrap(); +} From 0d46a611c4b538b28af3541bfc9ca3f73d1198c7 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 02:50:06 -0700 Subject: [PATCH 20/30] moved dep features behind tls feature --- examples/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index bf9da682..03af2a41 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -85,8 +85,8 @@ tracing.workspace = true tracing-subscriber.workspace = true pilota.workspace = true -volo = { path = "../volo", features = ["rustls"] } # feature "rustls" is only needed for the tls example -volo-grpc = { path = "../volo-grpc", features = ["rustls"] } # feature "rustls" is only needed for the tls example +volo = { path = "../volo" } +volo-grpc = { path = "../volo-grpc" } volo-thrift = { path = "../volo-thrift" } volo-gen = { path = "./volo-gen" } @@ -97,4 +97,4 @@ rustls-pemfile = { version = "1", optional = true } tokio-rustls = { version = "0.24", optional = true } [features] -tls = ["rustls", "rustls-pemfile", "tokio-rustls"] \ No newline at end of file +tls = ["rustls", "rustls-pemfile", "tokio-rustls", "volo/rustls", "volo-grpc/rustls"] \ No newline at end of file From ac24721170b464eeac0c2761ddec697326fd5cf0 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 21:07:06 -0700 Subject: [PATCH 21/30] removed attr impl_trait_in_assoc_type --- examples/src/hello_grpc_tls/grpc_tls_client.rs | 2 -- examples/src/hello_grpc_tls/grpc_tls_server.rs | 2 -- volo-grpc/src/lib.rs | 1 - 3 files changed, 5 deletions(-) diff --git a/examples/src/hello_grpc_tls/grpc_tls_client.rs b/examples/src/hello_grpc_tls/grpc_tls_client.rs index 3e2fa610..67563df1 100644 --- a/examples/src/hello_grpc_tls/grpc_tls_client.rs +++ b/examples/src/hello_grpc_tls/grpc_tls_client.rs @@ -1,7 +1,5 @@ //! Run with `cargo run --example hello-tls-grpc-client --features tls` -#![feature(impl_trait_in_assoc_type)] - use std::{net::SocketAddr, path::Path, sync::Arc}; use pilota::FastStr; diff --git a/examples/src/hello_grpc_tls/grpc_tls_server.rs b/examples/src/hello_grpc_tls/grpc_tls_server.rs index b7b27512..1edab3cc 100644 --- a/examples/src/hello_grpc_tls/grpc_tls_server.rs +++ b/examples/src/hello_grpc_tls/grpc_tls_server.rs @@ -1,7 +1,5 @@ //! Run with `cargo run --example hello-tls-grpc-server --features tls` -#![feature(impl_trait_in_assoc_type)] - use std::{net::SocketAddr, path::Path, sync::Arc}; use rustls::{Certificate, PrivateKey}; diff --git a/volo-grpc/src/lib.rs b/volo-grpc/src/lib.rs index 8b20d6b3..5f37beb1 100644 --- a/volo-grpc/src/lib.rs +++ b/volo-grpc/src/lib.rs @@ -2,7 +2,6 @@ html_logo_url = "https://github.com/cloudwego/volo/raw/main/.github/assets/logo.png?sanitize=true" )] #![cfg_attr(not(doctest), doc = include_str!("../README.md"))] -#![feature(impl_trait_in_assoc_type)] #![feature(doc_cfg)] #[macro_use] From fc99d2eb1ba5800be9cce580946ff735f6788ddd Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 21:16:55 -0700 Subject: [PATCH 22/30] moved deps to workspace --- Cargo.toml | 8 +++++++- examples/Cargo.toml | 6 +++--- volo-grpc/Cargo.toml | 5 ++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e29ebfe9..cd65bd3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ pilota-thrift-parser = "0.9" #pilota-thrift-parser = { git = "https://github.com/cloudwego/pilota", branch = "main" } motore = "0.4" -#motore = { git = "https://github.com/cloudwego/motore", branch = "main" } +# motore = { git = "https://github.com/cloudwego/motore", branch = "main" } metainfo = "0.7" @@ -100,6 +100,12 @@ update-informer = "1" url_path = "0.1" walkdir = "2" +# Optional dependencies +rustls = "0.21" +rustls-pemfile = "1" +tokio-rustls = "0.24" +tokio-native-tls = "0.3" + [profile.release] opt-level = 3 debug = false diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 45a4afb4..8a9a6f6a 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -91,9 +91,9 @@ volo-thrift = { path = "../volo-thrift" } volo-gen = { path = "./volo-gen" } # TLS dependencies -rustls = { version = "0.21", optional = true} -rustls-pemfile = { version = "1", optional = true } -tokio-rustls = { version = "0.24", optional = true } +rustls = { workspace = true, optional = true} +rustls-pemfile = { workspace = true, optional = true } +tokio-rustls = { workspace = true, optional = true } [features] tls = ["rustls", "rustls-pemfile", "tokio-rustls", "volo/rustls", "volo-grpc/rustls"] \ No newline at end of file diff --git a/volo-grpc/Cargo.toml b/volo-grpc/Cargo.toml index 7b5bc6ca..35ef41e5 100644 --- a/volo-grpc/Cargo.toml +++ b/volo-grpc/Cargo.toml @@ -53,9 +53,8 @@ tower = { workspace = true, features = [ ] } tracing.workspace = true -# Optional dependencies -tokio-rustls = { version = "0.24", optional = true } -tokio-native-tls = { version = "0.3", optional = true } +tokio-rustls = { workspace = true, optional = true } +tokio-native-tls = { workspace = true, optional = true } [dev-dependencies] tracing-subscriber.workspace = true From e1c2a5fe83ad02decb95409a6df4c45ec858d6a3 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 21:30:55 -0700 Subject: [PATCH 23/30] feature gate mod tls and re-export --- volo-grpc/src/transport/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/volo-grpc/src/transport/mod.rs b/volo-grpc/src/transport/mod.rs index 2810b975..d0bd126d 100644 --- a/volo-grpc/src/transport/mod.rs +++ b/volo-grpc/src/transport/mod.rs @@ -2,7 +2,10 @@ mod client; mod connect; -mod tls; + +cfg_rustls_or_native_tls! { + mod tls; + pub use tls::{ServerTlsConfig, TlsAcceptor}; +} pub use client::ClientTransport; -pub use tls::{ServerTlsConfig, TlsAcceptor}; From 0fb72d0c7b0ce106744bd345ce5e02d6b7622b6e Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 21:34:36 -0700 Subject: [PATCH 24/30] move dep to workspace --- Cargo.toml | 2 +- examples/Cargo.toml | 4 ++-- examples/src/hello_grpc_tls/grpc_tls_client.rs | 2 +- examples/src/hello_grpc_tls/grpc_tls_server.rs | 2 +- volo/Cargo.toml | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cd65bd3f..061b25fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,7 +101,7 @@ url_path = "0.1" walkdir = "2" # Optional dependencies -rustls = "0.21" +librustls = { package = "rustls", version = "0.21" } rustls-pemfile = "1" tokio-rustls = "0.24" tokio-native-tls = "0.3" diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 8a9a6f6a..6195c2fd 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -91,9 +91,9 @@ volo-thrift = { path = "../volo-thrift" } volo-gen = { path = "./volo-gen" } # TLS dependencies -rustls = { workspace = true, optional = true} +librustls = { workspace = true, optional = true} rustls-pemfile = { workspace = true, optional = true } tokio-rustls = { workspace = true, optional = true } [features] -tls = ["rustls", "rustls-pemfile", "tokio-rustls", "volo/rustls", "volo-grpc/rustls"] \ No newline at end of file +tls = ["librustls", "rustls-pemfile", "tokio-rustls", "volo/rustls", "volo-grpc/rustls"] \ No newline at end of file diff --git a/examples/src/hello_grpc_tls/grpc_tls_client.rs b/examples/src/hello_grpc_tls/grpc_tls_client.rs index 67563df1..24deb104 100644 --- a/examples/src/hello_grpc_tls/grpc_tls_client.rs +++ b/examples/src/hello_grpc_tls/grpc_tls_client.rs @@ -3,7 +3,7 @@ use std::{net::SocketAddr, path::Path, sync::Arc}; use pilota::FastStr; -use rustls::{Certificate, RootCertStore}; +use librustls::{Certificate, RootCertStore}; use rustls_pemfile::certs; use volo::net::dial::ClientTlsConfig; diff --git a/examples/src/hello_grpc_tls/grpc_tls_server.rs b/examples/src/hello_grpc_tls/grpc_tls_server.rs index 1edab3cc..54f2b421 100644 --- a/examples/src/hello_grpc_tls/grpc_tls_server.rs +++ b/examples/src/hello_grpc_tls/grpc_tls_server.rs @@ -2,7 +2,7 @@ use std::{net::SocketAddr, path::Path, sync::Arc}; -use rustls::{Certificate, PrivateKey}; +use librustls::{Certificate, PrivateKey}; use rustls_pemfile::{certs, pkcs8_private_keys}; use volo_grpc::{ server::{Server, ServiceBuilder}, diff --git a/volo/Cargo.toml b/volo/Cargo.toml index b7c77457..2170db48 100644 --- a/volo/Cargo.toml +++ b/volo/Cargo.toml @@ -48,9 +48,9 @@ tower.workspace = true tracing.workspace = true # Optional dependencies -librustls = { package = "rustls", version = "0.21", optional = true } -tokio-rustls = { version = "0.24", optional = true } -tokio-native-tls = { version = "0.3", optional = true } +librustls = { workspace = true, optional = true } +tokio-rustls = { workspace = true, optional = true } +tokio-native-tls = { workspace = true, optional = true } [features] default = [] From a5bb82a8f81d76d40823aa08be053a3e88f6b748 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 22:19:24 -0700 Subject: [PATCH 25/30] minor fix --- examples/src/hello_grpc_tls/grpc_tls_client.rs | 4 ++-- examples/src/hello_grpc_tls/grpc_tls_server.rs | 10 +++++----- volo-grpc/src/cfg.rs | 3 +++ volo-grpc/src/transport/connect.rs | 10 ++++++---- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/examples/src/hello_grpc_tls/grpc_tls_client.rs b/examples/src/hello_grpc_tls/grpc_tls_client.rs index 24deb104..f97d9ecb 100644 --- a/examples/src/hello_grpc_tls/grpc_tls_client.rs +++ b/examples/src/hello_grpc_tls/grpc_tls_client.rs @@ -2,8 +2,8 @@ use std::{net::SocketAddr, path::Path, sync::Arc}; +use librustls::{Certificate, ClientConfig, RootCertStore}; /* crate `rustls` is renamed to `librustls` in this example */ use pilota::FastStr; -use librustls::{Certificate, RootCertStore}; use rustls_pemfile::certs; use volo::net::dial::ClientTlsConfig; @@ -22,7 +22,7 @@ async fn main() { let mut root_certs = RootCertStore::empty(); root_certs.add(&root_cert[0]).unwrap(); - let client_config = rustls::ClientConfig::builder() + let client_config = ClientConfig::builder() .with_safe_default_cipher_suites() .with_safe_default_kx_groups() .with_safe_default_protocol_versions() diff --git a/examples/src/hello_grpc_tls/grpc_tls_server.rs b/examples/src/hello_grpc_tls/grpc_tls_server.rs index 54f2b421..ec55e600 100644 --- a/examples/src/hello_grpc_tls/grpc_tls_server.rs +++ b/examples/src/hello_grpc_tls/grpc_tls_server.rs @@ -2,7 +2,8 @@ use std::{net::SocketAddr, path::Path, sync::Arc}; -use librustls::{Certificate, PrivateKey}; +use librustls::{Certificate, PrivateKey, ServerConfig}; /* crate `rustls` is renamed to + * `librustls` in this example */ use rustls_pemfile::{certs, pkcs8_private_keys}; use volo_grpc::{ server::{Server, ServiceBuilder}, @@ -11,7 +12,6 @@ use volo_grpc::{ pub struct S; -#[volo::async_trait] impl volo_gen::proto_gen::hello::Greeter for S { async fn say_hello( &self, @@ -39,15 +39,15 @@ fn load_keys(path: impl AsRef) -> std::io::Result> { #[volo::main] async fn main() { - // TLS configuration - // + // TLS configuration + // // The key and certificate are copied from // https://github.com/hyperium/tonic/tree/master/examples/data/tls let data_dir = std::path::PathBuf::from_iter([std::env!("CARGO_MANIFEST_DIR"), "data"]); let certs = load_certs(data_dir.join("tls/server.pem")).unwrap(); let private_key = load_keys(data_dir.join("tls/server.key")).unwrap()[0].clone(); - let mut server_config = rustls::ServerConfig::builder() + let mut server_config = ServerConfig::builder() .with_safe_defaults() .with_no_client_auth() .with_single_cert(certs, private_key) diff --git a/volo-grpc/src/cfg.rs b/volo-grpc/src/cfg.rs index 971221cb..23d4d08c 100644 --- a/volo-grpc/src/cfg.rs +++ b/volo-grpc/src/cfg.rs @@ -1,3 +1,4 @@ +#[allow(unused_macros)] // Otherwise, it will complain if neither `rustls` nor `native-tls` is enabled. macro_rules! cfg_rustls { ($($item:item)*) => { $( @@ -8,6 +9,7 @@ macro_rules! cfg_rustls { } } +#[allow(unused_macros)] // Otherwise, it will complain if neither `rustls` nor `native-tls` is enabled. macro_rules! cfg_native_tls { ($($item:item)*) => { $( @@ -18,6 +20,7 @@ macro_rules! cfg_native_tls { } } +#[allow(unused_macros)] // Otherwise, it will complain if neither `rustls` nor `native-tls` is enabled. macro_rules! cfg_rustls_or_native_tls { ($($item:item)*) => { $( diff --git a/volo-grpc/src/transport/connect.rs b/volo-grpc/src/transport/connect.rs index 467d4551..35340c08 100644 --- a/volo-grpc/src/transport/connect.rs +++ b/volo-grpc/src/transport/connect.rs @@ -1,5 +1,4 @@ use std::{ - borrow::Cow, io, net::SocketAddr, pin::Pin, @@ -7,15 +6,18 @@ use std::{ }; use futures::future::BoxFuture; -use hex::FromHex; use hyper::client::connect::{Connected, Connection}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use volo::net::{ conn::Conn, - dial::{Config, DefaultMakeTransport, MakeTransport, TlsMakeTransport, ClientTlsConfig}, + dial::{Config, DefaultMakeTransport, MakeTransport}, Address, }; +cfg_rustls_or_native_tls! { + use volo::net::dial::{TlsMakeTransport, ClientTlsConfig}; +} + #[derive(Clone, Debug)] pub enum Connector { Default(DefaultMakeTransport), @@ -83,7 +85,7 @@ impl tower::Service for Connector { "authority must be hex-encoded path", ) })?; - Address::Unix(Cow::Owned( + Address::Unix(std::borrow::Cow::Owned( String::from_utf8(bytes) .map_err(|_| { io::Error::new( From 493570c2a7ce47ed77c92616a0b718834eb18b1c Mon Sep 17 00:00:00 2001 From: minghuaw Date: Wed, 25 Oct 2023 22:25:45 -0700 Subject: [PATCH 26/30] gate import behind feature gate --- volo-grpc/src/transport/connect.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/volo-grpc/src/transport/connect.rs b/volo-grpc/src/transport/connect.rs index 35340c08..73d4a3e6 100644 --- a/volo-grpc/src/transport/connect.rs +++ b/volo-grpc/src/transport/connect.rs @@ -79,6 +79,8 @@ impl tower::Service for Connector { })?), #[cfg(target_family = "unix")] Some("http+unix") => { + use hex::FromHex; + let bytes = Vec::from_hex(authority).map_err(|_| { io::Error::new( io::ErrorKind::InvalidInput, From b480388c0f67dab202cac7d65937bfc85b8b9566 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Thu, 26 Oct 2023 01:06:05 -0700 Subject: [PATCH 27/30] renamed domain to server_name --- volo/src/net/dial.rs | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index f25d49e1..f76dba60 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -1,4 +1,4 @@ -use std::{io, net::SocketAddr, future::Future}; +use std::{future::Future, io, net::SocketAddr}; use socket2::{Domain, Protocol, Socket, Type}; #[cfg(target_family = "unix")] @@ -140,8 +140,6 @@ impl DefaultMakeTransport { } } - - cfg_rustls_or_native_tls! { /// A wrapper around [`tokio_rustls::TlsConnector`] and [`tokio_native_tls::TlsConnector`]. #[derive(Clone)] @@ -149,7 +147,7 @@ cfg_rustls_or_native_tls! { #[doc(cfg(feature = "rustls"))] #[cfg(feature = "rustls")] Rustls(tokio_rustls::TlsConnector), - + /// This takes an `Arc` because `tokio_native_tls::TlsConnector` does not internally use `Arc` #[doc(cfg(feature = "native-tls"))] #[cfg(feature = "native-tls")] @@ -171,25 +169,25 @@ cfg_rustls_or_native_tls! { /// TLS config for client #[derive(Debug, Clone)] pub struct ClientTlsConfig { - pub domain: String, + pub server_name: String, pub connector: TlsConnector, } impl ClientTlsConfig { - pub fn new(domain: impl Into, connector: impl Into) -> Self { + pub fn new(server_name: impl Into, connector: impl Into) -> Self { Self { - domain: domain.into(), + server_name: server_name.into(), connector: connector.into(), } } } - + #[derive(Debug, Clone)] pub struct TlsMakeTransport { cfg: Config, tls_config: ClientTlsConfig, } - + impl TlsMakeTransport { pub fn new(cfg: Config, tls_config: ClientTlsConfig) -> Self { Self { @@ -197,19 +195,19 @@ cfg_rustls_or_native_tls! { tls_config, } } - + pub async fn make_connection(&self, addr: Address) -> Result { match addr { Address::Ip(addr) => { let tcp = make_tcp_connection(&self.cfg, addr).await?; - + match &self.tls_config.connector { #[cfg(feature = "rustls")] TlsConnector::Rustls(connector) => { - let domain = librustls::ServerName::try_from(&self.tls_config.domain[..]) + let server_name = librustls::ServerName::try_from(&self.tls_config.server_name[..]) .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; connector - .connect(domain, tcp) + .connect(server_name, tcp) .await .map(tokio_rustls::TlsStream::Client) .map(Conn::from) @@ -218,7 +216,7 @@ cfg_rustls_or_native_tls! { TlsConnector::NativeTls(connector) => { let tcp = make_tcp_connection(&self.cfg, addr).await?; connector - .connect(&self.tls_config.domain[..], tcp) + .connect(&self.tls_config.server_name[..], tcp) .await .map(Conn::from) .map_err(|e| io::Error::new(io::ErrorKind::Other, e)) @@ -230,26 +228,26 @@ cfg_rustls_or_native_tls! { } } } - + impl MakeTransport for TlsMakeTransport { type ReadHalf = OwnedReadHalf; - + type WriteHalf = OwnedWriteHalf; - + async fn make_transport(&self, addr: Address) -> io::Result<(Self::ReadHalf, Self::WriteHalf)> { let conn = self.make_connection(addr).await?; let (read, write) = conn.stream.into_split(); Ok((read, write)) } - + fn set_connect_timeout(&mut self, timeout: Option) { self.cfg = self.cfg.with_connect_timeout(timeout); } - + fn set_read_timeout(&mut self, timeout: Option) { self.cfg = self.cfg.with_read_timeout(timeout); } - + fn set_write_timeout(&mut self, timeout: Option) { self.cfg = self.cfg.with_write_timeout(timeout); } @@ -270,10 +268,10 @@ cfg_native_tls! { Self::NativeTls(value) } } - + impl From for TlsConnector { fn from(value: tokio_native_tls::TlsConnector) -> Self { Self::NativeTls(std::sync::Arc::new(value)) } } -} \ No newline at end of file +} From 6ff6205f045b06544629f73f8760ee1bdc325d71 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Thu, 26 Oct 2023 01:06:33 -0700 Subject: [PATCH 28/30] cargo fmt and hide import behind feature --- volo-grpc/src/cfg.rs | 2 +- volo-grpc/src/server/mod.rs | 10 ++-------- volo-grpc/src/transport/connect.rs | 22 ++++++++++++---------- volo/src/cfg.rs | 2 +- volo/src/net/mod.rs | 4 +++- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/volo-grpc/src/cfg.rs b/volo-grpc/src/cfg.rs index 23d4d08c..0a531153 100644 --- a/volo-grpc/src/cfg.rs +++ b/volo-grpc/src/cfg.rs @@ -29,4 +29,4 @@ macro_rules! cfg_rustls_or_native_tls { $item )* } -} \ No newline at end of file +} diff --git a/volo-grpc/src/server/mod.rs b/volo-grpc/src/server/mod.rs index 643553db..66fbed40 100644 --- a/volo-grpc/src/server/mod.rs +++ b/volo-grpc/src/server/mod.rs @@ -15,19 +15,13 @@ use motore::{ }; pub use service::ServiceBuilder; use volo::{ - net::{ - conn::Conn, - incoming::Incoming, - }, + net::{conn::Conn, incoming::Incoming}, spawn, }; pub use self::router::Router; use crate::{ - body::Body, - context::ServerContext, - server::meta::MetaService, - Request, Response, Status, + body::Body, context::ServerContext, server::meta::MetaService, Request, Response, Status, }; cfg_rustls_or_native_tls! { diff --git a/volo-grpc/src/transport/connect.rs b/volo-grpc/src/transport/connect.rs index 73d4a3e6..9427649d 100644 --- a/volo-grpc/src/transport/connect.rs +++ b/volo-grpc/src/transport/connect.rs @@ -71,12 +71,14 @@ impl tower::Service for Connector { Box::pin(async move { let authority = uri.authority().expect("authority required").as_str(); let target: Address = match uri.scheme_str() { - Some("http") => Address::Ip(authority.parse::().map_err(|_| { - io::Error::new( - io::ErrorKind::InvalidInput, - "authority must be valid SocketAddr", - ) - })?), + Some("http") => { + Address::Ip(authority.parse::().map_err(|_| { + io::Error::new( + io::ErrorKind::InvalidInput, + "authority must be valid SocketAddr", + ) + })?) + } #[cfg(target_family = "unix")] Some("http+unix") => { use hex::FromHex; @@ -100,22 +102,22 @@ impl tower::Service for Connector { } _ => unimplemented!(), }; - + Ok(ConnectionWrapper($mk_conn.make_connection(target).await?)) }) }; } - + match self { Self::Default(mk_conn) => { let mk_conn = mk_conn.clone(); box_pin_call!(mk_conn) - }, + } #[cfg(any(feature = "rustls", feature = "native-tls"))] Self::Tls(mk_conn) => { let mk_conn = mk_conn.clone(); box_pin_call!(mk_conn) - }, + } } } } diff --git a/volo/src/cfg.rs b/volo/src/cfg.rs index 971221cb..f1431853 100644 --- a/volo/src/cfg.rs +++ b/volo/src/cfg.rs @@ -26,4 +26,4 @@ macro_rules! cfg_rustls_or_native_tls { $item )* } -} \ No newline at end of file +} diff --git a/volo/src/net/mod.rs b/volo/src/net/mod.rs index aaebc0b4..8620e9e2 100644 --- a/volo/src/net/mod.rs +++ b/volo/src/net/mod.rs @@ -3,7 +3,9 @@ pub mod dial; pub mod incoming; mod probe; -use std::{borrow::Cow, fmt, net::Ipv6Addr, path::Path}; +#[cfg(target_family = "unix")] +use std::{borrow::Cow, path::Path}; +use std::{fmt, net::Ipv6Addr}; pub use incoming::{DefaultIncoming, MakeIncoming}; From 6b9c8d5d5da4df450726362e037dc4bce026c0bd Mon Sep 17 00:00:00 2001 From: minghuaw Date: Thu, 26 Oct 2023 01:07:55 -0700 Subject: [PATCH 29/30] remove Cargo.lock from gitignore --- .gitignore | 4 +- Cargo.lock | 3051 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3052 insertions(+), 3 deletions(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index 7738755a..16b13b83 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ .vscode .idea -/target - -**Cargo.lock \ No newline at end of file +/target \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..3a1091ea --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3051 @@ +# 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.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "async-broadcast" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "334d75cf09b33bede6cbc20e52515853ae7bee3d4eadd9540e13ce92af983d34" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "async-trait" +version = "0.1.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[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.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[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 = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "windows-targets", +] + +[[package]] +name = "clap" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", + "terminal_size", +] + +[[package]] +name = "clap_derive" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "colored" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +dependencies = [ + "is-terminal", + "lazy_static", + "windows-sys", +] + +[[package]] +name = "concurrent-queue" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +dependencies = [ + "crossbeam-utils", +] + +[[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 = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[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 = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.2", + "lock_api", + "once_cell", + "parking_lot_core 0.9.9", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys", +] + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "event-listener" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29e56284f00d94c1bc7fd3c77027b4623c88c1f53d8d2394c6199f2921dea325" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c97b4e30ea7e4b7e7b429d6e2d8510433ba8cee4e70dfb3243794e539d29fd" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "examples" +version = "0.0.0" +dependencies = [ + "anyhow", + "async-stream", + "lazy_static", + "metainfo", + "pilota", + "rustls", + "rustls-pemfile", + "tokio", + "tokio-rustls", + "tokio-stream", + "tracing", + "tracing-subscriber", + "volo", + "volo-gen", + "volo-grpc", + "volo-thrift", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "faststr" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284eac9300ad17d2492e1e87219768b8ab97fb2c74a61cdbc0ced31d3f711159" +dependencies = [ + "bytes", + "serde", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[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 = "fsio" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0" +dependencies = [ + "dunce", + "rand", +] + +[[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-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[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-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 = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[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 = "h2" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +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 = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[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", + "socket2 0.4.10", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[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 = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown 0.14.2", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "integer-encoding" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924df4f0e24e2e7f9cdd90babb0b96f93b20f3ecfa949ea9e6613756b8c8e1bf" +dependencies = [ + "async-trait", + "tokio", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi", + "rustix", + "windows-sys", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[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 = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linkedbytes" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20a196eed38906d45351c7ed2cced83bb31e48637449d30ef397f6d35c09190d" +dependencies = [ + "bytes", + "faststr", + "tokio", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[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 = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "metainfo" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e688d0297eb1f8bb438cc9145f24d8dd1d1fce1bb02857ec140f6d7bb9bf404a" +dependencies = [ + "faststr", + "fxhash", + "paste", + "tokio", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "motore" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e790641256fb4f7acb5d99ddbe60ccf7d64bc5e0bd3c042d3dc0376b67405a9" +dependencies = [ + "futures", + "motore-macros", + "pin-project", + "tokio", + "tower", +] + +[[package]] +name = "motore-macros" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3adf53252648efda75998b7198317fab6859ea726eded77a07ddd2940d5d2f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "mur3" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97af489e1e21b68de4c390ecca6703318bc1aa16e9733bcb62c089b73c6fbb1b" + +[[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.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "libc", + "memoffset", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normpath" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" +dependencies = [ + "windows-sys", +] + +[[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-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + +[[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 = "num_enum" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70bf6736f74634d299d00086f02986875b3c2d924781a6a2cb6c201e73da0ceb" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ea360eafe1022f7cc56cd7b869ed57330fb2453d0c7831d99b74c65d2f5597" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "openssl" +version = "0.10.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +dependencies = [ + "bitflags 2.4.1", + "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.38", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[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 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.9", +] + +[[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 = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.4.1", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.0.2", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pilota" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "682b3db6679a97ec07efc81fe5b5d0ad090cf698c9728f6b0969ca66515b9c28" +dependencies = [ + "anyhow", + "async-recursion", + "bytes", + "derivative", + "faststr", + "integer-encoding", + "lazy_static", + "linkedbytes", + "paste", + "proptest", + "serde", + "smallvec", + "thiserror", + "tokio", +] + +[[package]] +name = "pilota-build" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db92e95e898bc2793893d613b15afd72d6db9fa08874a15a439ae1e7d4f73d51" +dependencies = [ + "anyhow", + "dashmap", + "faststr", + "fxhash", + "heck 0.4.1", + "itertools", + "lazy_static", + "normpath", + "paste", + "petgraph", + "phf", + "pilota-thrift-parser", + "proc-macro2", + "protobuf-parse2", + "protobuf2", + "quote", + "rayon", + "salsa", + "scoped-tls", + "serde", + "serde_yaml", + "syn 2.0.38", + "toml", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "pilota-thrift-parser" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4781d3302b216e3285cfc2411add31d2e1c11c0c55f4616423433da3623c978b" +dependencies = [ + "nom", +] + +[[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.38", +] + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "pretty_env_logger" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.4.1", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.7.5", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "protobuf-parse2" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5df535ab890834ebe9cc42b680bf38d8fed1345fb576f60e48b42bb93aadcb" +dependencies = [ + "anyhow", + "indexmap 1.9.3", + "log", + "protobuf-support2", + "protobuf2", + "tempfile", + "thiserror", + "which", +] + +[[package]] +name = "protobuf-support2" +version = "4.0.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6e937299e45024fae149d242cee9719048e4890dbc28c0d1838ed0aba8c3ec" +dependencies = [ + "thiserror", +] + +[[package]] +name = "protobuf2" +version = "4.0.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc090e26a62f7d66cfc6cd8715ab0973f57287293488a8d05e68fd4d5bb4ad05" +dependencies = [ + "once_cell", + "protobuf-support2", + "thiserror", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[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 = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[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 = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", +] + +[[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.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[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 = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +dependencies = [ + "base64 0.21.5", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys", +] + +[[package]] +name = "run_script" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829f98fdc58d78989dd9af83be28bc15c94a7d77f9ecdb54abbbc0b1829ba9c7" +dependencies = [ + "fsio", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustls" +version = "0.21.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +dependencies = [ + "log", + "ring", + "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 0.21.5", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "salsa" +version = "0.17.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b223dccb46c32753144d0b51290da7230bb4aedcd8379d6b4c9a474c18bf17a" +dependencies = [ + "crossbeam-utils", + "indexmap 1.9.3", + "lock_api", + "log", + "oorandom", + "parking_lot 0.11.2", + "rustc-hash", + "salsa-macros", + "smallvec", +] + +[[package]] +name = "salsa-macros" +version = "0.17.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac6c2e352df550bf019da7b16164ed2f7fa107c39653d1311d1bba42d1582ff7" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[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.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[package]] +name = "serde" +version = "1.0.190" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.190" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94bf752b3784a50c603c3ec452c6be3bfe01312ce0a60c87a6ed25d68da2cb6" +dependencies = [ + "indexmap 2.0.2", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[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 = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[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.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys", +] + +[[package]] +name = "termcolor" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[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.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot 0.12.1", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.5", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef75d881185fd2df4a040793927c153d863651108a93c7e17a9e591baa95cc6" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.20.4", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.0.2", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380f9e8120405471f7c9ad1860a713ef5ece6a670c7eae39225e477340f32fc4" +dependencies = [ + "indexmap 2.0.2", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[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.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "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 = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "update-informer" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f8811797a24ff123db3c6e1087aa42551d03d772b3724be421ad063da1f5f3f" +dependencies = [ + "directories", + "reqwest", + "semver", + "serde", + "serde_json", + "ureq", +] + +[[package]] +name = "ureq" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3" +dependencies = [ + "base64 0.21.5", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-webpki", + "serde", + "serde_json", + "url", + "webpki-roots", +] + +[[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 = "url_path" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10477a8879b7fc3bb4fb54fa6adcfd6191de561b13d5413fec9cc0239fd1c882" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "volo" +version = "0.8.0" +dependencies = [ + "async-broadcast", + "dashmap", + "faststr", + "futures", + "lazy_static", + "libc", + "metainfo", + "motore", + "mur3", + "nix", + "once_cell", + "pin-project", + "rand", + "rustls", + "socket2 0.5.5", + "thiserror", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tokio-stream", + "tower", + "tracing", +] + +[[package]] +name = "volo-build" +version = "0.8.1" +dependencies = [ + "anyhow", + "dirs", + "heck 0.4.1", + "itertools", + "lazy_static", + "nom", + "normpath", + "once_cell", + "paste", + "pathdiff", + "pilota-build", + "proc-macro2", + "quote", + "serde", + "serde_yaml", + "syn 1.0.109", + "tempfile", + "url_path", + "volo", + "walkdir", +] + +[[package]] +name = "volo-cli" +version = "0.8.0" +dependencies = [ + "anyhow", + "clap", + "colored", + "heck 0.4.1", + "itertools", + "lazy_static", + "log", + "normpath", + "pilota-thrift-parser", + "pretty_env_logger", + "regex", + "run_script", + "same-file", + "serde", + "serde_yaml", + "update-informer", + "volo-build", +] + +[[package]] +name = "volo-gen" +version = "0.0.0" +dependencies = [ + "anyhow", + "futures", + "pilota", + "tokio", + "volo", + "volo-build", + "volo-grpc", + "volo-thrift", +] + +[[package]] +name = "volo-grpc" +version = "0.8.0" +dependencies = [ + "anyhow", + "async-stream", + "base64 0.13.1", + "bytes", + "flate2", + "futures", + "futures-util", + "fxhash", + "h2", + "hex", + "http", + "http-body", + "hyper", + "hyper-timeout", + "matchit", + "metainfo", + "motore", + "percent-encoding", + "pilota", + "pin-project", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tokio-stream", + "tokio-util", + "tower", + "tracing", + "tracing-subscriber", + "volo", +] + +[[package]] +name = "volo-http" +version = "0.0.0" + +[[package]] +name = "volo-macros" +version = "0.8.0" + +[[package]] +name = "volo-thrift" +version = "0.8.0" +dependencies = [ + "anyhow", + "bytes", + "chrono", + "futures", + "fxhash", + "lazy_static", + "linked-hash-map", + "linkedbytes", + "metainfo", + "motore", + "num_enum", + "parking_lot 0.12.1", + "paste", + "pilota", + "pin-project", + "thiserror", + "tokio", + "tracing", + "volo", +] + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[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.38", + "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.38", + "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 = "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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +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 = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[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_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[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_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys", +] From ab44810f44e2f10db3a34de57096bd9ccdf53b87 Mon Sep 17 00:00:00 2001 From: minghuaw Date: Thu, 26 Oct 2023 01:17:54 -0700 Subject: [PATCH 30/30] only enable doc_cfg when building on docs.rs --- volo-grpc/Cargo.toml | 3 +++ volo-grpc/src/cfg.rs | 6 +++--- volo-grpc/src/lib.rs | 2 +- volo-grpc/src/transport/tls.rs | 4 ++-- volo/Cargo.toml | 3 +++ volo/src/cfg.rs | 6 +++--- volo/src/lib.rs | 2 +- volo/src/net/dial.rs | 4 ++-- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/volo-grpc/Cargo.toml b/volo-grpc/Cargo.toml index 35ef41e5..e2b0a970 100644 --- a/volo-grpc/Cargo.toml +++ b/volo-grpc/Cargo.toml @@ -14,6 +14,9 @@ keywords = ["async", "rpc", "grpc", "protobuf"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "docsrs"] # for conditional intra-doc links + [badges] maintenance = { status = "actively-developed" } diff --git a/volo-grpc/src/cfg.rs b/volo-grpc/src/cfg.rs index 0a531153..ee63c1ff 100644 --- a/volo-grpc/src/cfg.rs +++ b/volo-grpc/src/cfg.rs @@ -3,7 +3,7 @@ macro_rules! cfg_rustls { ($($item:item)*) => { $( #[cfg(feature = "rustls")] - #[doc(cfg(feature = "rustls"))] + #[cfg_attr(docsrs, doc(cfg(feature = "rustls")))] $item )* } @@ -14,7 +14,7 @@ macro_rules! cfg_native_tls { ($($item:item)*) => { $( #[cfg(feature = "native-tls")] - #[doc(cfg(feature = "native-tls"))] + #[cfg_attr(docsrs, doc(cfg(feature = "native-tls")))] $item )* } @@ -25,7 +25,7 @@ macro_rules! cfg_rustls_or_native_tls { ($($item:item)*) => { $( #[cfg(any(feature = "rustls", feature = "native-tls"))] - #[doc(cfg(any(feature = "rustls", feature = "native-tls")))] + #[cfg_attr(docsrs, doc(cfg(any(feature = "rustls", feature = "native-tls"))))] $item )* } diff --git a/volo-grpc/src/lib.rs b/volo-grpc/src/lib.rs index 5f37beb1..10ade2db 100644 --- a/volo-grpc/src/lib.rs +++ b/volo-grpc/src/lib.rs @@ -2,7 +2,7 @@ html_logo_url = "https://github.com/cloudwego/volo/raw/main/.github/assets/logo.png?sanitize=true" )] #![cfg_attr(not(doctest), doc = include_str!("../README.md"))] -#![feature(doc_cfg)] +#![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] mod cfg; diff --git a/volo-grpc/src/transport/tls.rs b/volo-grpc/src/transport/tls.rs index 6f92486a..6eb302fc 100644 --- a/volo-grpc/src/transport/tls.rs +++ b/volo-grpc/src/transport/tls.rs @@ -9,12 +9,12 @@ cfg_rustls_or_native_tls! { #[derive(Clone)] pub enum TlsAcceptor { /// `tokio_rustls::TlsAcceptor` internally uses `Arc` - #[doc(cfg(feature = "rustls"))] + #[cfg_attr(docsrs, doc(cfg(feature = "rustls")))] #[cfg(feature = "rustls")] Rustls(tokio_rustls::TlsAcceptor), /// This takes an `Arc` because it does not internally use `Arc` - #[doc(cfg(feature = "native-tls"))] + #[cfg_attr(docsrs, doc(cfg(feature = "native-tls")))] #[cfg(feature = "native-tls")] NativeTls(std::sync::Arc), } diff --git a/volo/Cargo.toml b/volo/Cargo.toml index 2170db48..75137fc4 100644 --- a/volo/Cargo.toml +++ b/volo/Cargo.toml @@ -16,6 +16,9 @@ keywords = ["async", "rpc", "thrift", "grpc", "protobuf"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "docsrs"] # for conditional intra-doc links + [badges] maintenance = { status = "actively-developed" } diff --git a/volo/src/cfg.rs b/volo/src/cfg.rs index f1431853..6c8941cf 100644 --- a/volo/src/cfg.rs +++ b/volo/src/cfg.rs @@ -2,7 +2,7 @@ macro_rules! cfg_rustls { ($($item:item)*) => { $( #[cfg(feature = "rustls")] - #[doc(cfg(feature = "rustls"))] + #[cfg_attr(docsrs, doc(cfg(feature = "rustls")))] $item )* } @@ -12,7 +12,7 @@ macro_rules! cfg_native_tls { ($($item:item)*) => { $( #[cfg(feature = "native-tls")] - #[doc(cfg(feature = "native-tls"))] + #[cfg_attr(docsrs, doc(cfg(feature = "native-tls")))] $item )* } @@ -22,7 +22,7 @@ macro_rules! cfg_rustls_or_native_tls { ($($item:item)*) => { $( #[cfg(any(feature = "rustls", feature = "native-tls"))] - #[doc(cfg(any(feature = "rustls", feature = "native-tls")))] + #[cfg_attr(docsrs, doc(cfg(any(feature = "rustls", feature = "native-tls"))))] $item )* } diff --git a/volo/src/lib.rs b/volo/src/lib.rs index e34118db..bd08abd4 100644 --- a/volo/src/lib.rs +++ b/volo/src/lib.rs @@ -2,7 +2,7 @@ html_logo_url = "https://github.com/cloudwego/volo/raw/main/.github/assets/logo.png?sanitize=true" )] #![cfg_attr(not(doctest), doc = include_str!("../README.md"))] -#![feature(doc_cfg)] +#![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] mod cfg; diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index f76dba60..efef8a9e 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -144,12 +144,12 @@ cfg_rustls_or_native_tls! { /// A wrapper around [`tokio_rustls::TlsConnector`] and [`tokio_native_tls::TlsConnector`]. #[derive(Clone)] pub enum TlsConnector { - #[doc(cfg(feature = "rustls"))] + #[cfg_attr(docsrs, doc(cfg(feature = "rustls")))] #[cfg(feature = "rustls")] Rustls(tokio_rustls::TlsConnector), /// This takes an `Arc` because `tokio_native_tls::TlsConnector` does not internally use `Arc` - #[doc(cfg(feature = "native-tls"))] + #[cfg_attr(docsrs, doc(cfg(feature = "native-tls")))] #[cfg(feature = "native-tls")] NativeTls(std::sync::Arc), }