Skip to content

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

Show cert id on renew fields if the cert has no CN nor SAN

Carlos Monastyrski0b632c327a06
diff --git a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateOverviewSection.tsx b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateOverviewSection.tsx
index 8042137f1d..e2587bddcc 100644
--- a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateOverviewSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/components/CertificateOverviewSection.tsx
@@ -3,6 +3,7 @@ import { Link, useParams } from "@tanstack/react-router";
import { format } from "date-fns";
import { ExternalLinkIcon } from "lucide-react";
+import { getCertificateDisplayName } from "@app/components/utilities/certificateDisplayUtils";
import { Tooltip } from "@app/components/v2";
import { CopyButton } from "@app/components/v2/CopyButton";
import {
@@ -80,7 +81,9 @@ export const CertificateOverviewSection = ({ certificateId }: Props) => {
<DetailGroup>
<Detail>
<DetailLabel>Common Name</DetailLabel>
- <DetailValue>{certificate.commonName}</DetailValue>
+ <DetailValue>
+ {certificate.commonName || <span className="text-muted">—</span>}
+ </DetailValue>
</Detail>
<Detail>
<DetailLabel>Status</DetailLabel>
@@ -223,7 +226,13 @@ export const CertificateOverviewSection = ({ certificateId }: Props) => {
}}
className="inline-flex items-center gap-1 underline"
>
- {certificate.commonName}
+ {
+ getCertificateDisplayName(
+ certificate,
+ 64,
+ certificate.renewedFromCertificateId
+ ).displayName
+ }
<ExternalLinkIcon className="size-3.5 text-mineshaft-400" />
</Link>
</DetailValue>
@@ -242,7 +251,10 @@ export const CertificateOverviewSection = ({ certificateId }: Props) => {
}}
className="inline-flex items-center gap-1 underline"
>
- {certificate.commonName}
+ {
+ getCertificateDisplayName(certificate, 64, certificate.renewedByCertificateId)
+ .displayName
+ }
<ExternalLinkIcon className="size-3.5 text-mineshaft-400" />
</Link>
</DetailValue>
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx
index 5b09a4f48a..21c402b008 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx
@@ -927,7 +927,11 @@ export const CertificatesTable = ({
!isExpired &&
!isExpiringWithinDay
);
- const { originalDisplayName } = getCertificateDisplayName(certificate, 64, "—");
+ const { originalDisplayName } = getCertificateDisplayName(
+ certificate,
+ 64,
+ certificate.id
+ );
return (
<TableRow
@@ -947,7 +951,11 @@ export const CertificatesTable = ({
>
{visibleColumns.has("sanCn") && (
<TableCell isTruncatable>
- <CertificateDisplayName cert={certificate} maxLength={64} fallback="—" />
+ <CertificateDisplayName
+ cert={certificate}
+ maxLength={64}
+ fallback={certificate.id}
+ />
</TableCell>
)}
{visibleColumns.has("serialNumber") && (