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
feat: add helper text for digicert profiles during issuance
Sheen Capadnganb9df4362d085
diff --git a/backend/src/server/routes/v1/certificate-profiles-router.ts b/backend/src/server/routes/v1/certificate-profiles-router.tsindex f35672978c..3dd8265c8a 100644--- a/backend/src/server/routes/v1/certificate-profiles-router.ts+++ b/backend/src/server/routes/v1/certificate-profiles-router.ts@@ -329,6 +329,7 @@ export const registerCertificateProfilesRouter = async (name: z.string(),isExternal: z.boolean().optional(),externalType: z.string().nullable().optional(),+ productNameId: z.string().nullable().optional(),keyAlgorithm: z.string().nullable().optional()}).optional(),@@ -439,6 +440,7 @@ export const registerCertificateProfilesRouter = async (name: z.string(),isExternal: z.boolean().optional(),externalType: z.string().nullable().optional(),+ productNameId: z.string().nullable().optional(),keyAlgorithm: z.string().nullable().optional()}).optional(),diff --git a/backend/src/services/certificate-profile/certificate-profile-dal.ts b/backend/src/services/certificate-profile/certificate-profile-dal.tsindex 4517843bf7..d157a19442 100644--- a/backend/src/services/certificate-profile/certificate-profile-dal.ts+++ b/backend/src/services/certificate-profile/certificate-profile-dal.ts@@ -9,6 +9,7 @@ import {type ProcessedPermissionRules} from "@app/lib/knex/permission-filter-utils";import { CertStatus } from "@app/services/certificate/certificate-types";+import { CaType } from "@app/services/certificate-authority/certificate-authority-enums";import {EnrollmentType,@@ -23,6 +24,18 @@ import {export type TCertificateProfileDALFactory = ReturnType<typeof certificateProfileDALFactory>;+// DigiCert pins one product per CA, and that product constrains what a request may ask for+// (ssl_wildcard rejects a non-wildcard common name, for instance). Surface it so the request+// form can show which product it is ordering against.+const extractProductNameId = (externalCaType: unknown, configuration: unknown): string | undefined => {+ if (externalCaType !== CaType.DIGICERT || typeof configuration !== "object" || configuration === null) {+ return undefined;+ }++ const { productNameId } = configuration as { productNameId?: unknown };+ return typeof productNameId === "string" ? productNameId : undefined;+};+export const certificateProfileDALFactory = (db: TDbClient) => {const certificateProfileOrm = ormify(db, TableName.PkiCertificateProfile);@@ -186,6 +199,7 @@ export const certificateProfileDALFactory = (db: TDbClient) => {db.ref("name").withSchema(TableName.CertificateAuthority).as("caName"),db.ref("id").withSchema(TableName.ExternalCertificateAuthority).as("externalCaId"),db.ref("type").withSchema(TableName.ExternalCertificateAuthority).as("externalCaType"),+ db.ref("configuration").withSchema(TableName.ExternalCertificateAuthority).as("externalCaConfiguration"),db.ref("keyAlgorithm").withSchema(TableName.InternalCertificateAuthority).as("internalCaKeyAlgorithm"),db.ref("id").withSchema(TableName.PkiCertificatePolicy).as("policyId"),db.ref("projectId").withSchema(TableName.PkiCertificatePolicy).as("policyProjectId"),@@ -284,6 +298,7 @@ export const certificateProfileDALFactory = (db: TDbClient) => {name: result.caName,isExternal: !!result.externalCaId,externalType: result.externalCaType as string | undefined,+ productNameId: extractProductNameId(result.externalCaType, result.externalCaConfiguration),keyAlgorithm: result.internalCaKeyAlgorithm as string | null} as TCertificateProfileWithConfigs["certificateAuthority"]): undefined;@@ -443,6 +458,7 @@ export const certificateProfileDALFactory = (db: TDbClient) => {db.ref("status").withSchema(TableName.CertificateAuthority).as("caStatus"),db.ref("id").withSchema(TableName.ExternalCertificateAuthority).as("externalCaId"),db.ref("type").withSchema(TableName.ExternalCertificateAuthority).as("externalCaType"),+ db.ref("configuration").withSchema(TableName.ExternalCertificateAuthority).as("externalCaConfiguration"),db.ref("keyAlgorithm").withSchema(TableName.InternalCertificateAuthority).as("internalCaKeyAlgorithm"),db.ref("id").withSchema(TableName.PkiEstEnrollmentConfig).as("estId"),db@@ -539,6 +555,7 @@ export const certificateProfileDALFactory = (db: TDbClient) => {status: result.caStatus as string,isExternal: !!result.externalCaId,externalType: result.externalCaType as string | undefined,+ productNameId: extractProductNameId(result.externalCaType, result.externalCaConfiguration),keyAlgorithm: result.internalCaKeyAlgorithm as string | null}: undefined;diff --git a/backend/src/services/certificate-profile/certificate-profile-types.ts b/backend/src/services/certificate-profile/certificate-profile-types.tsindex a65ca4847a..2172bbc7df 100644--- a/backend/src/services/certificate-profile/certificate-profile-types.ts+++ b/backend/src/services/certificate-profile/certificate-profile-types.ts@@ -104,6 +104,7 @@ export type TCertificateProfileWithConfigs = TCertificateProfile & {name: string;isExternal?: boolean;externalType?: string;+ productNameId?: string;keyAlgorithm?: string | null;};certificatePolicy?: {diff --git a/frontend/src/hooks/api/certificateProfiles/types.ts b/frontend/src/hooks/api/certificateProfiles/types.tsindex b0bb7275e7..ee1f64e799 100644--- a/frontend/src/hooks/api/certificateProfiles/types.ts+++ b/frontend/src/hooks/api/certificateProfiles/types.ts@@ -55,6 +55,7 @@ export type TCertificateProfile = {name: string;isExternal?: boolean;externalType?: string | null;+ productNameId?: string | null;keyAlgorithm?: string | null;};};@@ -67,6 +68,7 @@ export type TCertificateProfileWithDetails = TCertificateProfile & {name: string;isExternal?: boolean;externalType?: string | null;+ productNameId?: string | null;keyAlgorithm?: string | null;};certificatePolicy?: {diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsxindex a1559dfad3..12a8a104c0 100644--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx@@ -2,11 +2,13 @@ import { useCallback, useEffect, useMemo, useRef } from "react";import { Controller, useFieldArray, useForm } from "react-hook-form";import { zodResolver } from "@hookform/resolvers/zod";import { useNavigate } from "@tanstack/react-router";-import { FileBadge, Plus, Tags, Trash2 } from "lucide-react";+import { FileBadge, InfoIcon, Plus, Tags, Trash2 } from "lucide-react";import { z } from "zod";import { createNotification } from "@app/components/notifications";import {+ Alert,+ AlertDescription,Button,Empty,EmptyContent,@@ -365,6 +367,11 @@ export const CertificateIssuanceModal = ({const isAwsPcaProfile = externalCaType === CaType.AWS_PCA;isAwsPcaProfileRef.current = isAwsPcaProfile;+ const digicertProductNameId =+ externalCaType === CaType.DIGICERT+ ? actualSelectedProfile?.certificateAuthority?.productNameId+ : undefined;+const { data: policyData } = useGetCertificatePolicyById({policyId: actualSelectedProfile?.certificatePolicyId || "",applicationId@@ -758,6 +765,20 @@ export const CertificateIssuanceModal = ({/>)}+ {currentStepKey === "subject" && digicertProductNameId && (+ <Alert variant="info" className="mb-4">+ <InfoIcon />+ <AlertDescription>+ <p>+ This profile orders through the DigiCert{" "}+ <span className="font-mono">{digicertProductNameId}</span> product, set on the+ issuing CA. Subject values the product does not accept are rejected when the order+ is placed.+ </p>+ </AlertDescription>+ </Alert>+ )}+{currentStepKey === "subject" && constraints.shouldShowSubjectSection && (<SubjectAttributesFieldcontrol={control}