Skip to content

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

chore(pki): say certificate sync in user-facing messages

bernie-gfa4e85989e8c
diff --git a/backend/src/services/pki-sync/pki-sync-fns.test.ts b/backend/src/services/pki-sync/pki-sync-fns.test.ts
index 54dd162da1..29b95cc65c 100644
--- a/backend/src/services/pki-sync/pki-sync-fns.test.ts
+++ b/backend/src/services/pki-sync/pki-sync-fns.test.ts
@@ -155,7 +155,9 @@ describe("parsePkiSyncErrorMessage", () => {
});
test("falls back to a readable message for a non-error throw", () => {
- expect(parsePkiSyncErrorMessage({ weird: true })).toBe("An unknown error occurred during PKI sync operation");
+ expect(parsePkiSyncErrorMessage({ weird: true })).toBe(
+ "An unknown error occurred during certificate sync operation"
+ );
});
});
diff --git a/backend/src/services/pki-sync/pki-sync-fns.ts b/backend/src/services/pki-sync/pki-sync-fns.ts
index 110711f330..b5cdee83e1 100644
--- a/backend/src/services/pki-sync/pki-sync-fns.ts
+++ b/backend/src/services/pki-sync/pki-sync-fns.ts
@@ -116,7 +116,9 @@ export const assertPkiSyncLicense = async (
if (!plan.pkiSyncs) {
throw new BadRequestError({
- message: errorMessage || "Failed to create PKI sync due to plan restriction. Upgrade plan to create PKI sync."
+ message:
+ errorMessage ||
+ "Failed to create certificate sync due to plan restriction. Upgrade plan to create certificate sync."
});
}
};
@@ -160,7 +162,7 @@ export const getPkiSyncUnlinkAssertion = (destination: PkiSync) => PKI_SYNC_UNLI
export const getPkiSyncProviderCapabilities = (destination: PkiSync) => {
const providerOption = PKI_SYNC_LIST_OPTIONS[destination];
if (!providerOption) {
- throw new BadRequestError({ message: `Unsupported PKI sync destination: ${destination}` });
+ throw new BadRequestError({ message: `Unsupported certificate sync destination: ${destination}` });
}
return {
@@ -212,7 +214,7 @@ export const parsePkiSyncErrorMessage = (error: unknown): string => {
return truncateSyncMessage(error);
}
- return "An unknown error occurred during PKI sync operation";
+ return "An unknown error occurred during certificate sync operation";
};
export const matchesCertificateNameSchema = (name: string, schema?: string): boolean => {
@@ -229,7 +231,7 @@ export const matchesCertificateNameSchema = (name: string, schema?: string): boo
const checkPkiSyncDestination = (pkiSync: TPkiSyncWithCredentials, destination: PkiSync): void => {
if (pkiSync.destination !== destination) {
- throw new Error(`Invalid PKI sync destination: ${pkiSync.destination}`);
+ throw new Error(`Invalid certificate sync destination: ${pkiSync.destination}`);
}
};
@@ -312,7 +314,7 @@ export const PkiSyncFns = {
);
}
default:
- throw new Error(`Unsupported PKI sync destination: ${String(pkiSync.destination)}`);
+ throw new Error(`Unsupported certificate sync destination: ${String(pkiSync.destination)}`);
}
},
@@ -480,7 +482,7 @@ export const PkiSyncFns = {
return gcpCertificateManagerPkiSync.syncCertificates(pkiSync, certificateMap);
}
default:
- throw new Error(`Unsupported PKI sync destination: ${String(pkiSync.destination)}`);
+ throw new Error(`Unsupported certificate sync destination: ${String(pkiSync.destination)}`);
}
},
@@ -794,7 +796,7 @@ export const PkiSyncFns = {
break;
}
default:
- throw new Error(`Unsupported PKI sync destination: ${String(pkiSync.destination)}`);
+ throw new Error(`Unsupported certificate sync destination: ${String(pkiSync.destination)}`);
}
}
};
@@ -813,7 +815,7 @@ const getPkiSyncCertificateCaps = (
caps.push({
cap: destinationMax,
reason: () =>
- `${PKI_SYNC_NAME_MAP[destination]} PKI sync supports at most ${destinationMax} certificate${
+ `${PKI_SYNC_NAME_MAP[destination]} certificate sync supports at most ${destinationMax} certificate${
destinationMax === 1 ? "" : "s"
}`
});
@@ -823,7 +825,7 @@ const getPkiSyncCertificateCaps = (
caps.push({
cap: 1,
reason: () =>
- "This PKI sync's certificate name schema has no placeholder, so it holds only one certificate. Add {{certificateId}} or {{commonName}} to hold more."
+ "This certificate sync's certificate name schema has no placeholder, so it holds only one certificate. Add {{certificateId}} or {{commonName}} to hold more."
});
}
@@ -911,7 +913,7 @@ export const assertFiltersCannotExceedCertificateCap = (
if (growableKinds.length > 0) {
throw new BadRequestError({
- message: `This PKI sync holds at most ${noun}, so it only accepts a certificate order filter. Remove the ${growableKinds
+ message: `This certificate sync holds at most ${noun}, so it only accepts a certificate order filter. Remove the ${growableKinds
.map((kind) => PKI_SYNC_FILTER_LABELS[kind])
.join(" and ")} filter.`
});
@@ -920,7 +922,7 @@ export const assertFiltersCannotExceedCertificateCap = (
const orders = filters?.certificateOrderIds ?? [];
if (orders.length > cap) {
throw new BadRequestError({
- message: `This PKI sync holds at most ${noun}, so its filter can name at most ${cap} certificate order${
+ message: `This certificate sync holds at most ${noun}, so its filter can name at most ${cap} certificate order${
cap === 1 ? "" : "s"
}. It names ${orders.length}.`
});