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
Address Veria comment
Carlos Monastyrskib0200724ebef
diff --git a/backend/src/services/pki-sync/kemp-loadmaster/kemp-loadmaster-pki-sync-schemas.test.ts b/backend/src/services/pki-sync/kemp-loadmaster/kemp-loadmaster-pki-sync-schemas.test.tsindex a50edb854a..77c9020aa8 100644--- a/backend/src/services/pki-sync/kemp-loadmaster/kemp-loadmaster-pki-sync-schemas.test.ts+++ b/backend/src/services/pki-sync/kemp-loadmaster/kemp-loadmaster-pki-sync-schemas.test.ts@@ -10,22 +10,27 @@ describe("Kemp LoadMaster certificateNameSchema validation", () => {const accepts = (certificateNameSchema: string) =>KempLoadMasterPkiSyncOptionsSchema.safeParse({ certificateNameSchema }).success;- test("accepts the supported placeholders", () => {+ test("accepts schemas containing a per-certificate placeholder", () => {expect(accepts("Infisical-{{certificateId}}")).toBe(true);expect(accepts("{{commonName}}-{{certificateId}}")).toBe(true);expect(accepts("{{shortCertificateId}}")).toBe(true);- expect(accepts("static-name")).toBe(true);+ });++ test("requires {{certificateId}} or {{shortCertificateId}} so each certificate is unique", () => {+ expect(accepts("static-name")).toBe(false);+ expect(accepts("Infisical-{{commonName}}")).toBe(false);+ expect(accepts("{{profileId}}-{{applicationId}}")).toBe(false);});test("rejects characters the LoadMaster forbids", () => {expect(accepts("*-{{certificateId}}")).toBe(false);- expect(accepts("cert with space")).toBe(false);- expect(accepts("cert/slash")).toBe(false);+ expect(accepts("{{certificateId}} with space")).toBe(false);+ expect(accepts("{{certificateId}}/slash")).toBe(false);});test("rejects identifiers longer than 251 characters", () => {- expect(accepts("a".repeat(251))).toBe(true);- expect(accepts("a".repeat(252))).toBe(false);+ expect(accepts(`${"a".repeat(219)}{{certificateId}}`)).toBe(true); // 219 + 32 = 251+ expect(accepts(`${"a".repeat(220)}{{certificateId}}`)).toBe(false); // 220 + 32 = 252});});diff --git a/backend/src/services/pki-sync/kemp-loadmaster/kemp-loadmaster-pki-sync-schemas.ts b/backend/src/services/pki-sync/kemp-loadmaster/kemp-loadmaster-pki-sync-schemas.tsindex cad399c99c..adfa353412 100644--- a/backend/src/services/pki-sync/kemp-loadmaster/kemp-loadmaster-pki-sync-schemas.ts+++ b/backend/src/services/pki-sync/kemp-loadmaster/kemp-loadmaster-pki-sync-schemas.ts@@ -58,11 +58,14 @@ export const KempLoadMasterPkiSyncOptionsSchema = z.object({testName.includes(char));- return KEMP_LOADMASTER_NAMING.NAME_PATTERN.test(testName) && !hasForbiddenChars;+ const hasCertificateIdentifier =+ schema.includes("{{certificateId}}") || schema.includes("{{shortCertificateId}}");++ return hasCertificateIdentifier && KEMP_LOADMASTER_NAMING.NAME_PATTERN.test(testName) && !hasForbiddenChars;},{message:- "Certificate name schema must result in names that contain only alphanumeric characters, hyphens (-), underscores (_), and periods (.) and be 1-251 characters long for Kemp LoadMaster. Available placeholders: {{certificateId}}, {{shortCertificateId}}, {{profileId}}, {{applicationId}}, {{applicationName}}, {{commonName}}. A schema with no placeholder can be linked to only one certificate."+ "Certificate name schema must include the {{certificateId}} or {{shortCertificateId}} placeholder so each certificate gets a unique identifier, contain only alphanumeric characters, hyphens (-), underscores (_), and periods (.), and be 1-251 characters long for Kemp LoadMaster. It can also include {{profileId}}, {{applicationId}}, {{applicationName}}, and {{commonName}} placeholders."})});