feat: added validation for secret path in permission

This commit is contained in:
=
2025-01-29 17:01:45 +05:30
parent 2a84d61862
commit a6145120e6
3 changed files with 36 additions and 24 deletions
@@ -80,6 +80,10 @@ const ConditionSchema = z
return true;
},
{ message: "Duplicate operator found for a condition" }
)
.refine(
(val) => val.filter((el) => el.lhs === "secretPath").every((el) => el.rhs.startsWith("/")),
{ message: "Invalid Secret Path. Must start with '/'" }
);
export const projectRoleFormSchema = z.object({