From 8b890b59672d312265da34aacf52a28c833f1e49 Mon Sep 17 00:00:00 2001 From: Hamza Jadid Date: Thu, 19 Sep 2024 15:30:57 +0300 Subject: [PATCH] feat: bump deps and fix rustls usage (#126) --- Cargo.toml | 14 ++++++++------ jarust/Cargo.toml | 8 ++++---- jarust_plugins/Cargo.toml | 2 +- jarust_rt/Cargo.toml | 2 +- jarust_transport/Cargo.toml | 14 +++++++------- jarust_transport/src/error.rs | 2 ++ jarust_transport/src/legacy/web_socket.rs | 4 ++-- 7 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 96f633c..9b1268d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,10 +14,12 @@ edition = "2021" repository = "https://github.com/Ghamza-Jd/jarust" [workspace.dependencies] -async-trait = "0.1.77" -bytes = "1.6.0" -log = "0.4.20" -serde = { version = "1.0.195", features = ["derive"] } -serde_json = "1.0.111" -tokio = "1.35.1" +async-trait = "0.1.82" +bytes = "1.7.2" +futures-util = "0.3.30" +log = "0.4.22" +serde = { version = "1.0.210", features = ["derive"] } +serde_json = "1.0.128" +thiserror = "1.0.63" +tokio = "1.40.0" tracing = "0.1.40" diff --git a/jarust/Cargo.toml b/jarust/Cargo.toml index 1c116e3..d4e7931 100644 --- a/jarust/Cargo.toml +++ b/jarust/Cargo.toml @@ -16,18 +16,18 @@ doctest = false [dependencies] async-trait.workspace = true bytes.workspace = true -futures-util = "0.3.29" -indexmap = "2.2.6" +futures-util.workspace = true +indexmap = "2.5.0" jarust_rt = { version = "0.5.0", path = "../jarust_rt" } jarust_transport = { version = "0.5.0", path = "../jarust_transport" } rand = "0.8.5" serde_json.workspace = true serde.workspace = true -thiserror = "1.0.51" +thiserror.workspace = true tokio = { workspace = true, features = ["sync", "time", "rt"] } tracing.workspace = true [dev-dependencies] -anyhow = "1.0.82" +anyhow = "1.0.89" tokio = { workspace = true, features = ["time", "macros", "rt-multi-thread"] } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } diff --git a/jarust_plugins/Cargo.toml b/jarust_plugins/Cargo.toml index 71b22d4..5be3047 100644 --- a/jarust_plugins/Cargo.toml +++ b/jarust_plugins/Cargo.toml @@ -31,6 +31,6 @@ video_room = [] __experimental = [] [dev-dependencies] -anyhow = "1.0.79" +anyhow = "1.0.89" tokio = { workspace = true, features = ["time", "macros", "rt-multi-thread"] } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } diff --git a/jarust_rt/Cargo.toml b/jarust_rt/Cargo.toml index 8a1cd03..6023827 100644 --- a/jarust_rt/Cargo.toml +++ b/jarust_rt/Cargo.toml @@ -14,7 +14,7 @@ repository.workspace = true doctest = false [dependencies] -futures-util = "0.3.29" +futures-util.workspace = true tokio = { workspace = true, features = ["rt"] } [features] diff --git a/jarust_transport/Cargo.toml b/jarust_transport/Cargo.toml index 29f8639..14c2207 100644 --- a/jarust_transport/Cargo.toml +++ b/jarust_transport/Cargo.toml @@ -13,25 +13,25 @@ repository.workspace = true [dependencies] async-trait.workspace = true bytes.workspace = true -futures-util = "0.3.29" -indexmap = "2.2.6" +futures-util.workspace = true +indexmap = "2.5.0" jarust_rt = { version = "0.5.0", path = "../jarust_rt" } rand = "0.8.5" serde_json.workspace = true serde.workspace = true -thiserror = "1.0.51" +thiserror.workspace = true tokio = { workspace = true, features = ["sync", "time", "rt"] } tracing.workspace = true [target.'cfg(not(target_family = "wasm"))'.dependencies] -rustls = { version = "0.22.2", optional = true } -rustls-native-certs = { version = "0.7.0", optional = true } -tokio-tungstenite = "0.21.0" +rustls = { version = "0.23.13", optional = true } +rustls-native-certs = { version = "0.8.0", optional = true } +tokio-tungstenite = "0.24.0" [target.'cfg(target_family = "wasm")'.dependencies] getrandom = { version = "0.2.12", features = ["js"] } [features] -default = ["use-native-tls"] +default = ["use-rustls"] use-native-tls = ["tokio-tungstenite/native-tls"] use-rustls = ["rustls", "rustls-native-certs", "tokio-tungstenite/__rustls-tls"] diff --git a/jarust_transport/src/error.rs b/jarust_transport/src/error.rs index 6d67c32..175e1b8 100644 --- a/jarust_transport/src/error.rs +++ b/jarust_transport/src/error.rs @@ -4,9 +4,11 @@ pub enum JaTransportError { #[cfg(not(target_family = "wasm"))] #[error("Websocket error: {0}")] WebSocket(#[from] tokio_tungstenite::tungstenite::Error), + #[cfg(not(target_family = "wasm"))] #[error("InvalidHeaderValue: {0}")] InvalidHeaderValue(#[from] tokio_tungstenite::tungstenite::http::header::InvalidHeaderValue), + #[error("Failed to parse json: {0}")] JsonParsingFailure(#[from] serde_json::Error), #[error("IO: {0}")] diff --git a/jarust_transport/src/legacy/web_socket.rs b/jarust_transport/src/legacy/web_socket.rs index dcbff39..3f4a329 100644 --- a/jarust_transport/src/legacy/web_socket.rs +++ b/jarust_transport/src/legacy/web_socket.rs @@ -89,9 +89,9 @@ impl TransportProtocol for WebsocketTransport { impl WebsocketTransport { #[cfg(feature = "use-rustls")] - fn make_tls_client_config() -> JaResult> { + fn make_tls_client_config() -> JaTransportResult> { let mut root_store = RootCertStore::empty(); - let platform_certs = rustls_native_certs::load_native_certs()?; + let platform_certs = rustls_native_certs::load_native_certs().certs; root_store.add_parsable_certificates(platform_certs); let client_config = rustls::ClientConfig::builder() .with_root_certificates(root_store)