mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
fix: correct secret reference validation check to permit referencing the same secret multiple times and improve error message
This commit is contained in:
@@ -150,9 +150,9 @@ export const secretV2BridgeServiceFactory = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (referredSecrets.length !== references.length)
|
if (new Set(referredSecrets.map((sec) => sec.key)).size !== new Set(references.map((sec) => sec.secretKey)).size)
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: `Referenced secret not found. Found only ${diff(
|
message: `Referenced secret(s) not found: ${diff(
|
||||||
references.map((el) => el.secretKey),
|
references.map((el) => el.secretKey),
|
||||||
referredSecrets.map((el) => el.key)
|
referredSecrets.map((el) => el.key)
|
||||||
).join(",")}`
|
).join(",")}`
|
||||||
|
|||||||
Reference in New Issue
Block a user