From 3436ad3b441f3f752281455c78074b0501eaeab8 Mon Sep 17 00:00:00 2001 From: overtrue Date: Mon, 7 Sep 2026 02:22:53 +0800 Subject: [PATCH] test(ilm): fix source-introspection markers broken by function reordering Commit 086ee8e48 moved authorize_recovery_admin_request before authorize_transition_admin_request and moved TransitionReconcileInspectHandler after IlmRecoveryControlListHandler. Commit 37ead2f69 attempted to update the source-introspection tests but chose incorrect markers: 1. transition_admin_gate_routes_through_the_shared_gate: end marker authorize_recovery_admin_request now precedes start marker authorize_transition_admin_request. Use fn transition_transaction_id_from_params which correctly follows the transition function. 2. transition_reconcile_routes_use_read_and_write_tier_actions: end marker IlmRecoveryControlListHandler precedes TransitionReconcileInspectHandler, capturing everything including TransitionReconcileApplyHandler. Use pub struct TransitionReconcileApplyHandler which is the correct boundary. 3. recovery_actor_binding_uses_the_authenticated_presented_access_key: end marker fn transition_transaction_id_from_params spans both authorize functions, leaking MaskedAccessKey from the transition wrapper. Use async fn authorize_transition_admin_request to isolate the recovery function. --- rustfs/src/admin/handlers/ilm_transition.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rustfs/src/admin/handlers/ilm_transition.rs b/rustfs/src/admin/handlers/ilm_transition.rs index a478a5778..69ccf1631 100644 --- a/rustfs/src/admin/handlers/ilm_transition.rs +++ b/rustfs/src/admin/handlers/ilm_transition.rs @@ -1939,7 +1939,7 @@ mod tests { let gate = extract_block_between_markers( production, "async fn authorize_recovery_admin_request", - "fn transition_transaction_id_from_params", + "async fn authorize_transition_admin_request", ); assert!(gate.contains("let credentials = authorize_admin_request(")); assert!(gate.contains("recovery_actor_sha256(&credentials)")); @@ -2153,7 +2153,7 @@ mod tests { let inspect = src .split("impl Operation for TransitionReconcileInspectHandler") .nth(1) - .and_then(|block| block.split("pub struct IlmRecoveryControlListHandler").next()) + .and_then(|block| block.split("pub struct TransitionReconcileApplyHandler").next()) .expect("inspect handler block"); assert!(inspect.contains("AdminAction::ListTierAction")); assert!(!inspect.contains("AdminAction::SetTierAction")); @@ -2502,7 +2502,7 @@ mod tests { let wrapper = extract_block_between_markers( production, "async fn authorize_transition_admin_request", - "async fn authorize_recovery_admin_request", + "fn transition_transaction_id_from_params", ); assert_eq!(