Skip to content

Commit fc9cd2c

Browse files
authored
Merge pull request #1997 from mintlayer/remove_rustls_pemfile_dep
Fix CI: update crates that depend on the now deprecated crate `rustls-pemfile`
2 parents fa01f77 + b7b6455 commit fc9cd2c

14 files changed

Lines changed: 541 additions & 441 deletions

File tree

Cargo.lock

Lines changed: 242 additions & 342 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,16 @@ hex-literal = "0.4"
183183
hickory-client = "0.24"
184184
hickory-server = "0.24"
185185
hmac = "0.12"
186+
http = "1.3"
187+
hyper = "1.7"
186188
iced = "0.13"
187189
# Note: we need this fix - https://github.com/iced-rs/iced_aw/pull/329
188190
# TODO: switch back to a released version of iced_aw once the fix is released (need version > 0.12)
189191
iced_aw = { git = "https://github.com/iced-rs/iced_aw", rev = "def1db9aac1e58a47e0c3127d4d4e95d724ca8ad" }
190192
iced_fonts = "0.1"
191193
indoc = "2.0"
192194
itertools = "0.14"
193-
jsonrpsee = { version = "0.22", default-features = false }
195+
jsonrpsee = { version = "0.26", default-features = false }
194196
lazy_static = "1.4"
195197
libtest-mimic = "0.8"
196198
log = "0.4"
@@ -221,6 +223,7 @@ reedline = "0.38"
221223
ref-cast = "1.0"
222224
regex = "1.10"
223225
replace_with = "0.1"
226+
reqwest = "0.12"
224227
rfd = { version = "0.15", default-features = false }
225228
ripemd = "0.1"
226229
rlimit = "0.10"
@@ -258,8 +261,8 @@ tokio-socks = "0.5"
258261
tokio-stream = "0.1"
259262
tokio-util = { version = "0.7", default-features = false }
260263
toml = "0.8"
261-
tower = "0.4"
262-
tower-http-axum = { package = "tower-http", version = "0.5" }
264+
tower = "0.5"
265+
tower-http = "0.5"
263266
x25519-dalek = "2.0"
264267
zeroize = "1.5"
265268

api-server/stack-test-suite/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ axum.workspace = true
2727
ctor.workspace = true
2828
hex.workspace = true
2929
libtest-mimic.workspace = true
30-
reqwest = "0.11"
30+
reqwest.workspace = true
3131
rstest.workspace = true
3232
serde.workspace = true
3333
serde_json.workspace = true

api-server/web-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ serde = { workspace = true, features = ["derive"] }
2929
serde_json.workspace = true
3030
thiserror.workspace = true
3131
tokio = { workspace = true }
32-
tower-http-axum = { workspace = true, features = ["cors"] }
32+
tower-http = { workspace = true, features = ["cors"] }

api-server/web-server/src/api/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@
1616
pub mod json_helpers;
1717
pub mod v2;
1818

19+
use std::sync::Arc;
20+
21+
use axum::{http::Method, response::IntoResponse, routing::get, Json, Router};
22+
use serde_json::json;
23+
use tokio::net::TcpListener;
24+
use tower_http::cors::{AllowMethods, Any, CorsLayer};
25+
26+
use api_server_common::storage::storage_api::ApiServerStorage;
27+
1928
use crate::{
2029
api,
2130
error::{ApiServerWebServerClientError, ApiServerWebServerError},
2231
ApiServerWebServerState, TxSubmitClient,
2332
};
2433

