refactor: narrow test harness compatibility surfaces (#3592)

This commit is contained in:
安正超
2026-06-19 07:10:52 +08:00
committed by GitHub
parent b14e49e84e
commit b1c6578df1
27 changed files with 384 additions and 105 deletions
+7 -6
View File
@@ -412,10 +412,6 @@ pub enum AdminAction {
TraceAdminAction,
#[strum(serialize = "admin:ConsoleLog")]
ConsoleLogAdminAction,
#[strum(serialize = "admin:KMSCreateKey")]
KMSCreateKeyAdminAction,
#[strum(serialize = "admin:KMSKeyStatus")]
KMSKeyStatusAdminAction,
#[strum(serialize = "admin:ServerInfo")]
ServerInfoAdminAction,
#[strum(serialize = "admin:OBDInfo")]
@@ -614,8 +610,6 @@ impl AdminAction {
| AdminAction::ProfilingAdminAction
| AdminAction::TraceAdminAction
| AdminAction::ConsoleLogAdminAction
| AdminAction::KMSCreateKeyAdminAction
| AdminAction::KMSKeyStatusAdminAction
| AdminAction::ServerInfoAdminAction
| AdminAction::HealthInfoAdminAction
| AdminAction::LicenseInfoAdminAction
@@ -768,6 +762,13 @@ mod tests {
}
}
#[test]
fn test_legacy_kms_admin_actions_are_rejected() {
for raw in ["admin:KMSCreateKey", "admin:KMSKeyStatus"] {
assert!(Action::try_from(raw).is_err(), "{raw} should not parse as a policy action");
}
}
#[test]
fn test_kms_wildcard_matches_dedicated_actions() {
let wildcard = Action::try_from("kms:*").expect("Should parse KMS wildcard action");