From f1193f85c28b4cb8c71aec44fdb8c223e876d97e Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 20 Oct 2026 08:30:08 -0500 Subject: [PATCH 1/2] Disable oauth2/reqwest --- Cargo.lock | 2 +- Cargo.toml | 3 ++- src/handler/oauth2.rs | 37 ++++++++++++++++++++++++++++++++----- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 67f4c285..c823f5e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1495,6 +1495,7 @@ dependencies = [ "fastrand", "futures-lite", "git-version", + "http", "http-body", "httpdate", "janus_messages", @@ -3275,7 +3276,6 @@ dependencies = [ "getrandom 0.2.16", "http", "rand 0.8.6", - "reqwest 0.12.15", "serde", "serde_json", "serde_path_to_error", diff --git a/Cargo.toml b/Cargo.toml index 1550b4f6..eb4c8370 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,6 +121,7 @@ email_address.workspace = true fastrand.workspace = true futures-lite.workspace = true git-version.workspace = true +http.workspace = true http-body.workspace = true httpdate.workspace = true janus_messages.workspace = true @@ -166,7 +167,7 @@ validator = { workspace = true, features = ["derive"] } [dependencies.oauth2] workspace = true default-features = false -features = ["pkce-plain", "reqwest"] +features = ["pkce-plain"] [dependencies.sea-orm] workspace = true diff --git a/src/handler/oauth2.rs b/src/handler/oauth2.rs index 44aa6342..0c2450e6 100644 --- a/src/handler/oauth2.rs +++ b/src/handler/oauth2.rs @@ -4,14 +4,15 @@ use axum::{ http::{header, StatusCode}, response::{IntoResponse, Response}, }; +use http::{Request as HttpRequest, Response as HttpResponse}; use oauth2::{ basic::{BasicClient, BasicErrorResponseType}, - AuthUrl, AuthorizationCode, ClientId, ClientSecret, CsrfToken, EndpointNotSet, EndpointSet, - HttpClientError, PkceCodeChallenge, PkceCodeVerifier, RedirectUrl, RequestTokenError, Scope, - StandardErrorResponse, TokenResponse, TokenUrl, + AsyncHttpClient, AuthUrl, AuthorizationCode, ClientId, ClientSecret, CsrfToken, EndpointNotSet, + EndpointSet, HttpClientError, PkceCodeChallenge, PkceCodeVerifier, RedirectUrl, + RequestTokenError, Scope, StandardErrorResponse, TokenResponse, TokenUrl, }; use serde::Deserialize; -use std::sync::Arc; +use std::{future::Future, pin::Pin, sync::Arc}; use tower_sessions::Session; use url::Url; @@ -205,7 +206,7 @@ impl OauthClient { .exchange_code(auth_code) .set_pkce_verifier(pkce_verifier) .add_extra_param("audience", &self.0.oauth_config.audience) - .request_async(&self.0.reqwest_client) + .request_async(&*self.0) .await?; let userinfo_url = self.0.oauth_config.base_url.join("/userinfo")?; @@ -248,3 +249,29 @@ impl OauthClient { &self.0.oauth2_client } } + +impl<'c> AsyncHttpClient<'c> for OauthClientInner { + type Error = oauth2::HttpClientError; + + type Future = Pin< + Box>, Self::Error>> + Send + Sync + 'c>, + >; + + fn call(&'c self, request: HttpRequest>) -> Self::Future { + Box::pin(async move { + let response = self + .reqwest_client + .execute(request.try_into().map_err(Box::new)?) + .await + .map_err(Box::new)?; + let mut builder = Response::builder().status(response.status()); + builder = builder.version(response.version()); + for (name, value) in response.headers().iter() { + builder = builder.header(name, value); + } + builder + .body(response.bytes().await.map_err(Box::new)?.to_vec()) + .map_err(Into::into) + }) + } +} From 80700f2afa6c7187da048b1de31c5b131a4b716b Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 20 Oct 2026 08:38:01 -0500 Subject: [PATCH 2/2] Update to reqwest 0.13 --- Cargo.lock | 269 +++++++++++++++++++++++++++++++++------- Cargo.toml | 4 +- cli/Cargo.toml | 2 +- client/Cargo.toml | 2 +- test-support/Cargo.toml | 2 +- 5 files changed, 230 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c823f5e0..d998bf98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -966,7 +966,17 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.61.2", +] + +[[package]] +name = "combine" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" +dependencies = [ + "bytes", + "memchr", ] [[package]] @@ -1088,6 +1098,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1509,7 +1529,7 @@ dependencies = [ "rand 0.10.3", "rcgen", "regex", - "reqwest 0.12.15", + "reqwest 0.13.4", "rustc_version", "rustls", "rustls-webpki", @@ -1558,7 +1578,7 @@ dependencies = [ "num-bigint 0.4.8", "prio", "rand 0.10.3", - "reqwest 0.12.15", + "reqwest 0.13.4", "serde", "serde_json", "serde_yaml", @@ -1589,7 +1609,7 @@ dependencies = [ "num-rational", "pad-adapter", "prio", - "reqwest 0.12.15", + "reqwest 0.13.4", "serde", "serde_json", "test-support", @@ -2468,7 +2488,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.3", + "socket2", "tokio", "tower-service", "tracing", @@ -2811,6 +2831,55 @@ dependencies = [ "url", ] +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror 2.0.21", + "walkdir", + "windows-link 0.2.1", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.117", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.117", +] + [[package]] name = "jobserver" version = "0.1.32" @@ -3311,6 +3380,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + [[package]] name = "opentelemetry" version = "0.33.0" @@ -3859,34 +3934,38 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11" dependencies = [ "bytes", + "cfg_aliases 0.2.1", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 1.1.0", + "rustc-hash", "rustls", - "thiserror 1.0.69", + "socket2", + "thiserror 2.0.21", "tokio", "tracing", + "web-time", ] [[package]] name = "quinn-proto" -version = "0.11.16" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4bfc015262b9df63c8845072ce59068853ff5872180c2ce2f13038b970e560" +checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe" dependencies = [ + "aws-lc-rs", "bytes", "getrandom 0.4.3", "lru-slab", "rand 0.10.3", "rand_pcg", "ring", - "rustc-hash 2.1.1", + "rustc-hash", "rustls", "rustls-pki-types", "slab", @@ -3898,15 +3977,16 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016" dependencies = [ + "cfg_aliases 0.2.1", "libc", "once_cell", - "socket2 0.5.5", + "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -4135,13 +4215,21 @@ dependencies = [ "http-body", "http-body-util", "hyper", + "hyper-rustls", "hyper-util", "js-sys", "log", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", "sync_wrapper", "tokio", + "tokio-rustls", "tower", "tower-http 0.6.11", "tower-service", @@ -4222,12 +4310,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.1" @@ -4268,6 +4350,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "2.2.0" @@ -4287,6 +4381,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" + [[package]] name = "rustls-webpki" version = "0.103.16" @@ -4311,6 +4432,24 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -4526,6 +4665,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags 2.11.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.21" @@ -4710,6 +4872,16 @@ dependencies = [ "libc", ] +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + [[package]] name = "simdutf8" version = "0.1.4" @@ -4754,16 +4926,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "socket2" version = "0.6.3" @@ -5127,7 +5289,7 @@ dependencies = [ "pretty_assertions", "querystrong", "rand 0.10.3", - "reqwest 0.12.15", + "reqwest 0.13.4", "sea-orm", "serde", "serde_json", @@ -5272,7 +5434,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.3", + "socket2", "tokio-macros", "tracing", "windows-sys 0.61.2", @@ -5361,7 +5523,7 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "socket2 0.6.3", + "socket2", "sync_wrapper", "tokio", "tokio-stream", @@ -5857,6 +6019,16 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -5972,6 +6144,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-root-certs" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ec80e73fd8baf57bf0d9615554c75348bda990d6d5bbeab964dd068319fecb" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "0.26.11" @@ -6012,6 +6193,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -6068,15 +6258,6 @@ dependencies = [ "windows-link 0.1.3", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index eb4c8370..cc8a3ecb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ querystrong = "0.4.0" rand = "0.10.1" rcgen = "0.14.3" regex = "1.11.1" -reqwest = { version = "0.12", default-features = false } +reqwest = { version = "0.13", default-features = false } rustc_version = "0.4.1" rustls = { version = "0.23", default-features = false } rustls-webpki = "0.103.8" @@ -132,7 +132,7 @@ opentelemetry_sdk = { workspace = true, features = ["rt-tokio", "logs", "metrics prio.workspace = true querystrong.workspace = true rand.workspace = true -reqwest = { workspace = true, default-features = false, features = ["rustls-tls", "json"] } +reqwest = { workspace = true, default-features = false, features = ["rustls", "json"] } rustls = { workspace = true, default-features = false, features = ["aws_lc_rs"] } # This crate does not actually need to depend on rustls-webpki directly, but we need to make sure the feature "std" is enabled. See Janus issue #3744. rustls-webpki = { workspace = true, features = ["std"] } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 3d9453ae..d00441ea 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -33,7 +33,7 @@ janus_messages.workspace = true num-bigint-4.workspace = true prio.workspace = true rand = { workspace = true, optional = true } -reqwest = { workspace = true, default-features = false, features = ["rustls-tls"] } +reqwest = { workspace = true, default-features = false, features = ["rustls"] } serde.workspace = true serde_json.workspace = true serde_yaml.workspace = true diff --git a/client/Cargo.toml b/client/Cargo.toml index 999942d4..0259811c 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -22,7 +22,7 @@ num-bigint-5.workspace = true num-rational.workspace = true pad-adapter.workspace = true prio.workspace = true -reqwest = { workspace = true, default-features = false, features = ["json", "rustls-tls"] } +reqwest = { workspace = true, default-features = false, features = ["json", "rustls"] } serde = { workspace = true, features = ["derive"] } serde_json.workspace = true thiserror.workspace = true diff --git a/test-support/Cargo.toml b/test-support/Cargo.toml index 452ecc57..13f38098 100644 --- a/test-support/Cargo.toml +++ b/test-support/Cargo.toml @@ -16,7 +16,7 @@ http-body-util.workspace = true pretty_assertions.workspace = true querystrong.workspace = true rand.workspace = true -reqwest = { workspace = true, default-features = false, features = ["rustls-tls", "json"] } +reqwest = { workspace = true, default-features = false, features = ["rustls", "json"] } sea-orm = { workspace = true, features = ["sqlx-sqlite"] } serde.workspace = true serde_json.workspace = true