25-
use api_server_common::storage::storage_api::ApiServerStorage;
26-
use axum::{http::Method, response::IntoResponse, routing::get, Json, Router};
27-
use serde_json::json;
28-
use std::sync::Arc;
29-
use tokio::net::TcpListener;
30-
use tower_http_axum::cors::{AllowMethods, Any, CorsLayer};
31-
3234
#[allow(clippy::unused_async)]
3335
async fn bad_request() -> Result<(), ApiServerWebServerError> {
3436
Err(ApiServerWebServerClientError::BadRequest)?

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ allow = [
1818
"BSD-3-Clause",
1919
"BSL-1.0",
2020
"CC0-1.0",
21+
"CDLA-Permissive-2.0",
2122
"ISC",
2223
"MIT",
2324
"MPL-2.0",

rpc/Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@ utils-networking = { path = "../utils/networking" }
2222
anyhow.workspace = true
2323
async-trait.workspace = true
2424
base64.workspace = true
25+
http.workspace = true
26+
hyper.workspace = true
2527
jsonrpsee = { workspace = true, features = ["server", "server-core", "http-client", "ws-client", "macros"] }
2628
serde.workspace = true
2729
serde_json.workspace = true
2830
thiserror.workspace = true
2931
tower = { workspace = true, features = ["util"] }
30-
31-
# This we keep here, and not in the workspace, because it comes from jsonrpsee and requires an older version
32-
tower-http = { version = "0.4", features = ["auth", "set-header"] }
33-
http = "0.2"
34-
hyper = "0.14"
32+
tower-http = { workspace = true, features = ["auth", "set-header"] }
3533

3634
[dev-dependencies]
3735
test-utils = { path = "../test-utils" }

rpc/src/lib.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ use std::{net::SocketAddr, path::PathBuf};
3131
use base64::Engine;
3232
use http::{header, HeaderValue};
3333
use jsonrpsee::{
34-
http_client::{transport::HttpBackend, HttpClient, HttpClientBuilder},
34+
core::middleware::RpcServiceBuilder,
35+
http_client::{transport::HttpBackend, HttpClient, HttpClientBuilder, RpcService},
3536
server::{ServerBuilder, ServerHandle},
3637
};
3738

@@ -109,7 +110,9 @@ impl Builder {
109110
};
110111

111112
let mut module = jsonrpsee::RpcModule::new(());
112-
module.register_method(method_list_name, move |_params, &()| method_names.clone())?;
113+
module.register_method(method_list_name, move |_params, &(), _extensions| {
114+
method_names.clone()
115+
})?;
113116
Ok(module)
114117
}
115118
}
@@ -223,7 +226,7 @@ impl<T> MakeHeaderValue<T> for RpcAuthData {
223226
}
224227
}
225228

226-
pub type RpcHttpClient = HttpClient<SetRequestHeader<HttpBackend, RpcAuthData>>;
229+
pub type RpcHttpClient = HttpClient<RpcService<SetRequestHeader<HttpBackend, RpcAuthData>>>;
227230

228231
pub fn new_http_client(
229232
host: impl AsRef<str>,
@@ -234,7 +237,12 @@ pub fn new_http_client(
234237
rpc_auth,
235238
));
236239

237-
HttpClientBuilder::default().set_http_middleware(middleware).build(host)
240+
HttpClientBuilder::default()
241+
// Note: by default (i.e. without calling `set_rpc_middleware`) `HttpClientBuilder` wraps
242+
// the produced `RpcService` into `RpcLogger`, which we don't need.
243+
.set_rpc_middleware(RpcServiceBuilder::default())
244+
.set_http_middleware(middleware)
245+
.build(host)
238246
}
239247

240248
pub type RpcWsClient = jsonrpsee::ws_client::WsClient;

rpc/src/rpc_auth/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ use crypto::{
1818
kdf::{argon2::Argon2Config, hash_password, verify_password, KdfConfig, KdfResult},
1919
util::eq::SliceEqualityCheckMethod,
2020
};
21-
use hyper::{Body, Request, Response};
21+
use hyper::{Request, Response};
22+
use jsonrpsee::server::HttpBody;
2223
use logging::log;
2324
use randomness::make_true_rng;
2425
use tower_http::validate_request::ValidateRequest;
@@ -102,7 +103,7 @@ impl RpcAuth {
102103
}
103104

104105
impl<B> ValidateRequest<B> for RpcAuth {
105-
type ResponseBody = Body;
106+
type ResponseBody = HttpBody;
106107

107108
fn validate(&mut self, request: &mut Request<B>) -> Result<(), Response<Self::ResponseBody>> {
108109
use jsonrpsee::types;

rpc/src/subscription.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ pub enum Error {
121121
}
122122

123123
/// Subscription method reply type
124-
pub type Reply = Result<(), jsonrpsee::core::StringError>;
124+
pub type Reply = Result<(), jsonrpsee::core::SubscriptionError>;

0 commit comments

Comments
 (0)