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
Add missing refine checks to avoid setting skipEabBinding and skipDnsOwnershipVerification at the same time
Carlos Monastyrski6d64b67f85c3
diff --git a/backend/src/server/routes/v1/certificate-profiles-router.ts b/backend/src/server/routes/v1/certificate-profiles-router.tsindex 440497c0b2..da0385c5f6 100644--- a/backend/src/server/routes/v1/certificate-profiles-router.ts+++ b/backend/src/server/routes/v1/certificate-profiles-router.ts@@ -493,6 +493,17 @@ export const registerCertificateProfilesRouter = async ({message: "Cannot have EST config with API enrollment type or API config with EST enrollment type."}+ )+ .refine(+ (data) => {+ if (data.acmeConfig) {+ return !(data.acmeConfig.skipEabBinding && data.acmeConfig.skipDnsOwnershipVerification);+ }+ return true;+ },+ {+ message: "Cannot skip both External Account Binding (EAB) and DNS ownership verification at the same time."+ }),response: {200: z.object({diff --git a/backend/src/services/certificate-profile/certificate-profile-schemas.ts b/backend/src/services/certificate-profile/certificate-profile-schemas.tsindex 48a990943b..49e0412f76 100644--- a/backend/src/services/certificate-profile/certificate-profile-schemas.ts+++ b/backend/src/services/certificate-profile/certificate-profile-schemas.ts@@ -103,6 +103,18 @@ export const createCertificateProfileSchema = zmessage: "ACME enrollment type cannot have EST or API configuration"})+ .refine(+ (data) => {+ if (data.enrollmentType === EnrollmentType.ACME && data.acmeConfig) {+ return !(data.acmeConfig.skipEabBinding && data.acmeConfig.skipDnsOwnershipVerification);+ }+ return true;+ },+ {+ message:+ "Cannot skip both External Account Binding (EAB) and DNS ownership verification at the same time for security reasons"+ }+ ).refine((data) => {if (data.issuerType === IssuerType.CA) {@@ -190,6 +202,18 @@ export const updateCertificateProfileSchema = zmessage: "API enrollment type cannot have EST configuration"})+ .refine(+ (data) => {+ if (data.acmeConfig) {+ return !(data.acmeConfig.skipEabBinding && data.acmeConfig.skipDnsOwnershipVerification);+ }+ return true;+ },+ {+ message:+ "Cannot skip both External Account Binding (EAB) and DNS ownership verification at the same time for security reasons"+ }+ ).refine((data) => {if (data.issuerType === IssuerType.SELF_SIGNED) {