Skip to content

Commit

Permalink
feat: bump deps and fix rustls usage (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghamza-Jd authored Sep 19, 2024
1 parent d98430c commit 8b890b5
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 21 deletions.
14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 4 additions & 4 deletions jarust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion jarust_plugins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion jarust_rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
14 changes: 7 additions & 7 deletions jarust_transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 2 additions & 0 deletions jarust_transport/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}")]
Expand Down
4 changes: 2 additions & 2 deletions jarust_transport/src/legacy/web_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ impl TransportProtocol for WebsocketTransport {

impl WebsocketTransport {
#[cfg(feature = "use-rustls")]
fn make_tls_client_config() -> JaResult<Arc<rustls::ClientConfig>> {
fn make_tls_client_config() -> JaTransportResult<Arc<rustls::ClientConfig>> {
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)
Expand Down

0 comments on commit 8b890b5

Please sign in to comment.