From 6b0e0aeee311844b9334afcd5e3d63b1c8c87e3b Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Tue, 11 Feb 2025 21:39:49 -0500 Subject: [PATCH] chore: remove expicit hyper dependency We're no longer depending on `hyper` directly in any way after the 1.0 upgrade, so replace it with the `http` library instead. --- Cargo.lock | 2 +- Cargo.toml | 2 ++ crates/sshx-core/Cargo.toml | 2 +- crates/sshx-server/Cargo.toml | 4 ++-- crates/sshx-server/src/listen.rs | 2 +- crates/sshx-server/tests/common/mod.rs | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31679e4..923260d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1946,7 +1946,7 @@ dependencies = [ "deadpool-redis", "futures-util", "hmac", - "hyper", + "http", "parking_lot", "prost", "rand", diff --git a/Cargo.toml b/Cargo.toml index eec340f..cecc97e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,8 @@ sshx-core = { version = "0.4.0", path = "crates/sshx-core" } tokio = { version = "1.40.0", features = ["full"] } tokio-stream = { version = "0.1.14", features = ["sync"] } tonic = { version = "0.12.3", features = ["tls", "tls-webpki-roots"] } +tonic-build = "0.12.3" +tonic-reflection = "0.12.3" tracing = "0.1.37" tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } diff --git a/crates/sshx-core/Cargo.toml b/crates/sshx-core/Cargo.toml index 2ab61a7..6c2fbee 100644 --- a/crates/sshx-core/Cargo.toml +++ b/crates/sshx-core/Cargo.toml @@ -16,4 +16,4 @@ serde.workspace = true tonic.workspace = true [build-dependencies] -tonic-build = "0.12.3" +tonic-build.workspace = true diff --git a/crates/sshx-server/Cargo.toml b/crates/sshx-server/Cargo.toml index 722acff..2049165 100644 --- a/crates/sshx-server/Cargo.toml +++ b/crates/sshx-server/Cargo.toml @@ -23,7 +23,7 @@ deadpool = "0.12.2" deadpool-redis = "0.18.0" futures-util = { version = "0.3.28", features = ["sink"] } hmac = "0.12.1" -hyper = { version = "1.6.0", features = ["full"] } +http = "1.2.0" parking_lot = "0.12.1" prost.workspace = true rand.workspace = true @@ -36,7 +36,7 @@ tokio.workspace = true tokio-stream.workspace = true tokio-tungstenite = "0.26.1" tonic.workspace = true -tonic-reflection = "0.12.3" +tonic-reflection.workspace = true tower = { version = "0.4.13", features = ["steer"] } tower-http = { version = "0.6.2", features = ["fs", "redirect", "trace"] } tracing.workspace = true diff --git a/crates/sshx-server/src/listen.rs b/crates/sshx-server/src/listen.rs index 7eea9d4..ecfc421 100644 --- a/crates/sshx-server/src/listen.rs +++ b/crates/sshx-server/src/listen.rs @@ -3,7 +3,7 @@ use std::{fmt::Debug, future::Future, sync::Arc}; use anyhow::Result; use axum::body::Body; use axum::serve::Listener; -use hyper::{header::CONTENT_TYPE, Request}; +use http::{header::CONTENT_TYPE, Request}; use sshx_core::proto::{sshx_service_server::SshxServiceServer, FILE_DESCRIPTOR_SET}; use tonic::service::Routes as TonicRoutes; use tower::{make::Shared, steer::Steer, ServiceExt}; diff --git a/crates/sshx-server/tests/common/mod.rs b/crates/sshx-server/tests/common/mod.rs index 6fb4f6a..f86b06c 100644 --- a/crates/sshx-server/tests/common/mod.rs +++ b/crates/sshx-server/tests/common/mod.rs @@ -6,7 +6,7 @@ use std::time::Duration; use anyhow::{ensure, Result}; use axum::serve::ListenerExt; use futures_util::{SinkExt, StreamExt}; -use hyper::StatusCode; +use http::StatusCode; use sshx::encrypt::Encrypt; use sshx_core::proto::sshx_service_client::SshxServiceClient; use sshx_core::{Sid, Uid};