Skip to content

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

feat(pki-sync): expose certificate sync external identifier in API and UI

bernie-g721d3e8f97c3
diff --git a/backend/src/server/routes/v1/pki-sync-routers/pki-sync-router.ts b/backend/src/server/routes/v1/pki-sync-routers/pki-sync-router.ts
index b6100073db..c9bdfaabb5 100644
--- a/backend/src/server/routes/v1/pki-sync-routers/pki-sync-router.ts
+++ b/backend/src/server/routes/v1/pki-sync-routers/pki-sync-router.ts
@@ -100,6 +100,7 @@ const PkiSyncCertificateSchema = z.object({
certificateRenewalError: z.string().nullish(),
pkiSyncName: z.string().optional(),
pkiSyncDestination: z.string().optional(),
+ externalIdentifier: z.string().nullish(),
syncMetadata: SyncMetadataSchema
});
diff --git a/backend/src/services/pki-sync/pki-sync-service.ts b/backend/src/services/pki-sync/pki-sync-service.ts
index 43c86976ea..a83d7f9312 100644
--- a/backend/src/services/pki-sync/pki-sync-service.ts
+++ b/backend/src/services/pki-sync/pki-sync-service.ts
@@ -806,6 +806,7 @@ export const pkiSyncServiceFactory = ({
certificateRenewalError: detail.certificateRenewalError || undefined,
pkiSyncName: detail.pkiSyncName || undefined,
pkiSyncDestination: detail.pkiSyncDestination || undefined,
+ externalIdentifier: detail.externalIdentifier || undefined,
syncMetadata: detail.syncMetadata as TSyncMetadata
}));
diff --git a/backend/src/services/pki-sync/pki-sync-types.ts b/backend/src/services/pki-sync/pki-sync-types.ts
index 758175a92f..7d0cfe2222 100644
--- a/backend/src/services/pki-sync/pki-sync-types.ts
+++ b/backend/src/services/pki-sync/pki-sync-types.ts
@@ -211,6 +211,7 @@ export type TPkiSyncCertificate = {
certificateRenewalError?: string;
pkiSyncName?: string;
pkiSyncDestination?: string;
+ externalIdentifier?: string;
syncMetadata?: TSyncMetadata;
};
diff --git a/frontend/src/hooks/api/pkiSyncs/types/common.ts b/frontend/src/hooks/api/pkiSyncs/types/common.ts
index 2e3113d667..cc55b307b5 100644
--- a/frontend/src/hooks/api/pkiSyncs/types/common.ts
+++ b/frontend/src/hooks/api/pkiSyncs/types/common.ts
@@ -78,6 +78,7 @@ export type TPkiSyncCertificate = {
certificateRenewalError?: string;
pkiSyncName?: string;
pkiSyncDestination?: string;
+ externalIdentifier?: string | null;
syncMetadata?: {
isDefault?: boolean;
[key: string]: unknown;
diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncCertificatesSection.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncCertificatesSection.tsx
index 886b1e560a..841be21076 100644
--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncCertificatesSection.tsx
+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncCertificatesSection.tsx
@@ -32,7 +32,7 @@ import {
Tooltip,
Tr
} from "@app/components/v2";
-import { Badge } from "@app/components/v3";
+import { Badge, CopyButton } from "@app/components/v3";
import {
useClearDefaultCertificate,
useListPkiSyncCertificates,
@@ -198,9 +198,10 @@ export const PkiSyncCertificatesSection = ({ pkiSync }: Props) => {
<Table>
<THead>
<Tr>
- <Th className="w-2/8">SAN / CN</Th>
- <Th className="w-3/16">Certificate Status</Th>
- <Th className="w-3/16">Serial Number</Th>
+ <Th className="w-3/16">SAN / CN</Th>
+ <Th className="w-1/8">Certificate Status</Th>
+ <Th className="w-1/8">Serial Number</Th>
+ <Th className="w-3/16">External ID</Th>
<Th className="w-1/8">Sync Status</Th>
<Th className="w-1/8">Expires At</Th>
<Th className="w-1/8" />
@@ -281,6 +282,26 @@ export const PkiSyncCertificatesSection = ({ pkiSync }: Props) => {
})()}
</div>
</Td>
+ <Td className="max-w-0">
+ {syncCert.externalIdentifier ? (
+ <div className="flex items-center gap-1">
+ <Tooltip
+ content={syncCert.externalIdentifier}
+ className="max-w-none whitespace-nowrap"
+ >
+ <span className="truncate text-xs text-bunker-300">
+ {syncCert.externalIdentifier}
+ </span>
+ </Tooltip>
+ <CopyButton
+ value={syncCert.externalIdentifier}
+ ariaLabel="Copy external identifier"
+ />
+ </div>
+ ) : (
+ <span className="text-xs text-bunker-400">-</span>
+ )}
+ </Td>
<Td>
{syncCert.lastSyncMessage &&
syncCert.syncStatus === CertificateSyncStatus.Failed ? (