From d97adb043e7fa6ed444ee6d8159c0a5b0836c600 Mon Sep 17 00:00:00 2001 From: Sheen Capadngan Date: Thu, 23 Oct 2025 03:14:08 +0800 Subject: [PATCH] misc: added proper handling of common non-kv paths --- .../components/VaultPolicyAnalyzer.utils.ts | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/VaultPolicyAnalyzer.utils.ts b/frontend/src/pages/project/RoleDetailsBySlugPage/components/VaultPolicyAnalyzer.utils.ts index 9a37e2311..fd46d860e 100644 --- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/VaultPolicyAnalyzer.utils.ts +++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/VaultPolicyAnalyzer.utils.ts @@ -56,13 +56,35 @@ const canTranslateBlock = ( return { canTranslate: true }; } + // Check for common non-KV system paths + if (path.startsWith("auth/")) { + return { + canTranslate: false, + reason: "Authentication paths (auth/*) cannot be translated" + }; + } + + if (path.startsWith("sys/")) { + return { + canTranslate: false, + reason: "System paths (sys/*) cannot be translated" + }; + } + + if (path.startsWith("identity/")) { + return { + canTranslate: false, + reason: "Identity paths (identity/*) cannot be translated" + }; + } + const sortedMounts = [...mounts].sort((a, b) => b.path.length - a.path.length); const mount = sortedMounts.find((m) => path.startsWith(m.path)); if (!mount) { return { canTranslate: false, - reason: "KV mount path not found in your Vault configuration" + reason: "Mount path not found (only KV secret engines are supported)" }; }