feat: classify audit evidence export scope

This commit is contained in:
2026-08-20 18:00:18 +02:00
parent 6a2da94e47
commit 604f20eed7
3 changed files with 20 additions and 0 deletions
@@ -37,6 +37,7 @@ LEGACY_TO_MODULE_SCOPES: dict[str, str] = {
"system:access:read": "access:system_role:read", "system:access:read": "access:system_role:read",
"system:access:assign": "access:system_role:assign", "system:access:assign": "access:system_role:assign",
"system:audit:read": "access:audit:read", "system:audit:read": "access:audit:read",
"system:audit:evidence:export": "audit:system_evidence:export",
"system:settings:read": "access:system_setting:read", "system:settings:read": "access:system_setting:read",
"system:settings:write": "access:system_setting:write", "system:settings:write": "access:system_setting:write",
"system:maintenance:access": "access:maintenance:access", "system:maintenance:access": "access:maintenance:access",
+18
View File
@@ -342,7 +342,25 @@ class ModuleSystemTests(unittest.TestCase):
self.assertTrue(scopes_grant_compatible(["admin:users:read"], "access:membership:read")) self.assertTrue(scopes_grant_compatible(["admin:users:read"], "access:membership:read"))
self.assertTrue(scopes_grant_compatible(["access:tenant:read"], "system:tenants:read")) self.assertTrue(scopes_grant_compatible(["access:tenant:read"], "system:tenants:read"))
self.assertTrue(scopes_grant_compatible(["system:*"], "access:tenant:read")) self.assertTrue(scopes_grant_compatible(["system:*"], "access:tenant:read"))
self.assertTrue(
scopes_grant_compatible(
["system:*"],
"audit:system_evidence:export",
)
)
self.assertTrue(
scopes_grant_compatible(
["system:audit:evidence:export"],
"audit:system_evidence:export",
)
)
self.assertFalse(scopes_grant_compatible(["tenant:*"], "system:tenants:read")) self.assertFalse(scopes_grant_compatible(["tenant:*"], "system:tenants:read"))
self.assertFalse(
scopes_grant_compatible(
["tenant:*"],
"audit:system_evidence:export",
)
)
self.assertFalse(scopes_grant_compatible(["tenant:*"], "access:tenant:read")) self.assertFalse(scopes_grant_compatible(["tenant:*"], "access:tenant:read"))
def test_core_webui_retired_legacy_admin_api_surface(self) -> None: def test_core_webui_retired_legacy_admin_api_surface(self) -> None:
+1
View File
@@ -32,6 +32,7 @@ const legacyToModuleScopes: Record<string, string> = {
"system:access:read": "access:system_role:read", "system:access:read": "access:system_role:read",
"system:access:assign": "access:system_role:assign", "system:access:assign": "access:system_role:assign",
"system:audit:read": "access:audit:read", "system:audit:read": "access:audit:read",
"system:audit:evidence:export": "audit:system_evidence:export",
"system:settings:read": "access:system_setting:read", "system:settings:read": "access:system_setting:read",
"system:settings:write": "access:system_setting:write", "system:settings:write": "access:system_setting:write",
"system:maintenance:access": "access:maintenance:access", "system:maintenance:access": "access:maintenance:access",