mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 15:26:35 +00:00
feat: removed secret path check in glob
This commit is contained in:
@@ -180,10 +180,7 @@ const SECRET_PATH_PERMISSION_OPERATOR_SCHEMA = z.union([
|
|||||||
(val) => val.every((el) => el.startsWith("/")),
|
(val) => val.every((el) => el.startsWith("/")),
|
||||||
SECRET_PATH_MISSING_SLASH_ERR_MSG
|
SECRET_PATH_MISSING_SLASH_ERR_MSG
|
||||||
),
|
),
|
||||||
[PermissionConditionOperators.$GLOB]: PermissionConditionSchema[PermissionConditionOperators.$GLOB].refine(
|
[PermissionConditionOperators.$GLOB]: PermissionConditionSchema[PermissionConditionOperators.$GLOB]
|
||||||
(val) => val.startsWith("/"),
|
|
||||||
SECRET_PATH_MISSING_SLASH_ERR_MSG
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
.partial()
|
.partial()
|
||||||
]);
|
]);
|
||||||
|
|||||||
+3
-1
@@ -84,7 +84,9 @@ const ConditionSchema = z
|
|||||||
.refine(
|
.refine(
|
||||||
(val) =>
|
(val) =>
|
||||||
val
|
val
|
||||||
.filter((el) => el.lhs === "secretPath")
|
.filter(
|
||||||
|
(el) => el.lhs === "secretPath" && el.operator !== PermissionConditionOperators.$GLOB
|
||||||
|
)
|
||||||
.every((el) =>
|
.every((el) =>
|
||||||
el.operator === PermissionConditionOperators.$IN
|
el.operator === PermissionConditionOperators.$IN
|
||||||
? el.rhs.split(",").every((i) => i.trim().startsWith("/"))
|
? el.rhs.split(",").every((i) => i.trim().startsWith("/"))
|
||||||
|
|||||||
Reference in New Issue
Block a user