mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
improvements: update regex checks
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import RE2 from "re2";
|
||||
import { z } from "zod";
|
||||
|
||||
import { SecretRotations } from "@app/lib/api-docs";
|
||||
@@ -29,6 +30,7 @@ export const PasswordRequirementsSchema = z
|
||||
}),
|
||||
allowedSymbols: z
|
||||
.string()
|
||||
.regex(new RE2("[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~]"), "Invalid symbols")
|
||||
.optional()
|
||||
.describe(SecretRotations.PARAMETERS.GENERAL.PASSWORD_REQUIREMENTS.allowedSymbols)
|
||||
})
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import RE2 from "re2";
|
||||
import { z } from "zod";
|
||||
|
||||
import { AppConnections } from "@app/lib/api-docs";
|
||||
@@ -16,7 +17,7 @@ export const LdapConnectionSimpleBindCredentialsSchema = z.object({
|
||||
.string()
|
||||
.trim()
|
||||
.min(1, "URL required")
|
||||
.refine((value) => value.startsWith("ldap://") || value.startsWith("ldaps://"))
|
||||
.regex(new RE2(/^ldaps?:\/\//))
|
||||
.describe(AppConnections.CREDENTIALS.LDAP.url),
|
||||
dn: z.string().trim().min(1, "Distinguished Name (DN) required").describe(AppConnections.CREDENTIALS.LDAP.dn),
|
||||
password: z.string().trim().min(1, "Password required").describe(AppConnections.CREDENTIALS.LDAP.password),
|
||||
|
||||
@@ -14,6 +14,7 @@ export const PasswordRequirementsSchema = z
|
||||
}),
|
||||
allowedSymbols: z
|
||||
.string()
|
||||
.regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~]/, "Invalid symbols")
|
||||
.optional()
|
||||
.transform((value) => value || "-_.~!*")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user