mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-06 20:19:14 +00:00
test(ilm): fix source-introspection markers broken by function reordering
Commit086ee8e48moved authorize_recovery_admin_request before authorize_transition_admin_request and moved TransitionReconcileInspectHandler after IlmRecoveryControlListHandler. Commit37ead2f69attempted 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.
This commit is contained in:
@@ -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!(
|
||||
|
||||
Reference in New Issue
Block a user