update tonic axum

Signed-off-by: junxiang Mu <1948535941@qq.com>
This commit is contained in:
junxiang Mu
2025-04-09 02:39:46 +00:00
parent 5fd9b17b53
commit ebf1a9d9c4
8 changed files with 99 additions and 132 deletions
Generated
+80 -115
View File
@@ -614,28 +614,6 @@ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
[[package]]
name = "async-stream"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476"
dependencies = [
"async-stream-impl",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-stream-impl"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]
[[package]] [[package]]
name = "async-task" name = "async-task"
version = "4.7.1" version = "4.7.1"
@@ -722,13 +700,13 @@ dependencies = [
[[package]] [[package]]
name = "axum" name = "axum"
version = "0.7.9" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288"
dependencies = [ dependencies = [
"async-trait",
"axum-core", "axum-core",
"bytes", "bytes",
"form_urlencoded",
"futures-util", "futures-util",
"http", "http",
"http-body", "http-body",
@@ -736,7 +714,7 @@ dependencies = [
"hyper", "hyper",
"hyper-util", "hyper-util",
"itoa 1.0.15", "itoa 1.0.15",
"matchit 0.7.3", "matchit",
"memchr", "memchr",
"mime", "mime",
"percent-encoding", "percent-encoding",
@@ -756,13 +734,12 @@ dependencies = [
[[package]] [[package]]
name = "axum-core" name = "axum-core"
version = "0.4.5" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6"
dependencies = [ dependencies = [
"async-trait",
"bytes", "bytes",
"futures-util", "futures-core",
"http", "http",
"http-body", "http-body",
"http-body-util", "http-body-util",
@@ -777,24 +754,23 @@ dependencies = [
[[package]] [[package]]
name = "axum-server" name = "axum-server"
version = "0.6.0" version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1ad46c3ec4e12f4a4b6835e173ba21c25e484c9d02b49770bf006ce5367c036" checksum = "495c05f60d6df0093e8fb6e74aa5846a0ad06abaf96d76166283720bf740f8ab"
dependencies = [ dependencies = [
"arc-swap", "arc-swap",
"bytes", "bytes",
"futures-util", "fs-err",
"http", "http",
"http-body", "http-body",
"http-body-util",
"hyper", "hyper",
"hyper-util", "hyper-util",
"pin-project-lite", "pin-project-lite",
"rustls 0.21.12", "rustls",
"rustls-pemfile", "rustls-pemfile",
"rustls-pki-types",
"tokio", "tokio",
"tokio-rustls 0.24.1", "tokio-rustls",
"tower 0.4.13",
"tower-service", "tower-service",
] ]
@@ -1389,7 +1365,7 @@ dependencies = [
"lazy_static", "lazy_static",
"scopeguard", "scopeguard",
"tokio", "tokio",
"tonic", "tonic 0.13.0",
"tracing-error", "tracing-error",
] ]
@@ -3007,7 +2983,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"tokio", "tokio",
"tonic", "tonic 0.13.0",
"tower 0.5.2", "tower 0.5.2",
"url", "url",
] ]
@@ -3063,7 +3039,7 @@ dependencies = [
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tokio-util", "tokio-util",
"tonic", "tonic 0.13.0",
"tower 0.5.2", "tower 0.5.2",
"tracing", "tracing",
"tracing-error", "tracing-error",
@@ -3285,6 +3261,16 @@ dependencies = [
"percent-encoding", "percent-encoding",
] ]
[[package]]
name = "fs-err"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f89bda4c2a21204059a977ed3bfe746677dfd137b83c339e702b0ac91d482aa"
dependencies = [
"autocfg",
"tokio",
]
[[package]] [[package]]
name = "fs_extra" name = "fs_extra"
version = "1.3.0" version = "1.3.0"
@@ -4042,10 +4028,10 @@ dependencies = [
"http", "http",
"hyper", "hyper",
"hyper-util", "hyper-util",
"rustls 0.23.25", "rustls",
"rustls-pki-types", "rustls-pki-types",
"tokio", "tokio",
"tokio-rustls 0.26.2", "tokio-rustls",
"tower-service", "tower-service",
"webpki-roots", "webpki-roots",
] ]
@@ -4764,7 +4750,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"tokio", "tokio",
"tonic", "tonic 0.13.0",
"tracing", "tracing",
"tracing-error", "tracing-error",
"url", "url",
@@ -4918,15 +4904,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
[[package]] [[package]]
name = "matchit" name = "matchit"
version = "0.7.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
[[package]]
name = "matchit"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f926ade0c4e170215ae43342bf13b9310a437609c81f29f86c5df6657582ef9"
[[package]] [[package]]
name = "md-5" name = "md-5"
@@ -5616,7 +5596,7 @@ dependencies = [
"reqwest", "reqwest",
"thiserror 2.0.12", "thiserror 2.0.12",
"tokio", "tokio",
"tonic", "tonic 0.12.3",
"tracing", "tracing",
] ]
@@ -5643,7 +5623,7 @@ dependencies = [
"opentelemetry", "opentelemetry",
"opentelemetry_sdk", "opentelemetry_sdk",
"prost", "prost",
"tonic", "tonic 0.12.3",
] ]
[[package]] [[package]]
@@ -6495,7 +6475,7 @@ dependencies = [
"prost-build", "prost-build",
"protobuf 3.7.2", "protobuf 3.7.2",
"tokio", "tokio",
"tonic", "tonic 0.13.0",
"tonic-build", "tonic-build",
"tower 0.5.2", "tower 0.5.2",
] ]
@@ -6548,7 +6528,7 @@ dependencies = [
"quinn-proto", "quinn-proto",
"quinn-udp", "quinn-udp",
"rustc-hash 2.1.1", "rustc-hash 2.1.1",
"rustls 0.23.25", "rustls",
"socket2", "socket2",
"thiserror 2.0.12", "thiserror 2.0.12",
"tokio", "tokio",
@@ -6567,7 +6547,7 @@ dependencies = [
"rand 0.9.0", "rand 0.9.0",
"ring", "ring",
"rustc-hash 2.1.1", "rustc-hash 2.1.1",
"rustls 0.23.25", "rustls",
"rustls-pki-types", "rustls-pki-types",
"slab", "slab",
"thiserror 2.0.12", "thiserror 2.0.12",
@@ -6905,7 +6885,7 @@ dependencies = [
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
"quinn", "quinn",
"rustls 0.23.25", "rustls",
"rustls-pemfile", "rustls-pemfile",
"rustls-pki-types", "rustls-pki-types",
"serde", "serde",
@@ -6914,7 +6894,7 @@ dependencies = [
"sync_wrapper", "sync_wrapper",
"system-configuration", "system-configuration",
"tokio", "tokio",
"tokio-rustls 0.26.2", "tokio-rustls",
"tokio-util", "tokio-util",
"tower 0.5.2", "tower 0.5.2",
"tower-service", "tower-service",
@@ -7147,7 +7127,7 @@ dependencies = [
"local-ip-address", "local-ip-address",
"lock", "lock",
"madmin", "madmin",
"matchit 0.8.6", "matchit",
"mime", "mime",
"mime_guess", "mime_guess",
"netif", "netif",
@@ -7163,7 +7143,7 @@ dependencies = [
"rmp-serde", "rmp-serde",
"rust-embed", "rust-embed",
"rustfs-obs", "rustfs-obs",
"rustls 0.23.25", "rustls",
"rustls-pemfile", "rustls-pemfile",
"rustls-pki-types", "rustls-pki-types",
"s3s", "s3s",
@@ -7173,10 +7153,10 @@ dependencies = [
"shadow-rs", "shadow-rs",
"time", "time",
"tokio", "tokio",
"tokio-rustls 0.26.2", "tokio-rustls",
"tokio-stream", "tokio-stream",
"tokio-util", "tokio-util",
"tonic", "tonic 0.13.0",
"tonic-build", "tonic-build",
"tonic-reflection", "tonic-reflection",
"tower 0.5.2", "tower 0.5.2",
@@ -7265,18 +7245,6 @@ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
[[package]]
name = "rustls"
version = "0.21.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e"
dependencies = [
"log",
"ring",
"rustls-webpki 0.101.7",
"sct",
]
[[package]] [[package]]
name = "rustls" name = "rustls"
version = "0.23.25" version = "0.23.25"
@@ -7288,7 +7256,7 @@ dependencies = [
"once_cell", "once_cell",
"ring", "ring",
"rustls-pki-types", "rustls-pki-types",
"rustls-webpki 0.103.1", "rustls-webpki",
"subtle", "subtle",
"zeroize", "zeroize",
] ]
@@ -7311,16 +7279,6 @@ dependencies = [
"web-time", "web-time",
] ]
[[package]]
name = "rustls-webpki"
version = "0.101.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
dependencies = [
"ring",
"untrusted",
]
[[package]] [[package]]
name = "rustls-webpki" name = "rustls-webpki"
version = "0.103.1" version = "0.103.1"
@@ -7418,16 +7376,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 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]] [[package]]
name = "security-framework" name = "security-framework"
version = "2.11.1" version = "2.11.1"
@@ -8412,23 +8360,13 @@ dependencies = [
"syn 2.0.100", "syn 2.0.100",
] ]
[[package]]
name = "tokio-rustls"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [
"rustls 0.21.12",
"tokio",
]
[[package]] [[package]]
name = "tokio-rustls" name = "tokio-rustls"
version = "0.26.2" version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b"
dependencies = [ dependencies = [
"rustls 0.23.25", "rustls",
"tokio", "tokio",
] ]
@@ -8519,7 +8457,33 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52"
dependencies = [ dependencies = [
"async-stream", "async-trait",
"base64 0.22.1",
"bytes",
"flate2",
"http",
"http-body",
"http-body-util",
"hyper",
"hyper-timeout",
"hyper-util",
"percent-encoding",
"pin-project",
"prost",
"tokio",
"tokio-stream",
"tower 0.4.13",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tonic"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85839f0b32fd242bb3209262371d07feda6d780d16ee9d2bc88581b89da1549b"
dependencies = [
"async-trait", "async-trait",
"axum", "axum",
"base64 0.22.1", "base64 0.22.1",
@@ -8535,12 +8499,10 @@ dependencies = [
"percent-encoding", "percent-encoding",
"pin-project", "pin-project",
"prost", "prost",
"rustls-pemfile",
"socket2", "socket2",
"tokio", "tokio",
"tokio-rustls 0.26.2",
"tokio-stream", "tokio-stream",
"tower 0.4.13", "tower 0.5.2",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing", "tracing",
@@ -8548,9 +8510,9 @@ dependencies = [
[[package]] [[package]]
name = "tonic-build" name = "tonic-build"
version = "0.12.3" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" checksum = "d85f0383fadd15609306383a90e85eaed44169f931a5d2be1b42c76ceff1825e"
dependencies = [ dependencies = [
"prettyplease", "prettyplease",
"proc-macro2", "proc-macro2",
@@ -8562,15 +8524,15 @@ dependencies = [
[[package]] [[package]]
name = "tonic-reflection" name = "tonic-reflection"
version = "0.12.3" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "878d81f52e7fcfd80026b7fdb6a9b578b3c3653ba987f87f0dce4b64043cba27" checksum = "88fa815be858816dad226a49439ee90b7bcf81ab55bee72fdb217f1e6778c3ca"
dependencies = [ dependencies = [
"prost", "prost",
"prost-types", "prost-types",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tonic", "tonic 0.13.0",
] ]
[[package]] [[package]]
@@ -8601,9 +8563,12 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-util", "futures-util",
"indexmap 2.8.0",
"pin-project-lite", "pin-project-lite",
"slab",
"sync_wrapper", "sync_wrapper",
"tokio", "tokio",
"tokio-util",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing", "tracing",
+5 -5
View File
@@ -111,9 +111,9 @@ time = { version = "0.3.41", features = [
"serde", "serde",
] } ] }
tokio = { version = "1.44.2", features = ["fs", "rt-multi-thread"] } tokio = { version = "1.44.2", features = ["fs", "rt-multi-thread"] }
tonic = { version = "0.12.3", features = ["gzip"] } tonic = { version = "0.13.0", features = ["gzip"] }
tonic-build = "0.12.3" tonic-build = "0.13.0"
tonic-reflection = "0.12" tonic-reflection = "0.13.0"
tokio-rustls = { version = "0.26", default-features = false } tokio-rustls = { version = "0.26", default-features = false }
tokio-stream = "0.1.17" tokio-stream = "0.1.17"
tokio-util = { version = "0.7.13", features = ["io", "compat"] } tokio-util = { version = "0.7.13", features = ["io", "compat"] }
@@ -132,8 +132,8 @@ uuid = { version = "1.15.1", features = [
"fast-rng", "fast-rng",
"macro-diagnostics", "macro-diagnostics",
] } ] }
axum = "0.7.9" axum = "0.8.3"
axum-server = { version = "0.6", features = ["tls-rustls"] } axum-server = { version = "0.7.2", features = ["tls-rustls"] }
md-5 = "0.10.6" md-5 = "0.10.6"
workers = { path = "./common/workers" } workers = { path = "./common/workers" }
test-case = "3.3.1" test-case = "3.3.1"
+1 -1
View File
@@ -11,5 +11,5 @@ async-trait.workspace = true
lazy_static.workspace = true lazy_static.workspace = true
scopeguard = "1.2.0" scopeguard = "1.2.0"
tokio.workspace = true tokio.workspace = true
tonic.workspace = true tonic = { workspace = true }
tracing-error.workspace = true tracing-error.workspace = true
+1 -1
View File
@@ -13,7 +13,7 @@ flatbuffers = { workspace = true }
prost = { workspace = true } prost = { workspace = true }
protobuf = { workspace = true } protobuf = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
tonic = { workspace = true, features = ["transport", "tls"] } tonic = { workspace = true, features = ["transport"] }
tower = { workspace = true } tower = { workspace = true }
[build-dependencies] [build-dependencies]
+1 -1
View File
@@ -8,7 +8,7 @@ use std::{
type AnyError = Box<dyn std::error::Error>; type AnyError = Box<dyn std::error::Error>;
const ENV_OUT_DIR: &str = "OUT_DIR"; const ENV_OUT_DIR: &str = "OUT_DIR";
const VERSION_PROTOBUF: Version = Version(27, 0, 0); // 27.0 const VERSION_PROTOBUF: Version = Version(30, 2, 0); // 30.2.0
const VERSION_FLATBUFFERS: Version = Version(24, 3, 25); // 24.3.25 const VERSION_FLATBUFFERS: Version = Version(24, 3, 25); // 24.3.25
/// Build protos if the major version of `flatc` or `protoc` is greater /// Build protos if the major version of `flatc` or `protoc` is greater
/// or lesser than the expected version. /// or lesser than the expected version.
@@ -1085,7 +1085,7 @@ pub mod node_service_client {
} }
impl<T> NodeServiceClient<T> impl<T> NodeServiceClient<T>
where where
T: tonic::client::GrpcService<tonic::body::BoxBody>, T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>, T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
@@ -1106,13 +1106,13 @@ pub mod node_service_client {
F: tonic::service::Interceptor, F: tonic::service::Interceptor,
T::ResponseBody: Default, T::ResponseBody: Default,
T: tonic::codegen::Service< T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>, http::Request<tonic::body::Body>,
Response = http::Response< Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>, >,
>, >,
<T as tonic::codegen::Service< <T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>, http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{ {
NodeServiceClient::new(InterceptedService::new(inner, interceptor)) NodeServiceClient::new(InterceptedService::new(inner, interceptor))
@@ -3607,7 +3607,7 @@ pub mod node_service_server {
B: Body + std::marker::Send + 'static, B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static, B::Error: Into<StdError> + std::marker::Send + 'static,
{ {
type Response = http::Response<tonic::body::BoxBody>; type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible; type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>; type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready( fn poll_ready(
@@ -7074,7 +7074,9 @@ pub mod node_service_server {
} }
_ => { _ => {
Box::pin(async move { Box::pin(async move {
let mut response = http::Response::new(empty_body()); let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut(); let headers = response.headers_mut();
headers headers
.insert( .insert(
+1 -1
View File
@@ -22,7 +22,7 @@ protos.workspace = true
rmp-serde.workspace = true rmp-serde.workspace = true
serde.workspace = true serde.workspace = true
serde_json.workspace = true serde_json.workspace = true
tonic = { version = "0.12.3", features = ["gzip"] } tonic = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
tower.workspace = true tower.workspace = true
url.workspace = true url.workspace = true
+2 -2
View File
@@ -60,7 +60,7 @@ tokio = { workspace = true, features = [
tokio-rustls.workspace = true tokio-rustls.workspace = true
lazy_static.workspace = true lazy_static.workspace = true
tokio-stream.workspace = true tokio-stream.workspace = true
tonic.workspace = true tonic = { workspace = true }
tonic-reflection.workspace = true tonic-reflection.workspace = true
tower.workspace = true tower.workspace = true
tracing-core = { workspace = true } tracing-core = { workspace = true }
@@ -71,7 +71,7 @@ uuid = "1.15.1"
url.workspace = true url.workspace = true
axum.workspace = true axum.workspace = true
axum-server = { workspace = true } axum-server = { workspace = true }
matchit = "0.8.6" matchit = "0.8.4"
shadow-rs.workspace = true shadow-rs.workspace = true
const-str = { version = "0.6.1", features = ["std", "proc"] } const-str = { version = "0.6.1", features = ["std", "proc"] }
atoi = "2.0.0" atoi = "2.0.0"