Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Update secret-validation-rule-password-generator.ts
Daniela3f5888f1e3e
diff --git a/backend/src/services/secret-validation-rule/secret-validation-rule-password-generator.ts b/backend/src/services/secret-validation-rule/secret-validation-rule-password-generator.tsindex 465b30b2ee..ac59324433 100644--- a/backend/src/services/secret-validation-rule/secret-validation-rule-password-generator.ts+++ b/backend/src/services/secret-validation-rule/secret-validation-rule-password-generator.ts@@ -1,7 +1,7 @@-import { randomInt } from "crypto";import RandExp from "randexp";import RE2 from "re2";+import { crypto } from "@app/lib/crypto";import { BadRequestError } from "@app/lib/errors";import { ConstraintTarget, ConstraintType, TConstraint } from "./secret-validation-rule-types";@@ -14,7 +14,7 @@ const CHAR_POOL = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678const generateRandomString = (length: number): string => {let out = "";for (let i = 0; i < length; i += 1) {- out += CHAR_POOL[randomInt(0, CHAR_POOL.length)];+ out += CHAR_POOL[crypto.randomInt(0, CHAR_POOL.length)];}return out;};