From 41ba17dd2554613be979b0371ac9d1f5c06c3b72 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 2 Nov 2025 18:47:18 +0000 Subject: [PATCH 1/3] Update Rust crate axum-extra to v0.12.1 --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- crates/crates_io_session/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0cd7896a7b9..5288b0afb6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -782,15 +782,16 @@ dependencies = [ [[package]] name = "axum-extra" -version = "0.10.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9963ff19f40c6102c76756ef0a46004c0d58957d87259fc9208ff8441c12ab96" +checksum = "5136e6c5e7e7978fe23e9876fb924af2c0f84c72127ac6ac17e7c46f457d362c" dependencies = [ "axum", "axum-core", "bytes", "cookie", "form_urlencoded", + "futures-core", "futures-util", "headers", "http 1.3.1", @@ -798,7 +799,6 @@ dependencies = [ "http-body-util", "mime", "pin-project-lite", - "rustversion", "serde_core", "serde_html_form", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index a7f0fa47b42..cce1ab6f5b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,7 @@ aws-credential-types = { version = "=1.2.8", features = ["hardcoded-credentials" aws-sdk-cloudfront = "=1.100.0" aws-sdk-sqs = "=1.88.0" axum = { version = "=0.8.6", features = ["macros", "matched-path"] } -axum-extra = { version = "=0.10.3", features = ["erased-json", "query", "typed-header"] } +axum-extra = { version = "=0.12.1", features = ["erased-json", "query", "typed-header"] } base64 = "=0.22.1" bigdecimal = { version = "=0.4.9", features = ["serde"] } bon = "=3.8.1" diff --git a/crates/crates_io_session/Cargo.toml b/crates/crates_io_session/Cargo.toml index 058b22b3801..9a5ea8b487f 100644 --- a/crates/crates_io_session/Cargo.toml +++ b/crates/crates_io_session/Cargo.toml @@ -9,7 +9,7 @@ workspace = true [dependencies] axum = { version = "=0.8.6", features = ["macros"] } -axum-extra = { version = "=0.10.3", features = ["cookie-signed"] } +axum-extra = { version = "=0.12.1", features = ["cookie-signed"] } base64 = "=0.22.1" cookie = { version = "=0.18.1", features = ["secure"] } parking_lot = "=0.12.5" From 63bc9e25944360404ccb95824fe7db7568ddf1fd Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Mon, 3 Nov 2025 13:24:27 +0100 Subject: [PATCH 2/3] axum-extra: Enable `middleware` feature --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index cce1ab6f5b7..310fbf6b7eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,7 @@ aws-credential-types = { version = "=1.2.8", features = ["hardcoded-credentials" aws-sdk-cloudfront = "=1.100.0" aws-sdk-sqs = "=1.88.0" axum = { version = "=0.8.6", features = ["macros", "matched-path"] } -axum-extra = { version = "=0.12.1", features = ["erased-json", "query", "typed-header"] } +axum-extra = { version = "=0.12.1", features = ["erased-json", "middleware", "query", "typed-header"] } base64 = "=0.22.1" bigdecimal = { version = "=0.4.9", features = ["serde"] } bon = "=3.8.1" From 9b6c649d4c1a9c10a1544c74a199732d09c8f277 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Mon, 3 Nov 2025 13:26:24 +0100 Subject: [PATCH 3/3] axum-extra: Adjust to new `option_layer()` type signature --- src/middleware.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/middleware.rs b/src/middleware.rs index 07d63534bdd..594e36c8639 100644 --- a/src/middleware.rs +++ b/src/middleware.rs @@ -13,7 +13,7 @@ mod update_metrics; use ::sentry::integrations::tower as sentry_tower; use axum::Router; -use axum::middleware::{from_fn, from_fn_with_state}; +use axum::middleware::{ResponseAxumBodyLayer, from_fn, from_fn_with_state}; use axum_extra::either::Either; use axum_extra::middleware::option_layer; use std::time::Duration; @@ -90,6 +90,9 @@ pub fn apply_axum_middleware(state: AppState, router: Router<()>) -> Router { .layer(CompressionLayer::new().quality(CompressionLevel::Fastest)) } -pub fn conditional_layer L>(condition: bool, layer: F) -> Either { +pub fn conditional_layer L>( + condition: bool, + layer: F, +) -> Either<(ResponseAxumBodyLayer, L), Identity> { option_layer(condition.then(layer)) }