Skip to content

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

better ui and add password validation context to missing place

Matheus Nogueira1d12159198e5
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
index a3da0b630c..bd49789727 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
@@ -2029,6 +2029,13 @@ export const secretRotationV2ServiceFactory = ({
] as TLocalAccountRotationGeneratedCredentials[number];
const appConnection = await decryptAppConnection(connection, kmsService);
+ const passwordValidationContext = await $resolvePasswordValidationContext({
+ projectId,
+ envId: environment.id,
+ secretPath: folder.path,
+ type
+ });
+
// Use the rotation factory to perform a rotation using the app connection credentials
const rotationFactory = SECRET_ROTATION_FACTORY_MAP[type](
{
@@ -2044,7 +2051,8 @@ export const secretRotationV2ServiceFactory = ({
kmsService,
gatewayService,
gatewayV2Service,
- gatewayPoolService
+ gatewayPoolService,
+ passwordValidationContext
);
// Issue new credentials using login-as-root mode (app connection credentials)
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
index c9479642ef..7c964dcef6 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
@@ -263,70 +263,70 @@ const RuleFormContent = ({
</div>
</div>
- {/* Enforcement Type + Providers */}
- <div className="grid grid-cols-2 gap-4">
- <div className="flex flex-col gap-1">
- <label className="text-xs font-medium text-muted">Rule Type</label>
- <Controller
- control={control}
- name="enforcement.type"
- render={({ field: { value, onChange } }) => (
- <Select
- value={value}
- onValueChange={(next) => {
- onChange(next);
- replace([]);
- if (next !== RuleType.StaticSecrets) {
- form.setValue("enforcement.inputs.providers" as never, [] as never, {
- shouldDirty: true,
- shouldValidate: false
- });
- }
- }}
- >
- <SelectTrigger>
- <SelectValue />
- </SelectTrigger>
- <SelectContent position="popper">
- {(Object.values(RuleType) as RuleType[]).map((t) => (
- <SelectItem key={t} value={t}>
- {RULE_TYPE_LABELS[t]}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- )}
- />
- </div>
- {watchedRuleType === RuleType.DynamicSecrets && (
- <ProviderMultiSelect<DynamicSecretRuleProvider>
- label="Dynamic Secret Providers"
- options={DYNAMIC_SECRET_PROVIDER_OPTIONS}
- control={control}
- error={
- // discriminated form types: providers only exists on this arm
- (errors.enforcement?.inputs as { providers?: { message?: string } } | undefined)
- ?.providers?.message
- }
- />
- )}
- {watchedRuleType === RuleType.SecretRotations && (
- <ProviderMultiSelect<SecretRotationRuleProvider>
- label="Rotation Providers"
- options={SECRET_ROTATION_PROVIDER_OPTIONS}
- control={control}
- error={
- (errors.enforcement?.inputs as { providers?: { message?: string } } | undefined)
- ?.providers?.message
- }
- />
- )}
+ {/* Rule Type */}
+ <div className="flex flex-col gap-1">
+ <label className="text-xs font-medium text-muted">Rule Type</label>
+ <Controller
+ control={control}
+ name="enforcement.type"
+ render={({ field: { value, onChange } }) => (
+ <Select
+ value={value}
+ onValueChange={(next) => {
+ onChange(next);
+ replace([]);
+ if (next !== RuleType.StaticSecrets) {
+ form.setValue("enforcement.inputs.providers" as never, [] as never, {
+ shouldDirty: true,
+ shouldValidate: false
+ });
+ }
+ }}
+ >
+ <SelectTrigger className="w-full">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent position="popper">
+ {(Object.values(RuleType) as RuleType[]).map((t) => (
+ <SelectItem key={t} value={t}>
+ {RULE_TYPE_LABELS[t]}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ )}
+ />
</div>
+ {/* Providers */}
+ {watchedRuleType === RuleType.DynamicSecrets && (
+ <ProviderMultiSelect<DynamicSecretRuleProvider>
+ label="Dynamic Secret Providers"
+ options={DYNAMIC_SECRET_PROVIDER_OPTIONS}
+ control={control}
+ error={
+ // discriminated form types: providers only exists on this arm
+ (errors.enforcement?.inputs as { providers?: { message?: string } } | undefined)
+ ?.providers?.message
+ }
+ />
+ )}
+ {watchedRuleType === RuleType.SecretRotations && (
+ <ProviderMultiSelect<SecretRotationRuleProvider>
+ label="Rotation Providers"
+ options={SECRET_ROTATION_PROVIDER_OPTIONS}
+ control={control}
+ error={
+ (errors.enforcement?.inputs as { providers?: { message?: string } } | undefined)
+ ?.providers?.message
+ }
+ />
+ )}
+
{/* Scope */}
<div>
<h4 className="mb-3 text-sm font-medium text-foreground">Scope</h4>
- <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-4">
<div className="flex flex-col gap-1">
<label className="text-xs font-medium text-muted">Environment</label>
<Controller