Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

cleanup

Daniel6075cd0feb91
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.ts
index ac59324433..2eb1f64046 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
@@ -94,7 +94,9 @@ export const generatePasswordWithConstraints = (constraints: TConstraint[]): str
const targetMinFill = Math.max(0, minLength - fixedLength);
const targetMaxFill = maxLength - fixedLength;
const fillLength =
- targetMaxFill === targetMinFill ? targetMinFill : targetMinFill + randomInt(0, targetMaxFill - targetMinFill + 1);
+ targetMaxFill === targetMinFill
+ ? targetMinFill
+ : targetMinFill + crypto.randomInt(0, targetMaxFill - targetMinFill + 1);
middle = generateRandomString(fillLength);
}
diff --git a/frontend/src/components/secret-validation/ValidationRuleOverrideNotice.tsx b/frontend/src/components/secret-validation/ValidationRuleOverrideNotice.tsx
index 236e6a0a87..9c4a029259 100644
--- a/frontend/src/components/secret-validation/ValidationRuleOverrideNotice.tsx
+++ b/frontend/src/components/secret-validation/ValidationRuleOverrideNotice.tsx
@@ -1,5 +1,6 @@
-import { InfoIcon } from "lucide-react";
+import { TriangleAlertIcon } from "lucide-react";
+import { Alert, AlertDescription, AlertTitle } from "@app/components/v3";
import {
DynamicSecretRuleProvider,
SecretRotationRuleProvider,
@@ -15,8 +16,8 @@ type Props = {
};
/**
- * Renders a low-key info banner when at least one active secret-validation
- * rule covers the given generated-credential scope. Surfaces that the
+ * Renders a warning alert when at least one active secret-validation rule
+ * covers the given generated-credential scope. Surfaces that the
* user-configured password requirements will be ignored in favor of the
* rule's constraints.
*/
@@ -31,13 +32,15 @@ export const ValidationRuleOverrideNotice = ({
const ruleLabel =
matching.length === 1 ? `rule "${matching[0].name}"` : `${matching.length} rules`;
+
return (
- <div className="mb-3 flex items-start gap-2 rounded-md border border-mineshaft-600 bg-mineshaft-800 px-3 py-2 text-xs text-mineshaft-200">
- <InfoIcon className="mt-0.5 size-4 shrink-0 text-mineshaft-400" />
- <span>
+ <Alert variant="warning" className="mb-3">
+ <TriangleAlertIcon />
+ <AlertTitle>Password configuration overridden by validation rule</AlertTitle>
+ <AlertDescription>
A secret validation {ruleLabel} applies to this scope. The password configuration below will
- be ignored in favor of the rule&apos;s constraints.
- </span>
- </div>
+ be ignored. Generated passwords are produced from the rule&apos;s constraints instead.
+ </AlertDescription>
+ </Alert>
);
};