Skip to content

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

Address PR comments

Carlos Monastyrskiea3f82818b9f
diff --git a/frontend/src/components/pki-syncs/CertificateManagementModal.tsx b/frontend/src/components/pki-syncs/CertificateManagementModal.tsx
index 2ff25d25e6..2f27a5bfd3 100644
--- a/frontend/src/components/pki-syncs/CertificateManagementModal.tsx
+++ b/frontend/src/components/pki-syncs/CertificateManagementModal.tsx
@@ -103,7 +103,9 @@ export const CertificateManagementModal = ({
const allCertificates = data?.certificates || [];
const totalCount = data?.totalCount || 0;
- const { data: syncData } = useListPkiSyncCertificates(pkiSync?.id || "");
+ const { data: syncData } = useListPkiSyncCertificates(pkiSync?.id || "", undefined, {
+ enabled: Boolean(pkiSync?.id)
+ });
const syncCertificates = syncData?.certificates || [];
const addCertificatesToSync = useAddCertificatesToPkiSync();
const removeCertificatesFromSync = useRemoveCertificatesFromPkiSync();
diff --git a/frontend/src/components/pki-syncs/PkiSyncStatusBadge.tsx b/frontend/src/components/pki-syncs/PkiSyncStatusBadge.tsx
index 1c12942805..0b91980b9c 100644
--- a/frontend/src/components/pki-syncs/PkiSyncStatusBadge.tsx
+++ b/frontend/src/components/pki-syncs/PkiSyncStatusBadge.tsx
@@ -1,19 +1,31 @@
+import { useMemo } from "react";
+import { format } from "date-fns";
import {
AlertTriangleIcon,
+ CalendarCheckIcon,
CheckIcon,
HourglassIcon,
LucideIcon,
- RefreshCwIcon
+ RefreshCwIcon,
+ XIcon
} from "lucide-react";
-import { Badge, TBadgeProps } from "@app/components/v3";
+import {
+ Badge,
+ HoverCard,
+ HoverCardContent,
+ HoverCardTrigger,
+ TBadgeProps
+} from "@app/components/v3";
import { PkiSyncStatus } from "@app/hooks/api/pkiSyncs";
type Props = {
status: PkiSyncStatus;
+ lastSyncedAt?: Date | string | null;
+ lastSyncMessage?: string | null;
} & Omit<TBadgeProps, "children" | "variant">;
-export const PkiSyncStatusBadge = ({ status }: Props) => {
+export const PkiSyncStatusBadge = ({ status, lastSyncedAt, lastSyncMessage }: Props) => {
let variant: TBadgeProps["variant"];
let text: string;
let Icon: LucideIcon;
@@ -42,10 +54,65 @@ export const PkiSyncStatusBadge = ({ status }: Props) => {
break;
}
- return (
+ const failureMessage = useMemo(() => {
+ if (status === PkiSyncStatus.Failed) {
+ if (lastSyncMessage)
+ try {
+ return JSON.stringify(JSON.parse(lastSyncMessage), null, 2);
+ } catch {
+ return lastSyncMessage;
+ }
+
+ return "An Unknown Error Occurred.";
+ }
+ return null;
+ }, [status, lastSyncMessage]);
+
+ const badge = (
<Badge variant={variant}>
<Icon className={status === PkiSyncStatus.Running ? "animate-spin" : ""} />
{text}
</Badge>
);
+
+ if (
+ ![PkiSyncStatus.Succeeded, PkiSyncStatus.Failed].includes(status) ||
+ (!lastSyncedAt && !failureMessage)
+ ) {
+ return badge;
+ }
+
+ return (
+ <HoverCard openDelay={150} closeDelay={150}>
+ <HoverCardTrigger asChild>{badge}</HoverCardTrigger>
+ <HoverCardContent side="left" className="w-auto max-w-sm">
+ <div className="flex flex-col gap-2 py-1 whitespace-normal">
+ {lastSyncedAt && (
+ <div>
+ <div
+ className={`mb-2 flex items-center gap-1.5 self-start ${status === PkiSyncStatus.Failed ? "text-warning" : "text-success"}`}
+ >
+ <CalendarCheckIcon className="size-3" />
+ <div className="text-xs">Last Synced</div>
+ </div>
+ <div className="rounded-sm bg-mineshaft-600 p-2 text-xs">
+ {format(new Date(lastSyncedAt), "yyyy-MM-dd, hh:mm aaa")}
+ </div>
+ </div>
+ )}
+ {failureMessage && (
+ <div>
+ <div className="mb-2 flex items-center gap-1.5 self-start text-danger">
+ <XIcon className="size-3" />
+ <div className="text-xs">Failure Reason</div>
+ </div>
+ <div className="rounded-sm bg-mineshaft-600 p-2 text-xs break-words">
+ {failureMessage}
+ </div>
+ </div>
+ )}
+ </div>
+ </HoverCardContent>
+ </HoverCard>
+ );
};
diff --git a/frontend/src/components/pki-syncs/forms/CreatePkiSyncForm.tsx b/frontend/src/components/pki-syncs/forms/CreatePkiSyncForm.tsx
index d36af35091..433435ec03 100644
--- a/frontend/src/components/pki-syncs/forms/CreatePkiSyncForm.tsx
+++ b/frontend/src/components/pki-syncs/forms/CreatePkiSyncForm.tsx
@@ -1,9 +1,19 @@
import { useState } from "react";
import { Controller, FieldPath, FormProvider, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
+import { AlertTriangleIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogMedia,
+ AlertDialogTitle,
Button,
DocumentationLinkBadge,
Field,
@@ -143,6 +153,7 @@ export const CreatePkiSyncForm = ({
const { name: destinationName } = PKI_SYNC_MAP[destination];
const [selectedTabIndex, setSelectedTabIndex] = useState(0);
+ const [showConfirmation, setShowConfirmation] = useState(false);
const FORM_TABS = getFormTabs(destination);
const { syncOption } = usePkiSyncOption(destination);
@@ -210,16 +221,15 @@ export const CreatePkiSyncForm = ({
}`,
type: "success"
});
+ setShowConfirmation(false);
onComplete(pkiSync);
} catch {
- createNotification({
- text: `Failed to create ${destinationName} Certificate Sync`,
- type: "error"
- });
+ /* empty */
}
};
- const { handleSubmit, trigger, control, getValues, setError } = formMethods;
+ const { handleSubmit, trigger, control, getValues, setError, watch } = formMethods;
+ const canRemoveCertificates = watch("syncOptions.canRemoveCertificates");
const isStepValid = async (index: number) => {
const isValid = await trigger(FORM_TABS[index].fields);
@@ -252,7 +262,7 @@ export const CreatePkiSyncForm = ({
const handleNext = async () => {
if (isFinalStep) {
- await handleSubmit(onSubmit)();
+ setShowConfirmation(true);
return;
}
@@ -323,7 +333,7 @@ export const CreatePkiSyncForm = ({
<Field className="mt-2">
<Field orientation="horizontal">
<FieldContent>
- <Label htmlFor="auto-sync-enabled">Auto-sync on changes</Label>
+ <Label htmlFor="auto-sync-enabled">Auto-sync on Change</Label>
<FieldDescription>
When certificates in the selected list change, sync automatically. Turn
off to only sync manually.
@@ -387,6 +397,47 @@ export const CreatePkiSyncForm = ({
</Button>
</div>
</div>
+
+ <AlertDialog
+ open={showConfirmation}
+ onOpenChange={(open) => {
+ if (!createPkiSync.isPending) setShowConfirmation(open);
+ }}
+ >
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogMedia>
+ <AlertTriangleIcon className="text-warning" />
+ </AlertDialogMedia>
+ <AlertDialogTitle>Certificate Sync Behavior</AlertDialogTitle>
+ <AlertDialogDescription asChild>
+ <div className="flex flex-col gap-2">
+ <p>Infisical is the source of truth for synced destinations.</p>
+ <p>
+ Certificates in the destination will be overwritten, and any direct edits there
+ may be overwritten by future syncs.
+ </p>
+ {syncOption?.canRemoveCertificates && canRemoveCertificates && (
+ <p>
+ Certificates in {destinationName} that are no longer active in Infisical will be
+ removed.
+ </p>
+ )}
+ </div>
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel isDisabled={createPkiSync.isPending}>Cancel</AlertDialogCancel>
+ <AlertDialogAction
+ variant="project"
+ isDisabled={createPkiSync.isPending}
+ onClick={handleSubmit(onSubmit)}
+ >
+ I Understand
+ </AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
</form>
);
};
diff --git a/frontend/src/components/pki-syncs/forms/EditPkiSyncForm.tsx b/frontend/src/components/pki-syncs/forms/EditPkiSyncForm.tsx
index 4d5dbb7e88..2bd3aeb4cd 100644
--- a/frontend/src/components/pki-syncs/forms/EditPkiSyncForm.tsx
+++ b/frontend/src/components/pki-syncs/forms/EditPkiSyncForm.tsx
@@ -166,7 +166,7 @@ export const EditPkiSyncForm = ({ pkiSync, onComplete, onDirtyChange, onCancel }
<Field className="mt-2">
<Field orientation="horizontal">
<FieldContent>
- <Label htmlFor="auto-sync-enabled">Auto-sync on changes</Label>
+ <Label htmlFor="auto-sync-enabled">Auto-sync on Change</Label>
<FieldDescription>
When certificates in the selected list change, sync automatically. Turn off
to only sync manually.
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncCertificatesFields.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncCertificatesFields.tsx
index fca7c148e8..f509ca8d41 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncCertificatesFields.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncCertificatesFields.tsx
@@ -9,6 +9,7 @@ import {
EmptyTitle,
Field,
FieldError,
+ IconButton,
Table,
TableBody,
TableCell,
@@ -89,11 +90,11 @@ export const PkiSyncCertificatesFields = ({ applicationId }: Props = {}) => {
<Table>
<TableHeader>
<TableRow>
- <TableHead className="w-1/3">SAN / CN</TableHead>
- <TableHead className="w-1/4">Serial Number</TableHead>
+ <TableHead>SAN / CN</TableHead>
+ <TableHead className="w-1/5">Serial Number</TableHead>
<TableHead className="w-1/6">Issued At</TableHead>
<TableHead className="w-1/6">Expires At</TableHead>
- <TableHead className="w-12">Remove</TableHead>
+ <TableHead className="w-12" />
</TableRow>
</TableHeader>
<TableBody>
@@ -121,29 +122,24 @@ export const PkiSyncCertificatesFields = ({ applicationId }: Props = {}) => {
)}
</TableCell>
<TableCell className="max-w-0">
- <div
- className="font-mono text-xs text-muted"
- title={cert.serialNumber}
- >
+ <div className="font-mono text-xs" title={cert.serialNumber}>
{truncatedSerial}
</div>
</TableCell>
<TableCell className="max-w-0">
- <span className="text-sm text-muted">
+ <span className="text-sm">
{new Date(cert.notBefore).toLocaleDateString()}
</span>
</TableCell>
<TableCell className="max-w-0">
- <span
- className={`text-sm ${isExpired ? "text-danger" : "text-muted"}`}
- >
+ <span className={isExpired ? "text-sm text-danger" : "text-sm"}>
{new Date(cert.notAfter).toLocaleDateString()}
</span>
</TableCell>
<TableCell>
- <Button
+ <IconButton
type="button"
- size="sm"
+ size="xs"
variant="ghost"
aria-label="Remove certificate"
onClick={() => {
@@ -151,8 +147,8 @@ export const PkiSyncCertificatesFields = ({ applicationId }: Props = {}) => {
onChange(newIds);
}}
>
- <Trash2 className="size-4" />
- </Button>
+ <Trash2 />
+ </IconButton>
</TableCell>
</TableRow>
);
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/AwsSecretsManagerSyncOptions.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/AwsSecretsManagerSyncOptions.tsx
index e1ea36a07c..d560a1db0f 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/AwsSecretsManagerSyncOptions.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/AwsSecretsManagerSyncOptions.tsx
@@ -4,7 +4,7 @@ export const AwsSecretsManagerSyncOptions = () => (
<SyncSwitchField
name="syncOptions.preserveSecretOnRenewal"
id="preserve-secret-on-renewal"
- label="Preserve Secret on Renewal"
+ label="Preserve secret on renewal"
description="Applies to certificate renewals only. When enabled, the renewed certificate updates the existing secret, keeping the same name and ARN so consumers need no updates. When disabled, a new secret is created and the old one is removed."
defaultChecked
/>
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/AzureKeyVaultSyncOptions.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/AzureKeyVaultSyncOptions.tsx
index fbfa74b35a..05ee5458a3 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/AzureKeyVaultSyncOptions.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/AzureKeyVaultSyncOptions.tsx
@@ -4,7 +4,7 @@ export const AzureKeyVaultSyncOptions = () => (
<SyncSwitchField
name="syncOptions.enableVersioning"
id="preserve-version"
- label="Enable Versioning on Renewal"
+ label="Enable versioning on renewal"
description="When enabled, renewals add a new version of the existing certificate in Azure Key Vault under the same name, so consumers automatically use the latest version. When disabled, a new certificate is created and the old one is removed."
defaultChecked
/>
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/ChefSyncOptions.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/ChefSyncOptions.tsx
index 3bcafc7a1d..8447547734 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/ChefSyncOptions.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/ChefSyncOptions.tsx
@@ -2,7 +2,7 @@ import { PreserveItemOnRenewalField } from "./PreserveItemOnRenewalField";
export const ChefSyncOptions = () => (
<PreserveItemOnRenewalField
- label="Preserve Data Bag Item on Renewal"
+ label="Preserve data bag item on renewal"
description="Applies to certificate renewals only. When enabled, the renewed certificate updates the existing data bag item, keeping the same name so Chef cookbooks and recipes need no updates. When disabled, a new item is created and the old one is removed."
/>
);
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/F5BigIpSyncOptions.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/F5BigIpSyncOptions.tsx
index babd5134e1..248f462aa7 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/F5BigIpSyncOptions.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/F5BigIpSyncOptions.tsx
@@ -2,7 +2,7 @@ import { PreserveItemOnRenewalField } from "./PreserveItemOnRenewalField";
export const F5BigIpSyncOptions = () => (
<PreserveItemOnRenewalField
- label="Preserve Certificate on Renewal"
+ label="Preserve certificate on renewal"
description="Applies to certificate renewals only. When enabled, the renewed certificate replaces the existing one under the same name, so any profile that uses it keeps working. When disabled, it is uploaded with a new name and the original stays on the BIG-IP."
/>
);
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/KempLoadMasterSyncOptions.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/KempLoadMasterSyncOptions.tsx
index ede4628ee1..519b76085f 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/KempLoadMasterSyncOptions.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/KempLoadMasterSyncOptions.tsx
@@ -1,30 +1,19 @@
import { Controller, useFormContext } from "react-hook-form";
-import { Info } from "lucide-react";
-import {
- Field,
- FieldDescription,
- FieldError,
- FieldLabel,
- Input,
- Tooltip,
- TooltipContent,
- TooltipTrigger
-} from "@app/components/v3";
-import { usePkiSyncOption } from "@app/hooks/api/pkiSyncs";
+import { Field, FieldDescription, FieldError, FieldLabel, Input } from "@app/components/v3";
import { KEMP_DEFAULT_CA_NAME_SCHEMA } from "../schemas/kemp-loadmaster-pki-sync-destination-schema";
import { TPkiSyncForm } from "../schemas/pki-sync-schema";
+import { NameSchemaHoverCard } from "./NameSchemaHoverCard";
import { PreserveItemOnRenewalField } from "./PreserveItemOnRenewalField";
export const KempLoadMasterSyncOptions = () => {
- const { control, watch } = useFormContext<TPkiSyncForm>();
- const { syncOption } = usePkiSyncOption(watch("destination"));
+ const { control } = useFormContext<TPkiSyncForm>();
return (
<>
<PreserveItemOnRenewalField
- label="Preserve Certificate on Renewal"
+ label="Preserve certificate on renewal"
description="Applies to certificate renewals only. When enabled, the renewed certificate keeps the original certificate's identifier and replaces that entry in place, so any Virtual Service binding keeps working. When disabled, the renewed certificate is imported under a newly generated identifier and the original stays on the LoadMaster."
/>
<Controller
@@ -33,49 +22,30 @@ export const KempLoadMasterSyncOptions = () => {
render={({ field: { value, onChange }, fieldState: { error } }) => (
<Field className="mb-4">
<FieldLabel>
- CA Certificate Name Schema
- <Tooltip>
- <TooltipTrigger asChild>
- <Info />
- </TooltipTrigger>
- <TooltipContent className="max-w-md">
- <div className="flex flex-col gap-3">
- <span>
- This schema names each CA (intermediate) certificate that Infisical pushes
- into the LoadMaster&apos;s Intermediate Certs store.
- </span>
- <div className="flex flex-col">
- <span>Available placeholders:</span>
- <ul className="list-disc pl-4 text-sm">
- <li>
- <code>{"{{fingerprint}}"}</code> - A hash of the CA certificate. Include
- it so each distinct CA gets a unique name and is never duplicated.
- </li>
- <li>
- <code>{"{{commonName}}"}</code> - The CA certificate&apos;s common name
- </li>
- </ul>
- <span className="mt-1 text-xs text-muted">
- A placeholder is optional. A schema with no placeholder resolves to a fixed
- name and can hold only one CA certificate. When placeholders resolve, any
- characters the destination doesn&apos;t support are replaced with hyphens.
- </span>
- </div>
- {syncOption?.forbiddenCharacters &&
- syncOption.forbiddenCharacters.length > 0 && (
- <div className="flex flex-col">
- <span className="text-warning">
- Character restrictions for {syncOption.name}:
- </span>
- <div className="text-xs text-muted">
- The following characters are not allowed:{" "}
- {syncOption.forbiddenCharacters.split("").join(" ")}
- </div>
- </div>
- )}
- </div>
- </TooltipContent>
- </Tooltip>
+ CA certificate name schema
+ <NameSchemaHoverCard>
+ <span>
+ This schema names each CA (intermediate) certificate that Infisical pushes into
+ the LoadMaster&apos;s Intermediate Certs store.
+ </span>
+ <div className="flex flex-col">
+ <span>Available placeholders:</span>
+ <ul className="list-disc pl-4 text-sm">
+ <li>
+ <code>{"{{fingerprint}}"}</code> - A hash of the CA certificate. Include it so
+ each distinct CA gets a unique name and is never duplicated.
+ </li>
+ <li>
+ <code>{"{{commonName}}"}</code> - The CA certificate&apos;s common name
+ </li>
+ </ul>
+ <span className="mt-1 text-xs text-muted">
+ A placeholder is optional. A schema with no placeholder resolves to a fixed name
+ and can hold only one CA certificate. When placeholders resolve, any characters
+ the destination doesn&apos;t support are replaced with hyphens.
+ </span>
+ </div>
+ </NameSchemaHoverCard>
</FieldLabel>
<Input
value={value ?? ""}
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/LinuxServerSyncOptions.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/LinuxServerSyncOptions.tsx
index 9a0e611c69..1718e11856 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/LinuxServerSyncOptions.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/LinuxServerSyncOptions.tsx
@@ -31,7 +31,7 @@ export const LinuxServerSyncOptions = ({ isUpdate }: Props) => {
render={({ field: { value, onChange }, fieldState: { error } }) => (
<Field className="mb-4">
<FieldLabel>
- File Permissions <span className="text-muted">(optional)</span>
+ File permissions <span className="text-muted">(optional)</span>
<Tooltip>
<TooltipTrigger asChild>
<Info />
@@ -57,7 +57,7 @@ export const LinuxServerSyncOptions = ({ isUpdate }: Props) => {
render={({ field: { value, onChange }, fieldState: { error } }) => (
<Field className="mb-4">
<FieldLabel>
- Private Key Permissions <span className="text-muted">(optional)</span>
+ Private key permissions <span className="text-muted">(optional)</span>
<Tooltip>
<TooltipTrigger asChild>
<Info />
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/NameSchemaHoverCard.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/NameSchemaHoverCard.tsx
new file mode 100644
index 0000000000..61e458e979
--- /dev/null
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/NameSchemaHoverCard.tsx
@@ -0,0 +1,44 @@
+import { ReactNode } from "react";
+import { useFormContext } from "react-hook-form";
+import { Info } from "lucide-react";
+
+import { HoverCard, HoverCardContent, HoverCardTrigger } from "@app/components/v3";
+import { usePkiSyncOption } from "@app/hooks/api/pkiSyncs";
+
+import { TPkiSyncForm } from "../schemas/pki-sync-schema";
+
+type Props = {
+ children: ReactNode;
+};
+
+export const NameSchemaHoverCard = ({ children }: Props) => {
+ const { watch } = useFormContext<TPkiSyncForm>();
+ const { syncOption } = usePkiSyncOption(watch("destination"));
+
+ return (
+ <HoverCard openDelay={100}>
+ <HoverCardTrigger asChild>
+ <Info className="cursor-help" />
+ </HoverCardTrigger>
+ <HoverCardContent
+ side="left"
+ align="start"
+ collisionPadding={16}
+ className="max-h-(--radix-hover-card-content-available-height) thin-scrollbar w-[28rem] overflow-y-auto"
+ >
+ <div className="flex flex-col gap-3">
+ {children}
+ {syncOption?.forbiddenCharacters && syncOption.forbiddenCharacters.length > 0 && (
+ <div className="flex flex-col">
+ <span className="text-warning">Character restrictions for {syncOption.name}:</span>
+ <div className="text-xs text-muted">
+ The following characters are not allowed:{" "}
+ {syncOption.forbiddenCharacters.split("").join(" ")}
+ </div>
+ </div>
+ )}
+ </div>
+ </HoverCardContent>
+ </HoverCard>
+ );
+};
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/NetScalerSyncOptions.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/NetScalerSyncOptions.tsx
index ef358dfa31..4fc56e1f58 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/NetScalerSyncOptions.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/NetScalerSyncOptions.tsx
@@ -2,7 +2,7 @@ import { PreserveItemOnRenewalField } from "./PreserveItemOnRenewalField";
export const NetScalerSyncOptions = () => (
<PreserveItemOnRenewalField
- label="Preserve Certificate on Renewal"
+ label="Preserve certificate on renewal"
description="Applies to certificate renewals only. When enabled, the renewed certificate updates the existing certkey object, keeping its name and vServer bindings. When disabled, a new certkey object is created and the old certificate remains on NetScaler."
/>
);
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PkiSyncOptionsFields.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PkiSyncOptionsFields.tsx
index 4a05b0e046..4ad72157eb 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PkiSyncOptionsFields.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PkiSyncOptionsFields.tsx
@@ -1,16 +1,6 @@
import { Controller, useFormContext } from "react-hook-form";
-import { Info } from "lucide-react";
-import {
- Field,
- FieldDescription,
- FieldError,
- FieldLabel,
- Input,
- Tooltip,
- TooltipContent,
- TooltipTrigger
-} from "@app/components/v3";
+import { Field, FieldDescription, FieldError, FieldLabel, Input } from "@app/components/v3";
import { PkiSync, usePkiSyncOption } from "@app/hooks/api/pkiSyncs";
import { TPkiSyncForm } from "../schemas/pki-sync-schema";
@@ -22,6 +12,7 @@ import { ChefSyncOptions } from "./ChefSyncOptions";
import { F5BigIpSyncOptions } from "./F5BigIpSyncOptions";
import { KempLoadMasterSyncOptions } from "./KempLoadMasterSyncOptions";
import { LinuxServerSyncOptions } from "./LinuxServerSyncOptions";
+import { NameSchemaHoverCard } from "./NameSchemaHoverCard";
import { NetScalerSyncOptions } from "./NetScalerSyncOptions";
import { SyncSwitchField } from "./SyncSwitchField";
import { WindowsServerSyncOptions } from "./WindowsServerSyncOptions";
@@ -69,7 +60,7 @@ export const PkiSyncOptionsFields = ({ destination, isUpdate }: Props) => {
<SyncSwitchField
name="syncOptions.canRemoveCertificates"
id="can-remove-certificates"
- label="Enable Removal of Expired/Revoked Certificates"
+ label="Enable removal of expired/revoked certificates"
description={
<>
When enabled, Infisical removes certificates from the destination during a sync once
@@ -87,7 +78,7 @@ export const PkiSyncOptionsFields = ({ destination, isUpdate }: Props) => {
<SyncSwitchField
name="syncOptions.includeRootCa"
id="include-root-ca"
- label="Include Root CA in Certificate Chain"
+ label="Include root CA in certificate chain"
description="When enabled, the full certificate chain including the root CA is synced. When disabled, the root CA is excluded to reduce the chain size; most applications validate correctly with intermediate certificates only."
/>
)}
@@ -101,86 +92,64 @@ export const PkiSyncOptionsFields = ({ destination, isUpdate }: Props) => {
render={({ field: { value, onChange }, fieldState: { error } }) => (
<Field className="mb-4">
<FieldLabel>
- Certificate Name Schema
+ Certificate name schema
{currentDestination === PkiSync.AwsElasticLoadBalancer && (
<span className="text-muted">(optional)</span>
)}
- <Tooltip>
- <TooltipTrigger asChild>
- <Info />
- </TooltipTrigger>
- <TooltipContent className="max-w-md">
- <div className="flex flex-col gap-3">
- <span>
- When a certificate is synced, the certificate name schema will be applied
- before it reaches the destination.
- </span>
+ <NameSchemaHoverCard>
+ <span>
+ When a certificate is synced, the certificate name schema will be applied before
+ it reaches the destination.
+ </span>
- <div className="flex flex-col">
- <span>Available placeholders:</span>
- <ul className="list-disc pl-4 text-sm">
- <li>
- <code>{"{{certificateId}}"}</code> - The unique ID of the certificate
- </li>
- <li>
- <code>{"{{shortCertificateId}}"}</code> - A shorter (22-character) form
- of the certificate ID. Use it instead of{" "}
- <code>{"{{certificateId}}"}</code> when the destination&apos;s name
- limit is tight (e.g. NetScaler&apos;s 63 characters).
- </li>
- <li>
- <code>{"{{commonName}}"}</code> - The certificate&apos;s common name
- (FQDN)
- </li>
- <li>
- <code>{"{{profileId}}"}</code> - The certificate profile ID (falls back
- to the certificate ID when none is set)
- </li>
- <li>
- <code>{"{{applicationId}}"}</code> - The ID of the application the sync
- belongs to
- </li>
- <li>
- <code>{"{{applicationName}}"}</code> - The name of the application the
- sync belongs to
- </li>
- </ul>
- {currentDestination === PkiSync.LinuxServer ||
- currentDestination === PkiSync.WindowsServer ? (
- <span className="mt-1 text-xs text-muted">
- A placeholder is optional here. Include one (for example{" "}
- <code>{"{{commonName}}"}</code>) so each certificate resolves to a
- distinct file name. A schema with no placeholder resolves to a fixed
- name and can be linked to only one certificate. When placeholders
- resolve, any characters the destination doesn&apos;t support are
- replaced with hyphens.
- </span>
- ) : (
- <span className="mt-1 text-xs text-muted">
- The schema must include <code>{"{{certificateId}}"}</code> or{" "}
- <code>{"{{shortCertificateId}}"}</code> so each certificate gets a
- unique name. The template itself can only contain letters, numbers, and
- the separators allowed by the destination. When placeholders resolve,
- any characters the destination doesn&apos;t support are replaced with
- hyphens.
- </span>
- )}
- </div>
- {syncOption?.forbiddenCharacters &&
- syncOption.forbiddenCharacters.length > 0 && (
- <div className="flex flex-col">
- <span className="text-warning">
- Character restrictions for {syncOption.name}:
- </span>
- <div className="text-xs text-muted">
- The following characters are not allowed:{" "}
- {syncOption.forbiddenCharacters.split("").join(" ")}
- </div>
- </div>
- )}
- </div>
- </TooltipContent>
- </Tooltip>
+ <div className="flex flex-col">
+ <span>Available placeholders:</span>
+ <ul className="list-disc pl-4 text-sm">
+ <li>
+ <code>{"{{certificateId}}"}</code> - The unique ID of the certificate
+ </li>
+ <li>
+ <code>{"{{shortCertificateId}}"}</code> - A shorter (22-character) form of
+ the certificate ID. Use it instead of <code>{"{{certificateId}}"}</code>{" "}
+ when the destination&apos;s name limit is tight (e.g. NetScaler&apos;s 63
+ characters).
+ </li>
+ <li>
+ <code>{"{{commonName}}"}</code> - The certificate&apos;s common name (FQDN)
+ </li>
+ <li>
+ <code>{"{{profileId}}"}</code> - The certificate profile ID (falls back to
+ the certificate ID when none is set)
+ </li>
+ <li>
+ <code>{"{{applicationId}}"}</code> - The ID of the application the sync
+ belongs to
+ </li>
+ <li>
+ <code>{"{{applicationName}}"}</code> - The name of the application the sync
+ belongs to
+ </li>
+ </ul>
+ {currentDestination === PkiSync.LinuxServer ||
+ currentDestination === PkiSync.WindowsServer ? (
+ <span className="mt-1 text-xs text-muted">
+ A placeholder is optional here. Include one (for example{" "}
+ <code>{"{{commonName}}"}</code>) so each certificate resolves to a distinct
+ file name. A schema with no placeholder resolves to a fixed name and can be
+ linked to only one certificate. When placeholders resolve, any characters
+ the destination doesn&apos;t support are replaced with hyphens.
+ </span>
+ ) : (
+ <span className="mt-1 text-xs text-muted">
+ The schema must include <code>{"{{certificateId}}"}</code> or{" "}
+ <code>{"{{shortCertificateId}}"}</code> so each certificate gets a unique
+ name. The template itself can only contain letters, numbers, and the
+ separators allowed by the destination. When placeholders resolve, any
+ characters the destination doesn&apos;t support are replaced with hyphens.
+ </span>
+ )}
+ </div>
+ </NameSchemaHoverCard>
</FieldLabel>
<Input
value={value || ""}
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PreserveArnField.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PreserveArnField.tsx
index 1ce1621c5d..12ea506aab 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PreserveArnField.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/PreserveArnField.tsx
@@ -4,7 +4,7 @@ export const PreserveArnField = () => (
<SyncSwitchField
name="syncOptions.preserveArn"
id="preserve-arn"
- label="Preserve ARN on Renewal"
+ label="Preserve ARN on renewal"
description={
<>
When enabled, renewals replace the existing certificate&apos;s contents while keeping the
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/ServerExportFormatFields.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/ServerExportFormatFields.tsx
index a18216103f..e04322bd9f 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/ServerExportFormatFields.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/ServerExportFormatFields.tsx
@@ -38,7 +38,7 @@ export const ServerExportFormatFields = ({ isUpdate }: Props) => {
render={({ field: { value, onChange }, fieldState: { error } }) => (
<Field className="mb-4">
<FieldLabel>
- Export Format
+ Export format
<Tooltip>
<TooltipTrigger asChild>
<Info />
@@ -72,7 +72,7 @@ export const ServerExportFormatFields = ({ isUpdate }: Props) => {
render={({ field: { value, onChange }, fieldState: { error } }) => (
<Field className="mb-4">
<FieldLabel>
- Certificate File Extension
+ Certificate file extension
<Tooltip>
<TooltipTrigger asChild>
<Info />
@@ -108,7 +108,7 @@ export const ServerExportFormatFields = ({ isUpdate }: Props) => {
<Field className="mb-4">
<Field orientation="horizontal">
<FieldContent>
- <Label htmlFor="combine-certificate-chain">Combine Certificate and Chain</Label>
+ <Label htmlFor="combine-certificate-chain">Combine certificate and chain</Label>
<FieldDescription>
When enabled, the certificate file holds the leaf certificate followed by the
chain (a full-chain file, as nginx expects) and no separate chain file is
@@ -134,7 +134,7 @@ export const ServerExportFormatFields = ({ isUpdate }: Props) => {
render={({ field: { value, onChange }, fieldState: { error } }) => (
<Field className="mb-4">
<FieldLabel>
- PKCS#12 Password
+ PKCS#12 password
<Tooltip>
<TooltipTrigger asChild>
<Info />
@@ -166,7 +166,7 @@ export const ServerExportFormatFields = ({ isUpdate }: Props) => {
<Field className="mb-4">
<Field orientation="horizontal">
<FieldContent>
- <Label htmlFor="include-private-key">Include Private Key</Label>
+ <Label htmlFor="include-private-key">Include private key</Label>
<FieldDescription>
When enabled, the certificate&apos;s private key is written alongside the
certificate as a .key file. The sync fails for a certificate whose key is not
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/WindowsServerSyncOptions.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/WindowsServerSyncOptions.tsx
index 8335d21296..a07ddfd391 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/WindowsServerSyncOptions.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncOptionsFields/WindowsServerSyncOptions.tsx
@@ -38,7 +38,7 @@ export const WindowsServerSyncOptions = ({ isUpdate }: Props) => {
<ServerExportFormatFields isUpdate={isUpdate} />
<Field className="mb-4">
<FieldLabel>
- File Permissions <span className="text-muted">(optional)</span>
+ File permissions <span className="text-muted">(optional)</span>
<Tooltip>
<TooltipTrigger asChild>
<Info />
diff --git a/frontend/src/components/pki-syncs/forms/PkiSyncReviewFields.tsx b/frontend/src/components/pki-syncs/forms/PkiSyncReviewFields.tsx
index 0ec917d934..f6d2684f87 100644
--- a/frontend/src/components/pki-syncs/forms/PkiSyncReviewFields.tsx
+++ b/frontend/src/components/pki-syncs/forms/PkiSyncReviewFields.tsx
@@ -15,21 +15,23 @@ import {
} from "@app/components/v3";
import { useProject } from "@app/context";
import {
+ BOOLEAN_SYNC_OPTION_FIELDS,
getCertificateDisplayName,
PKI_SYNC_MAP,
- truncateCertificateSerialNumber
+ truncateCertificateSerialNumber,
+ VALUE_SYNC_OPTION_FIELDS
} from "@app/helpers/pkiSyncs";
import { useListWorkspaceCertificates } from "@app/hooks/api/projects";
import { TPkiSyncForm } from "./schemas/pki-sync-schema";
const ReviewFieldLabel = ({ label, children }: { label: string; children?: ReactNode }) => (
- <div className="min-w-0">
+ <div className="flex h-full min-w-0 flex-col justify-between gap-1">
<p className="text-xs font-medium text-muted">{label}</p>
{children ? (
- <p className="text-sm break-words text-foreground">{children}</p>
+ <div className="text-sm break-words text-foreground">{children}</div>
) : (
- <p className="text-sm text-muted/50 italic">None</p>
+ <div className="text-sm text-muted/50 italic">None</div>
)}
</div>
);
@@ -78,9 +80,10 @@ export const PkiSyncReviewFields = () => {
<Table>
<TableHeader>
<TableRow>
- <TableHead className="w-1/2">SAN / CN</TableHead>
- <TableHead className="w-1/4">Serial Number</TableHead>
- <TableHead className="w-1/4">Expires At</TableHead>
+ <TableHead>SAN / CN</TableHead>
+ <TableHead className="w-1/5">Serial Number</TableHead>
+ <TableHead className="w-1/6">Issued At</TableHead>
+ <TableHead className="w-1/6 pr-5">Expires At</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -106,12 +109,17 @@ export const PkiSyncReviewFields = () => {
)}
</TableCell>
<TableCell className="max-w-0">
- <div className="font-mono text-xs text-muted" title={cert.serialNumber}>
+ <div className="font-mono text-xs" title={cert.serialNumber}>
{truncatedSerial}
</div>
</TableCell>
<TableCell className="max-w-0">
- <span className="text-sm text-muted">
+ <span className="text-sm">
+ {new Date(cert.notBefore).toLocaleDateString()}
+ </span>
+ </TableCell>
+ <TableCell className="max-w-0 pr-5">
+ <span className="text-sm">
{new Date(cert.notAfter).toLocaleDateString()}
</span>
</TableCell>
@@ -127,7 +135,7 @@ export const PkiSyncReviewFields = () => {
<div className="w-full border-b border-border">
<span className="text-sm text-muted">Destination</span>
</div>
- <div className="flex flex-wrap gap-x-8 gap-y-2">
+ <div className="grid grid-cols-3 gap-x-8 gap-y-4">
<ReviewFieldLabel label="Connection">{connection?.name}</ReviewFieldLabel>
<ReviewFieldLabel label="Service">{destinationName}</ReviewFieldLabel>
{destinationConfig && "vaultBaseUrl" in destinationConfig && (
@@ -139,30 +147,40 @@ export const PkiSyncReviewFields = () => {
<div className="w-full border-b border-border">
<span className="text-sm text-muted">Sync Options</span>
</div>
- <div className="flex flex-wrap gap-x-8 gap-y-3">
+ <div className="grid grid-cols-3 gap-x-8 gap-y-4">
<ReviewFieldLabel label="Auto-Sync">
- <div className="mt-1">
- <Badge variant={isAutoSyncEnabled ? "success" : "danger"}>
- {isAutoSyncEnabled ? "Enabled" : "Disabled"}
- </Badge>
- </div>
+ <Badge variant={isAutoSyncEnabled ? "success" : "danger"}>
+ {isAutoSyncEnabled ? "Enabled" : "Disabled"}
+ </Badge>
</ReviewFieldLabel>
- {syncOptions?.canRemoveCertificates !== undefined && (
- <ReviewFieldLabel label="Remove Certificates">
- <div className="mt-1">
- <Badge variant={syncOptions.canRemoveCertificates ? "success" : "danger"}>
- {syncOptions.canRemoveCertificates ? "Enabled" : "Disabled"}
+ {BOOLEAN_SYNC_OPTION_FIELDS.map(({ key, label }) => {
+ const optionValue = (syncOptions as Record<string, unknown> | undefined)?.[key];
+ if (typeof optionValue !== "boolean") return null;
+ return (
+ <ReviewFieldLabel key={key} label={label}>
+ <Badge variant={optionValue ? "success" : "danger"}>
+ {optionValue ? "Enabled" : "Disabled"}
</Badge>
- </div>
- </ReviewFieldLabel>
- )}
+ </ReviewFieldLabel>
+ );
+ })}
+ {VALUE_SYNC_OPTION_FIELDS.map(({ key, label }) => {
+ const optionValue = (syncOptions as Record<string, unknown> | undefined)?.[key];
+ if (optionValue === undefined || optionValue === null || optionValue === "")
+ return null;
+ return (
+ <ReviewFieldLabel key={key} label={label}>
+ <Badge variant="neutral">{String(optionValue)}</Badge>
+ </ReviewFieldLabel>
+ );
+ })}
</div>
</div>
<div className="flex flex-col gap-3">
<div className="w-full border-b border-border">
<span className="text-sm text-muted">Details</span>
</div>
- <div className="flex flex-wrap gap-x-8 gap-y-2">
+ <div className="grid grid-cols-3 gap-x-8 gap-y-4">
<ReviewFieldLabel label="Name">{name}</ReviewFieldLabel>
<ReviewFieldLabel label="Description">{description}</ReviewFieldLabel>
</div>
diff --git a/frontend/src/components/v3/platform/DeleteConfirmDialog/DeleteConfirmDialog.tsx b/frontend/src/components/v3/platform/DeleteConfirmDialog/DeleteConfirmDialog.tsx
new file mode 100644
index 0000000000..c29b802e65
--- /dev/null
+++ b/frontend/src/components/v3/platform/DeleteConfirmDialog/DeleteConfirmDialog.tsx
@@ -0,0 +1,82 @@
+import { ReactNode, useEffect, useState } from "react";
+
+import { Button } from "../../generic/Button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle
+} from "../../generic/Dialog";
+import { Field, FieldLabel } from "../../generic/Field";
+import { Input } from "../../generic/Input";
+
+type Props = {
+ isOpen: boolean;
+ onOpenChange: (isOpen: boolean) => void;
+ title: string;
+ description?: ReactNode;
+ confirmKey: string;
+ confirmLabel?: string;
+ isPending?: boolean;
+ onConfirm: () => void;
+};
+
+export const DeleteConfirmDialog = ({
+ isOpen,
+ onOpenChange,
+ title,
+ description,
+ confirmKey,
+ confirmLabel = "Delete",
+ isPending,
+ onConfirm
+}: Props) => {
+ const [typedValue, setTypedValue] = useState("");
+
+ useEffect(() => {
+ if (!isOpen) setTypedValue("");
+ }, [isOpen]);
+
+ const canConfirm = typedValue === confirmKey && !isPending;
+
+ return (
+ <Dialog open={isOpen} onOpenChange={onOpenChange}>
+ <DialogContent className="max-w-lg">
+ <DialogHeader>
+ <DialogTitle>{title}</DialogTitle>
+ {description ? <DialogDescription>{description}</DialogDescription> : null}
+ </DialogHeader>
+ <Field>
+ <FieldLabel htmlFor="delete-confirm-input">
+ Type <span className="font-semibold text-foreground">{confirmKey}</span> to confirm
+ </FieldLabel>
+ <Input
+ id="delete-confirm-input"
+ autoComplete="off"
+ value={typedValue}
+ placeholder={`Type ${confirmKey} here`}
+ onChange={(e) => setTypedValue(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && canConfirm) onConfirm();
+ }}
+ />
+ </Field>
+ <DialogFooter>
+ <Button variant="outline" onClick={() => onOpenChange(false)}>
+ Cancel
+ </Button>
+ <Button
+ variant="danger"
+ isDisabled={!canConfirm}
+ isPending={isPending}
+ onClick={onConfirm}
+ >
+ {confirmLabel}
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ );
+};
diff --git a/frontend/src/components/v3/platform/DeleteConfirmDialog/index.ts b/frontend/src/components/v3/platform/DeleteConfirmDialog/index.ts
new file mode 100644
index 0000000000..9cef225b0c
--- /dev/null
+++ b/frontend/src/components/v3/platform/DeleteConfirmDialog/index.ts
@@ -0,0 +1 @@
+export * from "./DeleteConfirmDialog";
diff --git a/frontend/src/components/v3/platform/index.ts b/frontend/src/components/v3/platform/index.ts
index 07c4573ddd..68def838d7 100644
--- a/frontend/src/components/v3/platform/index.ts
+++ b/frontend/src/components/v3/platform/index.ts
@@ -1,4 +1,5 @@
export * from "./DateRangeFilter";
+export * from "./DeleteConfirmDialog";
export * from "./DocumentationLinkBadge";
export * from "./GatewayPicker";
export * from "./IdentityRoleBadges";
diff --git a/frontend/src/helpers/pkiSyncs.ts b/frontend/src/helpers/pkiSyncs.ts
index 47fcd68a2b..17fff2c6ea 100644
--- a/frontend/src/helpers/pkiSyncs.ts
+++ b/frontend/src/helpers/pkiSyncs.ts
@@ -125,3 +125,27 @@ export const PKI_SYNC_CONNECTION_MAP: Record<PkiSync, AppConnection> = {
[PkiSync.WindowsServer]: AppConnection.WinRM,
[PkiSync.NutanixPrismCentral]: AppConnection.NutanixPrismCentral
};
+
+export const BOOLEAN_SYNC_OPTION_FIELDS = [
+ { key: "canRemoveCertificates", label: "Remove Expired/Revoked Certificates" },
+ { key: "canImportCertificates", label: "Import Certificates" },
+ { key: "includeRootCa", label: "Include Root CA in Chain" },
+ { key: "preserveArn", label: "Preserve ARN on Renewal" },
+ { key: "enableVersioning", label: "Versioning on Renewal" },
+ { key: "preserveSecretOnRenewal", label: "Preserve Secret on Renewal" },
+ { key: "preserveItemOnRenewal", label: "Preserve Item on Renewal" },
+ { key: "updateExistingCertificates", label: "Update Existing Certificates" },
+ { key: "combineCertificateChain", label: "Combine Certificate and Chain" },
+ { key: "includePrivateKey", label: "Include Private Key" }
+] as const;
+
+export const VALUE_SYNC_OPTION_FIELDS = [
+ { key: "certificateNameSchema", label: "Certificate Name Schema" },
+ { key: "caCertificateNameSchema", label: "CA Certificate Name Schema" },
+ { key: "exportFormat", label: "Export Format" },
+ { key: "pemCertificateExtension", label: "Certificate File Extension" },
+ { key: "fileMode", label: "File Permissions" },
+ { key: "privateKeyFileMode", label: "Private Key Permissions" },
+ { key: "owner", label: "Owner" },
+ { key: "group", label: "Group" }
+] as const;
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
index 860774c833..2ef36c6276 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
@@ -174,14 +174,14 @@ export const CertManagerNav = ({
label: "Approval Policies",
icon: ShieldCheck,
pathSuffix: "approvals",
- search: { legacy: "true", selectedTab: "policies" },
+ search: { selectedTab: "policies" },
hidden: !hasLegacyPolicies
},
{
label: "Certificate Syncs",
icon: GitCompare,
pathSuffix: "integrations",
- search: { legacy: "true", selectedTab: "pki-syncs" },
+ search: { selectedTab: "pki-syncs" },
hidden: !hasLegacySyncs
}
];
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx
index 6bb098b319..a213a8bde4 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx
@@ -1,21 +1,21 @@
import { useState } from "react";
import { Helmet } from "react-helmet";
-import {
- faCheck,
- faCopy,
- faEllipsisVertical,
- faPenToSquare,
- faTrash
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, useNavigate, useParams, useSearch } from "@tanstack/react-router";
import { AxiosError } from "axios";
-import { ChevronLeftIcon } from "lucide-react";
+import {
+ CheckIcon,
+ ChevronLeftIcon,
+ CopyIcon,
+ MoreHorizontalIcon,
+ PencilIcon,
+ Trash2Icon
+} from "lucide-react";
import { createNotification } from "@app/components/notifications";
-import { AccessRestrictedBanner, DeleteActionModal, PageHeader } from "@app/components/v2";
+import { AccessRestrictedBanner, PageHeader } from "@app/components/v2";
import {
Button,
+ DeleteConfirmDialog,
DocumentationLinkBadge,
DropdownMenu,
DropdownMenuContent,
@@ -51,6 +51,36 @@ import { ApplicationRequestsTab } from "./components/ApplicationRequestsTab";
import { ApplicationSettingsTab } from "./components/ApplicationSettingsTab";
import { ApplicationSyncsTab } from "./components/ApplicationSyncsTab";
+type PermissionedTabProps = {
+ value: string;
+ label: string;
+ isBlocked: boolean;
+ blockedReason: string;
+};
+
+const PermissionedTab = ({ value, label, isBlocked, blockedReason }: PermissionedTabProps) => {
+ if (!isBlocked) {
+ return (
+ <TabsTrigger value={value} className="flex-none">
+ {label}
+ </TabsTrigger>
+ );
+ }
+
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="inline-flex">
+ <TabsTrigger value={value} disabled className="flex-none">
+ {label}
+ </TabsTrigger>
+ </span>
+ </TooltipTrigger>
+ <TooltipContent>{blockedReason}</TooltipContent>
+ </Tooltip>
+ );
+};
+
export const ApplicationDetailsByIDPage = () => {
const params = useParams({ strict: false }) as {
applicationName?: string;
@@ -195,21 +225,21 @@ export const ApplicationDetailsByIDPage = () => {
>
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <Button variant="outline" size="xs">
- <FontAwesomeIcon icon={faEllipsisVertical} />
+ <Button variant="outline">
+ <MoreHorizontalIcon />
Options
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" sideOffset={2}>
<DropdownMenuItem onClick={handleCopyId}>
- <FontAwesomeIcon icon={isIdCopied ? faCheck : faCopy} />
+ {isIdCopied ? <CheckIcon /> : <CopyIcon />}
Copy ID
</DropdownMenuItem>
<DropdownMenuItem
isDisabled={!canEditApplication}
onClick={() => handleEditPopUpOpen("application", application)}
>
- <FontAwesomeIcon icon={faPenToSquare} />
+ <PencilIcon />
Edit Application
</DropdownMenuItem>
<DropdownMenuItem
@@ -217,7 +247,7 @@ export const ApplicationDetailsByIDPage = () => {
isDisabled={!canDeleteApplication}
onClick={() => setIsDeleteOpen(true)}
>
- <FontAwesomeIcon icon={faTrash} />
+ <Trash2Icon />
Delete Application
</DropdownMenuItem>
</DropdownMenuContent>
@@ -242,64 +272,28 @@ export const ApplicationDetailsByIDPage = () => {
>
<TabsList variant="project" className="w-full justify-start">
{(canViewCertificates || isNonMemberAdmin) && (
- <Tooltip>
- <TooltipTrigger asChild>
- <span>
- <TabsTrigger
- value="certificates"
- disabled={isNonMemberAdmin}
- className="flex-none"
- >
- Certificate Inventory
- </TabsTrigger>
- </span>
- </TooltipTrigger>
- {isNonMemberAdmin && (
- <TooltipContent>
- You do not have permission to view certificates
- </TooltipContent>
- )}
- </Tooltip>
+ <PermissionedTab
+ value="certificates"
+ label="Certificate Inventory"
+ isBlocked={isNonMemberAdmin}
+ blockedReason="You do not have permission to view certificates"
+ />
)}
{(canViewRequests || isNonMemberAdmin) && (
- <Tooltip>
- <TooltipTrigger asChild>
- <span>
- <TabsTrigger
- value="requests"
- disabled={isNonMemberAdmin}
- className="flex-none"
- >
- Certificate Requests
- </TabsTrigger>
- </span>
- </TooltipTrigger>
- {isNonMemberAdmin && (
- <TooltipContent>
- You do not have permission to view certificate requests
- </TooltipContent>
- )}
- </Tooltip>
+ <PermissionedTab
+ value="requests"
+ label="Certificate Requests"
+ isBlocked={isNonMemberAdmin}
+ blockedReason="You do not have permission to view certificate requests"
+ />
)}
{(canViewSyncs || isNonMemberAdmin) && (
- <Tooltip>
- <TooltipTrigger asChild>
- <span>
- <TabsTrigger
- value="syncs"
- disabled={isNonMemberAdmin}
- className="flex-none"
- >
- Certificate Syncs
- </TabsTrigger>
- </span>
- </TooltipTrigger>
- {isNonMemberAdmin && (
- <TooltipContent>
- You do not have permission to view certificate syncs
- </TooltipContent>
- )}
- </Tooltip>
+ <PermissionedTab
+ value="syncs"
+ label="Certificate Syncs"
+ isBlocked={isNonMemberAdmin}
+ blockedReason="You do not have permission to view certificate syncs"
+ />
)}
<TabsTrigger value="members" className="flex-none">
Members
@@ -345,13 +339,14 @@ export const ApplicationDetailsByIDPage = () => {
</div>
</div>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={isDeleteOpen}
+ onOpenChange={setIsDeleteOpen}
title={`Delete ${application.name}?`}
- subTitle="This unattaches all Profiles, app-scoped syncs/alerts, and revokes app-only memberships. Issued certificates remain in Certificate Manager but lose their application tag."
- onChange={(open) => setIsDeleteOpen(open)}
- deleteKey="confirm"
- onDeleteApproved={handleDelete}
+ description="This unattaches all Profiles, app-scoped syncs/alerts, and revokes app-only memberships. Issued certificates remain in Certificate Manager but lose their application tag."
+ confirmKey={application.name}
+ confirmLabel="Delete Application"
+ onConfirm={handleDelete}
/>
<PkiApplicationModal popUp={editPopUp} handlePopUpToggle={handleEditPopUpToggle} />
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index b3c363ed9c..6253da7e22 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
@@ -90,16 +90,20 @@ import {
} from "@app/views/PkiAlertsV2Page/utils/pki-alert-formatters";
import { PkiDocsUrls } from "../../pki-docs-urls";
-import { ConfigureEnrollmentModal } from "./ConfigureEnrollmentModal";
+import {
+ ConfigureEnrollmentModal,
+ EnrollmentMethod,
+ METHOD_LABELS
+} from "./ConfigureEnrollmentModal";
type Props = { application: TPkiApplication; profiles: TPkiApplicationProfile[] };
const methodBadges = (p: TPkiApplicationProfile) => {
- const methods: string[] = [];
- if (p.apiConfigId) methods.push("API");
- if (p.estConfigId) methods.push("EST");
- if (p.acmeConfigId) methods.push("ACME");
- if (p.scepConfigId) methods.push("SCEP");
+ const methods: EnrollmentMethod[] = [];
+ if (p.apiConfigId) methods.push("api");
+ if (p.estConfigId) methods.push("est");
+ if (p.acmeConfigId) methods.push("acme");
+ if (p.scepConfigId) methods.push("scep");
return methods;
};
@@ -398,6 +402,12 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
const [profilesToAttach, setProfilesToAttach] = useState<{ value: string; label: string }[]>([]);
const [profileToDetach, setProfileToDetach] = useState<TPkiApplicationProfile | null>(null);
const [profileToConfigure, setProfileToConfigure] = useState<TPkiApplicationProfile | null>(null);
+ const [enrollmentMethodToOpen, setEnrollmentMethodToOpen] = useState<EnrollmentMethod>();
+
+ const openEnrollment = (profile: TPkiApplicationProfile, method?: EnrollmentMethod) => {
+ setEnrollmentMethodToOpen(method);
+ setProfileToConfigure(profile);
+ };
const { data: profileList } = useListCertificateProfiles({ limit: 100 });
const attachMutation = useAttachPkiApplicationProfiles();
@@ -607,39 +617,37 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
<TableCell>
{/* eslint-disable-next-line no-nested-ternary */}
{canConfigureEnrollment ? (
- <button
- type="button"
- onClick={() => setProfileToConfigure(p)}
- className="group -mx-2 inline-flex items-center gap-2 rounded-sm px-2 py-1 text-left transition-colors hover:bg-mineshaft-700/50"
- aria-label={
- hasMethods
- ? `Edit enrollment for ${p.profileSlug}`
- : `Configure enrollment for ${p.profileSlug}`
- }
- >
+ <div className="flex flex-wrap items-center gap-1.5">
{hasMethods ? (
- <>
- <div className="flex flex-wrap gap-1.5">
- {methods.map((m) => (
- <Badge key={m} variant="neutral">
- {m}
- </Badge>
- ))}
- </div>
- <PencilIcon className="size-3 shrink-0 text-accent opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100" />
- </>
+ methods.map((m) => (
+ <Badge key={m} variant="neutral" asChild>
+ <button
+ type="button"
+ onClick={() => openEnrollment(p, m)}
+ aria-label={`Edit ${METHOD_LABELS[m]} enrollment for ${p.profileSlug}`}
+ >
+ {METHOD_LABELS[m]}
+ </button>
+ </Badge>
+ ))
) : (
- <span className="inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-0.5 text-xs font-medium text-accent transition-colors group-hover:border-mineshaft-500 group-hover:text-foreground">
- <Settings2Icon className="size-3.5" />
- Configure
- </span>
+ <Badge variant="outline" asChild>
+ <button
+ type="button"
+ onClick={() => openEnrollment(p)}
+ aria-label={`Configure enrollment for ${p.profileSlug}`}
+ >
+ <Settings2Icon />
+ Configure
+ </button>
+ </Badge>
)}
- </button>
+ </div>
) : hasMethods ? (
<div className="flex flex-wrap gap-1.5">
{methods.map((m) => (
<Badge key={m} variant="neutral">
- {m}
+ {METHOD_LABELS[m]}
</Badge>
))}
</div>
@@ -657,7 +665,7 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
</DropdownMenuTrigger>
<DropdownMenuContent className="min-w-48" align="end" sideOffset={2}>
{canConfigureEnrollment ? (
- <DropdownMenuItem onClick={() => setProfileToConfigure(p)}>
+ <DropdownMenuItem onClick={() => openEnrollment(p)}>
<PencilIcon />
Configure Enrollment
</DropdownMenuItem>
@@ -896,10 +904,14 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
<ConfigureEnrollmentModal
isOpen={Boolean(profileToConfigure)}
onOpenChange={(open) => {
- if (!open) setProfileToConfigure(null);
+ if (!open) {
+ setProfileToConfigure(null);
+ setEnrollmentMethodToOpen(undefined);
+ }
}}
applicationId={application.id}
profile={profileToConfigure}
+ initialMethod={enrollmentMethodToOpen}
/>
</div>
);
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
index ffdcc19c16..4c59c9510d 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
@@ -69,6 +69,7 @@ type Props = {
onOpenChange: (open: boolean) => void;
applicationId: string;
profile: TPkiApplicationProfile | null;
+ initialMethod?: EnrollmentMethod;
};
const errorText = (err: unknown, fallback: string) =>
@@ -262,20 +263,20 @@ const ApiPanel = ({
control={control}
name="autoRenew"
render={({ field }) => (
- <div className="flex items-start justify-between gap-4">
- <div>
+ <Field orientation="horizontal">
+ <FieldContent>
<Label>Auto-renew</Label>
- <p className="text-xs text-accent">
+ <FieldDescription>
Automatically renew certificates issued via this profile before they expire.
- </p>
- </div>
+ </FieldDescription>
+ </FieldContent>
<Switch
variant="project"
id="api-auto-renew"
checked={field.value}
onCheckedChange={field.onChange}
/>
- </div>
+ </Field>
)}
/>
{autoRenew && (
@@ -445,20 +446,20 @@ const EstPanel = ({
control={control}
name="disableBootstrapCaValidation"
render={({ field }) => (
- <div className="flex items-start justify-between gap-4">
- <div>
- <FieldLabel>Disable bootstrap CA validation</FieldLabel>
- <p className="text-xs text-accent">
+ <Field orientation="horizontal">
+ <FieldContent>
+ <Label>Disable bootstrap CA validation</Label>
+ <FieldDescription>
Allow EST clients to skip server-certificate validation during enrollment.
- </p>
- </div>
+ </FieldDescription>
+ </FieldContent>
<Switch
variant="project"
id="est-disable-bootstrap"
checked={field.value}
onCheckedChange={field.onChange}
/>
- </div>
+ </Field>
)}
/>
</SectionCard>
@@ -630,13 +631,13 @@ const AcmePanel = ({
control={control}
name="skipDnsOwnershipVerification"
render={({ field }) => (
- <div className="flex items-start justify-between gap-4">
- <div>
- <FieldLabel>Skip DNS ownership verification</FieldLabel>
- <p className="text-xs text-accent">
+ <Field orientation="horizontal">
+ <FieldContent>
+ <Label>Skip DNS ownership verification</Label>
+ <FieldDescription>
Skip DNS-01 / HTTP-01 challenge enforcement during enrollment.
- </p>
- </div>
+ </FieldDescription>
+ </FieldContent>
{skipEab ? (
<Tooltip>
<TooltipTrigger asChild>
@@ -669,20 +670,20 @@ const AcmePanel = ({
}}
/>
)}
- </div>
+ </Field>
)}
/>
<Controller
control={control}
name="skipEabBinding"
render={({ field }) => (
- <div className="flex items-start justify-between gap-4">
- <div>
- <FieldLabel>Skip EAB binding</FieldLabel>
- <p className="text-xs text-accent">
+ <Field orientation="horizontal">
+ <FieldContent>
+ <Label>Skip EAB binding</Label>
+ <FieldDescription>
Allow ACME accounts to register without providing an EAB key.
- </p>
- </div>
+ </FieldDescription>
+ </FieldContent>
{skipDns ? (
<Tooltip>
<TooltipTrigger asChild>
@@ -715,7 +716,7 @@ const AcmePanel = ({
}}
/>
)}
- </div>
+ </Field>
)}
/>
</SectionCard>
@@ -974,40 +975,40 @@ const ScepPanel = ({
control={control}
name="includeCaCertInResponse"
render={({ field }) => (
- <div className="flex items-start justify-between gap-4">
- <div>
- <FieldLabel>Include CA cert in response</FieldLabel>
- <p className="text-xs text-accent">
+ <Field orientation="horizontal">
+ <FieldContent>
+ <Label>Include CA cert in response</Label>
+ <FieldDescription>
Return the issuing CA certificate inline alongside the issued cert.
- </p>
- </div>
+ </FieldDescription>
+ </FieldContent>
<Switch
variant="project"
id="scep-include-ca"
checked={field.value}
onCheckedChange={field.onChange}
/>
- </div>
+ </Field>
)}
/>
<Controller
control={control}
name="allowCertBasedRenewal"
render={({ field }) => (
- <div className="flex items-start justify-between gap-4">
- <div>
- <FieldLabel>Allow cert-based renewal</FieldLabel>
- <p className="text-xs text-accent">
+ <Field orientation="horizontal">
+ <FieldContent>
+ <Label>Allow cert-based renewal</Label>
+ <FieldDescription>
Let clients renew using their existing certificate as authentication.
- </p>
- </div>
+ </FieldDescription>
+ </FieldContent>
<Switch
variant="project"
id="scep-cert-renewal"
checked={field.value}
onCheckedChange={field.onChange}
/>
- </div>
+ </Field>
)}
/>
</SectionCard>
@@ -1027,9 +1028,9 @@ const ScepPanel = ({
);
};
-type EnrollmentMethod = "api" | "est" | "acme" | "scep";
+export type EnrollmentMethod = "api" | "est" | "acme" | "scep";
-const METHOD_LABELS: Record<EnrollmentMethod, string> = {
+export const METHOD_LABELS: Record<EnrollmentMethod, string> = {
api: "API",
est: "EST",
acme: "ACME",
@@ -1077,7 +1078,8 @@ export const ConfigureEnrollmentModal = ({
isOpen,
onOpenChange,
applicationId,
- profile
+ profile,
+ initialMethod
}: Props) => {
const profileId = profile?.profileId ?? "";
const { data, isLoading } = useGetPkiApplicationEnrollment(applicationId, profileId);
@@ -1088,20 +1090,20 @@ export const ConfigureEnrollmentModal = ({
if (data?.acmeConfigured) configuredMethods.push("acme");
if (data?.scepConfigured) configuredMethods.push("scep");
- const [pendingMethod, setPendingMethod] = useState<EnrollmentMethod | null>(null);
+ const [pendingMethods, setPendingMethods] = useState<EnrollmentMethod[]>([]);
const [activeTab, setActiveTab] = useState<EnrollmentMethod | "">("");
const ALL_ORDER: EnrollmentMethod[] = ["api", "est", "acme", "scep"];
const visibleMethods = ALL_ORDER.filter(
- (m) => configuredMethods.includes(m) || pendingMethod === m
+ (m) => configuredMethods.includes(m) || pendingMethods.includes(m)
);
const addableMethods = ALL_ORDER.filter(
- (m) => !configuredMethods.includes(m) && pendingMethod !== m
+ (m) => !configuredMethods.includes(m) && !pendingMethods.includes(m)
);
useEffect(() => {
if (!isOpen) {
- setPendingMethod(null);
+ setPendingMethods([]);
setActiveTab("");
}
}, [isOpen, profileId]);
@@ -1112,18 +1114,18 @@ export const ConfigureEnrollmentModal = ({
return;
}
if (!activeTab || !visibleMethods.includes(activeTab as EnrollmentMethod)) {
- setActiveTab(visibleMethods[0]);
+ setActiveTab(
+ initialMethod && visibleMethods.includes(initialMethod) ? initialMethod : visibleMethods[0]
+ );
}
- }, [visibleMethods, activeTab]);
+ }, [visibleMethods, activeTab, initialMethod]);
useEffect(() => {
- if (pendingMethod && configuredMethods.includes(pendingMethod)) {
- setPendingMethod(null);
- }
- }, [pendingMethod, data]);
+ setPendingMethods((prev) => prev.filter((m) => !configuredMethods.includes(m)));
+ }, [data]);
const handleAdd = (method: EnrollmentMethod) => {
- setPendingMethod(method);
+ setPendingMethods((prev) => (prev.includes(method) ? prev : [...prev, method]));
setActiveTab(method);
};
@@ -1158,6 +1160,9 @@ export const ConfigureEnrollmentModal = ({
{visibleMethods.map((m) => (
<Tab key={m} value={m}>
{METHOD_LABELS[m]}
+ {pendingMethods.includes(m) && (
+ <span className="ml-1.5 text-xs text-muted">(not enabled)</span>
+ )}
</Tab>
))}
</TabList>
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx
index dc93fbf447..c42b5d1f15 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx
@@ -104,7 +104,7 @@ export const CaSection = () => {
isDisabled={!isAllowed}
>
<PlusIcon />
- Create CA
+ Create Internal CA
</Button>
)}
</ProjectPermissionCan>
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaFields/schema.ts b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaFields/schema.ts
index b146cd8431..d2a371e184 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaFields/schema.ts
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaFields/schema.ts
@@ -17,15 +17,19 @@ const baseSchema = z.object({
const acmeConfigurationSchema = z
.object({
dnsAppConnection: z.object({
- id: z.string(),
+ id: z.string().min(1, "DNS Connection is required"),
name: z.string()
}),
dnsProviderConfig: z.object({
provider: z.nativeEnum(AcmeDnsProvider),
- hostedZoneId: z.string()
+ hostedZoneId: z.string().trim().min(1, "Hosted Zone ID is required")
}),
- directoryUrl: z.string(),
- accountEmail: z.string(),
+ directoryUrl: z.string().trim().min(1, "Directory URL is required").url("Must be a valid URL"),
+ accountEmail: z
+ .string()
+ .trim()
+ .min(1, "Account Email is required")
+ .email("Must be a valid email address"),
eabKid: z.string().optional(),
eabHmacKey: z.string().optional(),
dnsResolver: z
@@ -48,7 +52,7 @@ const acmeConfigurationSchema = z
const azureAdCsConfigurationSchema = z.object({
azureAdcsConnection: z.object({
- id: z.string(),
+ id: z.string().min(1, "Azure ADCS Connection is required"),
name: z.string()
})
});
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
index d38c8b6f88..81fa79fb0a 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
@@ -7,6 +7,7 @@ import { createNotification } from "@app/components/notifications";
import {
Button,
Field,
+ FieldDescription,
FieldError,
FieldLabel,
Input,
@@ -823,8 +824,11 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
<SheetHeader className="border-b border-border">
{showGrid ? (
<>
- <SheetTitle>Create External CA</SheetTitle>
- <SheetDescription>Select the certificate authority to connect to.</SheetDescription>
+ <SheetTitle>Connect External CA</SheetTitle>
+ <SheetDescription>
+ Select the third-party certificate authority to connect to. Infisical issues through
+ it rather than hosting the signing key.
+ </SheetDescription>
</>
) : (
<>
@@ -901,6 +905,11 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
disabled={Boolean(ca)}
isError={Boolean(error)}
/>
+ {!error && (
+ <FieldDescription>
+ Must be slug-friendly: lowercase letters, numbers, and hyphens only.
+ </FieldDescription>
+ )}
<FieldError errors={[error]} />
</Field>
)}
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx
index 1106dd177c..f3f5a166a6 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx
@@ -93,7 +93,7 @@ export const ExternalCaSection = () => {
isDisabled={!isAllowed}
>
<PlusIcon />
- Create CA
+ Create External CA
</Button>
)}
</ProjectPermissionCan>
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx
index 74bb7af97b..799d248a06 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx
@@ -19,6 +19,7 @@ import {
FieldDescription,
FieldError,
FieldLabel,
+ IconButton,
Input,
Select,
SelectContent,
@@ -970,15 +971,14 @@ export const CertificateIssuanceModal = ({
/>
)}
/>
- <Button
+ <IconButton
type="button"
variant="ghost"
- size="sm"
aria-label="Remove metadata entry"
onClick={() => removeMetadata(index)}
>
- <Trash2 className="size-4" />
- </Button>
+ <Trash2 />
+ </IconButton>
</div>
))}
<Button
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/SubjectAltNamesField.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/SubjectAltNamesField.tsx
index 6b4ee35d78..e7ec09d399 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/SubjectAltNamesField.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/SubjectAltNamesField.tsx
@@ -6,6 +6,7 @@ import {
Field,
FieldError,
FieldLabel,
+ IconButton,
Input,
Select,
SelectContent,
@@ -80,14 +81,14 @@ export const SubjectAltNamesField = ({
placeholder={getSanPlaceholder(san.type)}
className="flex-1"
/>
- <Button
+ <IconButton
type="button"
variant="ghost"
- size="sm"
+ aria-label="Remove entry"
onClick={() => onChange(currentValues.filter((_, i) => i !== index))}
>
- <Trash2 className="size-4" />
- </Button>
+ <Trash2 />
+ </IconButton>
</div>
))}
<Button
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/SubjectAttributesField.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/SubjectAttributesField.tsx
index c1b833cb77..591a455a1a 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/SubjectAttributesField.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/SubjectAttributesField.tsx
@@ -6,6 +6,7 @@ import {
Field,
FieldError,
FieldLabel,
+ IconButton,
Input,
Select,
SelectContent,
@@ -127,14 +128,14 @@ export const SubjectAttributesField = ({
placeholder={getSubjectAttributePlaceholder(attr.type)}
className="flex-1"
/>
- <Button
+ <IconButton
type="button"
variant="ghost"
- size="sm"
+ aria-label="Remove entry"
onClick={() => onChange(currentValues.filter((_, i) => i !== index))}
>
- <Trash2 className="size-4" />
- </Button>
+ <Trash2 />
+ </IconButton>
</div>
);
})}
diff --git a/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx b/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx
index 9919699ebe..fa4ba9c3e2 100644
--- a/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx
+++ b/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx
@@ -1,22 +1,18 @@
-import { useCallback, useMemo } from "react";
-import {
- faCalendarCheck,
- faCheck,
- faCopy,
- faDownload,
- faEllipsisV,
- faEraser,
- faInfoCircle,
- faRotate,
- faToggleOff,
- faToggleOn,
- faTrash,
- faXmark
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { useCallback } from "react";
import { useNavigate } from "@tanstack/react-router";
-import { format } from "date-fns";
-import { BanIcon } from "lucide-react";
+import {
+ BanIcon,
+ CheckIcon,
+ CopyIcon,
+ DownloadIcon,
+ EraserIcon,
+ InfoIcon,
+ MoreHorizontalIcon,
+ RotateCwIcon,
+ ToggleLeftIcon,
+ ToggleRightIcon,
+ Trash2Icon
+} from "lucide-react";
import { twMerge } from "tailwind-merge";
import { createNotification } from "@app/components/notifications";
@@ -26,13 +22,18 @@ import {
PkiSyncStatusBadge
} from "@app/components/pki-syncs";
import {
+ Badge,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Tooltip
-} from "@app/components/v2";
-import { Badge, IconButton, TableCell, TableRow } from "@app/components/v3";
+ IconButton,
+ TableCell,
+ TableRow,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization } from "@app/context";
import { PKI_SYNC_MAP } from "@app/helpers/pkiSyncs";
@@ -105,20 +106,6 @@ export const PkiSyncRow = ({
setTimeout(() => setIsIdCopied.off(), 2000);
}, [id, setIsIdCopied]);
- const failureMessage = useMemo(() => {
- if (syncStatus === PkiSyncStatus.Failed) {
- if (lastSyncMessage)
- try {
- return JSON.stringify(JSON.parse(lastSyncMessage), null, 2);
- } catch {
- return lastSyncMessage;
- }
-
- return "An Unknown Error Occurred.";
- }
- return null;
- }, [syncStatus, lastSyncMessage]);
-
const destinationDetails = PKI_SYNC_MAP[destination];
const destinationName = destinationDetails.name;
@@ -139,8 +126,8 @@ export const PkiSyncRow = ({
});
}}
className={twMerge(
- "group h-14 transition-colors duration-100 hover:bg-mineshaft-700 [&>td]:py-2",
- syncStatus === PkiSyncStatus.Failed && "bg-red/5 hover:bg-red/10",
+ "group h-14 transition-colors duration-100 [&>td]:py-2",
+ syncStatus === PkiSyncStatus.Failed && "bg-danger/5 hover:bg-danger/10",
canReadSync ? "cursor-pointer" : "cursor-not-allowed"
)}
key={`sync-${id}`}
@@ -157,12 +144,11 @@ export const PkiSyncRow = ({
<div className="flex w-full items-center">
<p className="truncate">{name}</p>
{description && (
- <Tooltip content={description}>
- <FontAwesomeIcon
- icon={faInfoCircle}
- size="xs"
- className="ml-1 text-mineshaft-400"
- />
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <InfoIcon className="ml-1 size-3.5 text-muted" />
+ </TooltipTrigger>
+ <TooltipContent>{description}</TooltipContent>
</Tooltip>
)}
{!applicationId && (
@@ -178,64 +164,33 @@ export const PkiSyncRow = ({
<TableCell>
<div className="flex items-center gap-1">
{syncStatus ? (
- <Tooltip
- position="left"
- className="max-w-sm"
- content={
- [PkiSyncStatus.Succeeded, PkiSyncStatus.Failed].includes(syncStatus) ? (
- <div className="flex flex-col gap-2 py-1 whitespace-normal">
- {lastSyncedAt && (
- <div>
- <div
- className={`mb-2 flex self-start ${syncStatus === PkiSyncStatus.Failed ? "text-yellow" : "text-green"}`}
- >
- <FontAwesomeIcon
- icon={faCalendarCheck}
- className="ml-1 pt-0.5 pr-1.5 text-sm"
- />
- <div className="text-xs">Last Synced</div>
- </div>
- <div className="rounded-sm bg-mineshaft-600 p-2 text-xs">
- {format(new Date(lastSyncedAt), "yyyy-MM-dd, hh:mm aaa")}
- </div>
- </div>
- )}
- {failureMessage && (
- <div>
- <div className="mb-2 flex self-start text-red">
- <FontAwesomeIcon icon={faXmark} className="ml-1 pt-0.5 pr-1.5 text-sm" />
- <div className="text-xs">Failure Reason</div>
- </div>
- <div className="rounded-sm bg-mineshaft-600 p-2 text-xs break-words">
- {failureMessage}
- </div>
- </div>
- )}
- </div>
- ) : undefined
- }
- >
- <div>
- <PkiSyncStatusBadge status={syncStatus} />
- </div>
- </Tooltip>
+ <PkiSyncStatusBadge
+ status={syncStatus}
+ lastSyncedAt={lastSyncedAt}
+ lastSyncMessage={lastSyncMessage}
+ />
) : (
- <Tooltip
- className="text-xs"
- content="This sync has not run yet. No certificates have been pushed to the destination."
- >
- <Badge variant="neutral">Not Synced</Badge>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Badge variant="neutral">Not Synced</Badge>
+ </TooltipTrigger>
+ <TooltipContent className="text-xs">
+ This sync has not run yet. No certificates have been pushed to the destination.
+ </TooltipContent>
</Tooltip>
)}
{!isAutoSyncEnabled && (
- <Tooltip
- className="text-xs"
- content="Auto-Sync is disabled. Certificate changes in this application will not be automatically synced to the destination."
- >
- <Badge variant="neutral">
- <BanIcon />
- Auto-Sync Disabled
- </Badge>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Badge variant="neutral">
+ <BanIcon />
+ {!syncStatus && "Auto-Sync Disabled"}
+ </Badge>
+ </TooltipTrigger>
+ <TooltipContent className="text-xs">
+ Auto-Sync is disabled. Certificate changes in this application will not be
+ automatically synced to the destination.
+ </TooltipContent>
</Tooltip>
)}
{syncOption?.canImportCertificates && <PkiSyncImportStatusBadge mini pkiSync={pkiSync} />}
@@ -246,98 +201,110 @@ export const PkiSyncRow = ({
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton variant="ghost" size="xs" aria-label="Options">
- <FontAwesomeIcon icon={faEllipsisV} />
+ <MoreHorizontalIcon />
</IconButton>
</DropdownMenuTrigger>
<DropdownMenuContent sideOffset={2} align="end">
<DropdownMenuItem
- icon={<FontAwesomeIcon icon={isIdCopied ? faCheck : faCopy} />}
onClick={(e) => {
e.stopPropagation();
handleCopyId();
}}
>
+ {isIdCopied ? <CheckIcon /> : <CopyIcon />}
Copy Sync ID
</DropdownMenuItem>
<DropdownMenuItem
- icon={<FontAwesomeIcon icon={faRotate} />}
onClick={(e) => {
e.stopPropagation();
onTriggerSyncCertificates(pkiSync);
}}
isDisabled={!canTriggerSync}
>
- <Tooltip
- position="left"
- sideOffset={42}
- content={`Manually trigger a sync for this ${destinationName} destination.`}
- >
- <div className="flex h-full w-full items-center justify-between gap-1">
- <span> Trigger Sync</span>
- <FontAwesomeIcon className="text-bunker-300" size="sm" icon={faInfoCircle} />
- </div>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <div className="flex w-full items-center justify-between gap-2">
+ <span className="flex items-center gap-2">
+ <RotateCwIcon />
+ Trigger Sync
+ </span>
+ <InfoIcon className="size-3.5 text-bunker-300" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent side="left" sideOffset={20}>
+ {`Manually trigger a sync for this ${destinationName} destination.`}
+ </TooltipContent>
</Tooltip>
</DropdownMenuItem>
{syncOption?.canImportCertificates && (
<DropdownMenuItem
- icon={<FontAwesomeIcon icon={faDownload} />}
onClick={(e) => {
e.stopPropagation();
onTriggerImportCertificates(pkiSync);
}}
isDisabled={!canImportCertificates}
>
- <Tooltip
- position="left"
- sideOffset={42}
- content={`Import certificates from this ${destinationName} destination into Infisical.`}
- >
- <div className="flex h-full w-full items-center justify-between gap-1">
- <span>Import Certificates</span>
- <FontAwesomeIcon className="text-bunker-300" size="sm" icon={faInfoCircle} />
- </div>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <div className="flex w-full items-center justify-between gap-2">
+ <span className="flex items-center gap-2">
+ <DownloadIcon />
+ Import Certificates
+ </span>
+ <InfoIcon className="size-3.5 text-bunker-300" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent
+ side="left"
+ sideOffset={20}
+ >{`Import certificates from this ${destinationName} destination into Infisical.`}</TooltipContent>
</Tooltip>
</DropdownMenuItem>
)}
{syncOption?.canRemoveCertificates && (
<DropdownMenuItem
- icon={<FontAwesomeIcon icon={faEraser} />}
onClick={(e) => {
e.stopPropagation();
onTriggerRemoveCertificates(pkiSync);
}}
isDisabled={!canRemoveCertificates}
>
- <Tooltip
- position="left"
- sideOffset={42}
- content={`Remove certificates synced by Infisical from this ${destinationName} destination.`}
- >
- <div className="flex h-full w-full items-center justify-between gap-1">
- <span>Remove Certificates</span>
- <FontAwesomeIcon className="text-bunker-300" size="sm" icon={faInfoCircle} />
- </div>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <div className="flex w-full items-center justify-between gap-2">
+ <span className="flex items-center gap-2">
+ <EraserIcon />
+ Remove Certificates
+ </span>
+ <InfoIcon className="size-3.5 text-bunker-300" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent
+ side="left"
+ sideOffset={20}
+ >{`Remove certificates synced by Infisical from this ${destinationName} destination.`}</TooltipContent>
</Tooltip>
</DropdownMenuItem>
)}
<DropdownMenuItem
isDisabled={!canEditSync}
- icon={<FontAwesomeIcon icon={isAutoSyncEnabled ? faToggleOff : faToggleOn} />}
onClick={(e) => {
e.stopPropagation();
onToggleEnable(pkiSync);
}}
>
+ {isAutoSyncEnabled ? <ToggleLeftIcon /> : <ToggleRightIcon />}
{isAutoSyncEnabled ? "Disable" : "Enable"} Auto-Sync
</DropdownMenuItem>
<DropdownMenuItem
+ variant="danger"
isDisabled={!canDeleteSync}
- icon={<FontAwesomeIcon icon={faTrash} />}
onClick={(e) => {
e.stopPropagation();
onDelete(pkiSync);
}}
>
+ <Trash2Icon />
Delete Sync
</DropdownMenuItem>
</DropdownMenuContent>
diff --git a/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncsTable.tsx b/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncsTable.tsx
index f59e4069b0..e55bf45ac7 100644
--- a/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncsTable.tsx
+++ b/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncsTable.tsx
@@ -1,13 +1,12 @@
import { useMemo, useState } from "react";
import {
- faCheck,
- faCheckCircle,
- faFilter,
- faRotate,
- faWarning
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { ChevronDownIcon, SearchIcon } from "lucide-react";
+ CheckCircle2Icon,
+ ChevronDownIcon,
+ FilterIcon,
+ RotateCwIcon,
+ SearchIcon,
+ TriangleAlertIcon
+} from "lucide-react";
import { twMerge } from "tailwind-merge";
import { createNotification } from "@app/components/notifications";
@@ -18,12 +17,10 @@ import {
} from "@app/components/pki-syncs";
import {
DropdownMenu,
+ DropdownMenuCheckboxItem,
DropdownMenuContent,
- DropdownMenuItem,
DropdownMenuLabel,
- DropdownMenuTrigger
-} from "@app/components/v2";
-import {
+ DropdownMenuTrigger,
Empty,
EmptyDescription,
EmptyHeader,
@@ -89,10 +86,10 @@ type Props = {
};
const STATUS_ICON_MAP = {
- [PkiSyncStatus.Succeeded]: { icon: faCheck, className: "text-green", name: "Synced" },
- [PkiSyncStatus.Failed]: { icon: faWarning, className: "text-red", name: "Not Synced" },
- [PkiSyncStatus.Pending]: { icon: faRotate, className: "text-yellow", name: "Syncing" },
- [PkiSyncStatus.Running]: { icon: faRotate, className: "text-yellow", name: "Syncing" }
+ [PkiSyncStatus.Succeeded]: { Icon: CheckCircle2Icon, className: "text-success", name: "Synced" },
+ [PkiSyncStatus.Failed]: { Icon: TriangleAlertIcon, className: "text-danger", name: "Not Synced" },
+ [PkiSyncStatus.Pending]: { Icon: RotateCwIcon, className: "text-warning", name: "Syncing" },
+ [PkiSyncStatus.Running]: { Icon: RotateCwIcon, className: "text-warning", name: "Syncing" }
};
export const PkiSyncsTable = ({ pkiSyncs, applicationName }: Props) => {
@@ -255,7 +252,7 @@ export const PkiSyncsTable = ({ pkiSyncs, applicationName }: Props) => {
return (
<div>
- <div className="mb-4 flex items-center gap-2">
+ <div className="mb-4 flex gap-2">
<InputGroup className="flex-1">
<InputGroupAddon>
<SearchIcon />
@@ -263,25 +260,24 @@ export const PkiSyncsTable = ({ pkiSyncs, applicationName }: Props) => {
<InputGroupInput
value={search}
onChange={(e) => setSearch(e.target.value)}
- placeholder="Search PKI syncs..."
+ placeholder="Search certificate syncs..."
/>
</InputGroup>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton
- aria-label="Filter PKI syncs"
+ aria-label="Filter certificate syncs"
variant={isTableFiltered ? "project" : "outline"}
- size="md"
- className={twMerge(isTableFiltered && "text-primary")}
>
- <FontAwesomeIcon icon={faFilter} />
+ <FilterIcon />
</IconButton>
</DropdownMenuTrigger>
<DropdownMenuContent className="max-h-[70vh] thin-scrollbar overflow-y-auto" align="end">
<DropdownMenuLabel>Status</DropdownMenuLabel>
{[PkiSyncStatus.Running, PkiSyncStatus.Succeeded, PkiSyncStatus.Failed].map(
(status) => (
- <DropdownMenuItem
+ <DropdownMenuCheckboxItem
+ checked={filters.status.includes(status)}
onClick={(e) => {
e.preventDefault();
setFilters((prev) => ({
@@ -292,21 +288,15 @@ export const PkiSyncsTable = ({ pkiSyncs, applicationName }: Props) => {
}));
}}
key={status}
- icon={
- filters.status.includes(status) && (
- <FontAwesomeIcon className="text-primary" icon={faCheckCircle} />
- )
- }
- iconPos="right"
>
<div className="flex items-center gap-2">
- <FontAwesomeIcon
- icon={STATUS_ICON_MAP[status].icon}
- className={STATUS_ICON_MAP[status].className}
- />
+ {(() => {
+ const { Icon, className } = STATUS_ICON_MAP[status];
+ return <Icon className={`size-3.5 ${className}`} />;
+ })()}
<span className="capitalize">{STATUS_ICON_MAP[status].name}</span>
</div>
- </DropdownMenuItem>
+ </DropdownMenuCheckboxItem>
)
)}
<DropdownMenuLabel>Service</DropdownMenuLabel>
@@ -315,7 +305,8 @@ export const PkiSyncsTable = ({ pkiSyncs, applicationName }: Props) => {
const { name, image } = PKI_SYNC_MAP[destination];
return (
- <DropdownMenuItem
+ <DropdownMenuCheckboxItem
+ checked={filters.destinations.includes(destination)}
onClick={(e) => {
e.preventDefault();
setFilters((prev) => ({
@@ -326,12 +317,6 @@ export const PkiSyncsTable = ({ pkiSyncs, applicationName }: Props) => {
}));
}}
key={destination}
- icon={
- filters.destinations.includes(destination) && (
- <FontAwesomeIcon className="text-primary" icon={faCheckCircle} />
- )
- }
- iconPos="right"
>
<div className="flex items-center gap-2">
<img
@@ -341,76 +326,75 @@ export const PkiSyncsTable = ({ pkiSyncs, applicationName }: Props) => {
/>
<span>{name}</span>
</div>
- </DropdownMenuItem>
+ </DropdownMenuCheckboxItem>
);
})
) : (
- <DropdownMenuItem isDisabled>No PKI Syncs Configured</DropdownMenuItem>
+ <DropdownMenuLabel className="font-normal text-mineshaft-400">
+ No Certificate Syncs Configured
+ </DropdownMenuLabel>
)}
</DropdownMenuContent>
</DropdownMenu>
</div>
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead className="w-2" />
- <TableHead
- className="w-1/2 cursor-pointer"
- onClick={() => handleSort(PkiSyncsOrderBy.Name)}
- >
- Name
- {renderSortIcon(PkiSyncsOrderBy.Name)}
- </TableHead>
- <TableHead
- className="w-1/4 cursor-pointer"
- onClick={() => handleSort(PkiSyncsOrderBy.Destination)}
- >
- Destination
- {renderSortIcon(PkiSyncsOrderBy.Destination)}
- </TableHead>
- <TableHead
- className="w-1/4 min-w-42 cursor-pointer"
- onClick={() => handleSort(PkiSyncsOrderBy.Status)}
- >
- Status
- {renderSortIcon(PkiSyncsOrderBy.Status)}
- </TableHead>
- <TableHead className="w-5" />
- </TableRow>
- </TableHeader>
- <TableBody>
- {filteredPkiSyncs.slice(offset, perPage * page).map((pkiSync) => (
- <PkiSyncRow
- key={pkiSync.id}
- pkiSync={pkiSync}
- onDelete={handleDelete}
- onTriggerSyncCertificates={handleTriggerSync}
- onTriggerImportCertificates={handleTriggerImportCertificates}
- onTriggerRemoveCertificates={handleTriggerRemoveCertificates}
- onToggleEnable={handleToggleEnableSync}
- applicationName={applicationName}
- />
- ))}
- {!filteredPkiSyncs?.length && (
+ {filteredPkiSyncs.length ? (
+ <Table>
+ <TableHeader>
<TableRow>
- <td colSpan={5} className="p-0">
- <Empty className="border-none">
- <EmptyHeader>
- <EmptyTitle>
- {pkiSyncs.length ? "No syncs match search..." : "No syncs configured yet"}
- </EmptyTitle>
- <EmptyDescription>
- {pkiSyncs.length
- ? "Try adjusting your search or filters"
- : "Create a sync to get started"}
- </EmptyDescription>
- </EmptyHeader>
- </Empty>
- </td>
+ <TableHead className="w-2" />
+ <TableHead
+ className="w-1/2 cursor-pointer"
+ onClick={() => handleSort(PkiSyncsOrderBy.Name)}
+ >
+ Name
+ {renderSortIcon(PkiSyncsOrderBy.Name)}
+ </TableHead>
+ <TableHead
+ className="w-1/4 cursor-pointer"
+ onClick={() => handleSort(PkiSyncsOrderBy.Destination)}
+ >
+ Destination
+ {renderSortIcon(PkiSyncsOrderBy.Destination)}
+ </TableHead>
+ <TableHead
+ className="w-1/4 min-w-42 cursor-pointer"
+ onClick={() => handleSort(PkiSyncsOrderBy.Status)}
+ >
+ Status
+ {renderSortIcon(PkiSyncsOrderBy.Status)}
+ </TableHead>
+ <TableHead className="w-5" />
</TableRow>
- )}
- </TableBody>
- </Table>
+ </TableHeader>
+ <TableBody>
+ {filteredPkiSyncs.slice(offset, perPage * page).map((pkiSync) => (
+ <PkiSyncRow
+ key={pkiSync.id}
+ pkiSync={pkiSync}
+ onDelete={handleDelete}
+ onTriggerSyncCertificates={handleTriggerSync}
+ onTriggerImportCertificates={handleTriggerImportCertificates}
+ onTriggerRemoveCertificates={handleTriggerRemoveCertificates}
+ onToggleEnable={handleToggleEnableSync}
+ applicationName={applicationName}
+ />
+ ))}
+ </TableBody>
+ </Table>
+ ) : (
+ <Empty className="border">
+ <EmptyHeader>
+ <EmptyTitle>
+ {pkiSyncs.length ? "No syncs match search..." : "No syncs configured yet"}
+ </EmptyTitle>
+ <EmptyDescription>
+ {pkiSyncs.length
+ ? "Try adjusting your search or filters"
+ : "Create a sync to get started"}
+ </EmptyDescription>
+ </EmptyHeader>
+ </Empty>
+ )}
{Boolean(filteredPkiSyncs.length) && (
<Pagination
count={filteredPkiSyncs.length}
diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/PkiSyncDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/PkiSyncDetailsByIDPage.tsx
index a3c848e964..576cfa2dfd 100644
--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/PkiSyncDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/PkiSyncDetailsByIDPage.tsx
@@ -103,7 +103,7 @@ const PageContent = () => {
className="mb-4 flex w-fit cursor-pointer items-center gap-x-1 text-sm text-mineshaft-400 transition duration-100 hover:text-mineshaft-400/80"
>
<ChevronLeftIcon className="size-4" />
- {applicationName ? "Back to Application" : "PKI Syncs"}
+ {applicationName ? "Back to Application" : "Certificate Syncs"}
</button>
<div className="mb-6 flex w-full items-center gap-3">
<img
diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncCertificatesSection.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncCertificatesSection.tsx
index dda2b75203..de8923f927 100644
--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncCertificatesSection.tsx
+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncCertificatesSection.tsx
@@ -1,5 +1,15 @@
import { useState } from "react";
-import { EllipsisIcon, HistoryIcon, PencilIcon, ScrollTextIcon, Trash2Icon } from "lucide-react";
+import {
+ CheckCircle2Icon,
+ CircleHelpIcon,
+ EllipsisIcon,
+ HistoryIcon,
+ PencilIcon,
+ RotateCwIcon,
+ ScrollTextIcon,
+ Trash2Icon,
+ TriangleAlertIcon
+} from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { CertificateManagementModal } from "@app/components/pki-syncs/CertificateManagementModal";
@@ -7,7 +17,6 @@ import {
CertificateDisplayName,
getCertificateDisplayName
} from "@app/components/utilities/certificateDisplayUtils";
-import { DeleteActionModal } from "@app/components/v2";
import {
Badge,
Card,
@@ -16,6 +25,7 @@ import {
CardHeader,
CardTitle,
CopyButton,
+ DeleteConfirmDialog,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -59,6 +69,14 @@ const getSyncStatusVariant = (status?: CertificateSyncStatus | null) => {
return "info";
};
+const getSyncStatusIcon = (status?: CertificateSyncStatus | null) => {
+ if (status === CertificateSyncStatus.Succeeded) return <CheckCircle2Icon />;
+ if (status === CertificateSyncStatus.Failed) return <TriangleAlertIcon />;
+ if (status === CertificateSyncStatus.Running || status === CertificateSyncStatus.Pending)
+ return <RotateCwIcon />;
+ return <CircleHelpIcon />;
+};
+
const getSyncStatusText = (status?: CertificateSyncStatus | null) => {
if (status === CertificateSyncStatus.Succeeded) return "Synced";
if (status === CertificateSyncStatus.Failed) return "Failed";
@@ -291,7 +309,7 @@ export const PkiSyncCertificatesSection = ({ pkiSync }: Props) => {
<div className="flex items-center gap-1">
<Tooltip>
<TooltipTrigger asChild>
- <span className="truncate text-xs text-muted">
+ <span className="truncate text-xs">
{syncCert.externalIdentifier}
</span>
</TooltipTrigger>
@@ -305,7 +323,7 @@ export const PkiSyncCertificatesSection = ({ pkiSync }: Props) => {
/>
</div>
) : (
- <span className="text-xs text-muted">-</span>
+ <span className="text-xs">-</span>
)}
</TableCell>
<TableCell>
@@ -314,19 +332,23 @@ export const PkiSyncCertificatesSection = ({ pkiSync }: Props) => {
<Tooltip>
<TooltipTrigger asChild>
<span className="inline-block">
- <Badge variant="danger">Failed</Badge>
+ <Badge variant="danger">
+ <TriangleAlertIcon />
+ Failed
+ </Badge>
</span>
</TooltipTrigger>
<TooltipContent>{syncCert.lastSyncMessage}</TooltipContent>
</Tooltip>
) : (
<Badge variant={getSyncStatusVariant(syncCert.syncStatus)}>
+ {getSyncStatusIcon(syncCert.syncStatus)}
{getSyncStatusText(syncCert.syncStatus)}
</Badge>
)}
</TableCell>
<TableCell>
- <span className={isExpired ? "text-danger" : "text-muted"}>
+ <span className={isExpired ? "text-danger" : undefined}>
{syncCert.certificateNotAfter
? new Date(syncCert.certificateNotAfter).toLocaleDateString()
: "Unknown"}
@@ -410,21 +432,21 @@ export const PkiSyncCertificatesSection = ({ pkiSync }: Props) => {
}}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={isDeleteModalOpen}
- onClose={() => {
- setIsDeleteModalOpen(false);
- setCertificateToDelete(null);
+ onOpenChange={(isOpen) => {
+ setIsDeleteModalOpen(isOpen);
+ if (!isOpen) setCertificateToDelete(null);
}}
title="Remove Certificate from Sync"
- subTitle={`Are you sure you want to remove "${certificateToDelete?.displayName}" from this PKI sync?`}
- deleteKey="confirm"
- onDeleteApproved={async () => {
+ description={`Are you sure you want to remove "${certificateToDelete?.displayName}" from this certificate sync?`}
+ confirmKey="confirm"
+ onConfirm={async () => {
if (certificateToDelete) {
await handleRemoveCertificate(certificateToDelete.id);
}
}}
- buttonText="Remove Certificate"
+ confirmLabel="Remove Certificate"
/>
</>
);
diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/KempLoadMasterPkiSyncDestinationSection.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/KempLoadMasterPkiSyncDestinationSection.tsx
index 53f2aac015..ee84ba7d9a 100644
--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/KempLoadMasterPkiSyncDestinationSection.tsx
+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/KempLoadMasterPkiSyncDestinationSection.tsx
@@ -1,12 +1,6 @@
+import { Detail, DetailLabel, DetailValue } from "@app/components/v3";
import { TKempLoadMasterPkiSync } from "@app/hooks/api/pkiSyncs/types/kemp-loadmaster-sync";
-const GenericFieldLabel = ({ label, children }: { label: string; children: React.ReactNode }) => (
- <div className="mb-4">
- <p className="text-sm font-medium text-mineshaft-300">{label}</p>
- <div className="text-sm text-mineshaft-300">{children}</div>
- </div>
-);
-
type Props = {
pkiSync: TKempLoadMasterPkiSync;
};
@@ -17,8 +11,9 @@ export const KempLoadMasterPkiSyncDestinationSection = ({ pkiSync }: Props) => {
}
return (
- <GenericFieldLabel label="Virtual Service">
- {pkiSync.destinationConfig.virtualServiceId}
- </GenericFieldLabel>
+ <Detail>
+ <DetailLabel>Virtual Service</DetailLabel>
+ <DetailValue>{pkiSync.destinationConfig.virtualServiceId}</DetailValue>
+ </Detail>
);
};
diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/NutanixPrismCentralPkiSyncDestinationSection.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/NutanixPrismCentralPkiSyncDestinationSection.tsx
index 87f64d146a..78c78550a0 100644
--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/NutanixPrismCentralPkiSyncDestinationSection.tsx
+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncDestinationSection/NutanixPrismCentralPkiSyncDestinationSection.tsx
@@ -1,12 +1,6 @@
+import { Detail, DetailLabel, DetailValue } from "@app/components/v3";
import { TNutanixPrismCentralPkiSync } from "@app/hooks/api/pkiSyncs/types/nutanix-prism-central-sync";
-const GenericFieldLabel = ({ label, children }: { label: string; children: React.ReactNode }) => (
- <div className="mb-4">
- <p className="text-sm font-medium text-mineshaft-300">{label}</p>
- <div className="text-sm text-mineshaft-300">{children}</div>
- </div>
-);
-
type Props = {
pkiSync: TNutanixPrismCentralPkiSync;
};
@@ -16,8 +10,14 @@ export const NutanixPrismCentralPkiSyncDestinationSection = ({ pkiSync }: Props)
return (
<>
- <GenericFieldLabel label="Cluster Name">{clusterName}</GenericFieldLabel>
- <GenericFieldLabel label="Cluster ID">{clusterId}</GenericFieldLabel>
+ <Detail>
+ <DetailLabel>Cluster Name</DetailLabel>
+ <DetailValue>{clusterName}</DetailValue>
+ </Detail>
+ <Detail>
+ <DetailLabel>Cluster ID</DetailLabel>
+ <DetailValue>{clusterId}</DetailValue>
+ </Detail>
</>
);
};
diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncOptionsSection/PkiSyncOptionsSection.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncOptionsSection/PkiSyncOptionsSection.tsx
index 806e24a9a6..6d971c11ea 100644
--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncOptionsSection/PkiSyncOptionsSection.tsx
+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/components/PkiSyncOptionsSection/PkiSyncOptionsSection.tsx
@@ -10,27 +10,17 @@ import {
DetailValue,
Separator
} from "@app/components/v3";
+import { BOOLEAN_SYNC_OPTION_FIELDS, VALUE_SYNC_OPTION_FIELDS } from "@app/helpers/pkiSyncs";
import { TPkiSync } from "@app/hooks/api/pkiSyncs";
type Props = {
pkiSync: TPkiSync;
};
-const EnabledBadge = ({ enabled }: { enabled: boolean }) => (
- <Badge variant={enabled ? "success" : "neutral"}>{enabled ? "Enabled" : "Disabled"}</Badge>
-);
+const DESTINATION_OWNED_OPTIONS = new Set<string>(["exportFormat"]);
export const PkiSyncOptionsSection = ({ pkiSync }: Props) => {
- const {
- syncOptions: {
- canRemoveCertificates,
- certificateNameSchema,
- preserveArn,
- enableVersioning,
- preserveItemOnRenewal,
- updateExistingCertificates
- }
- } = pkiSync;
+ const syncOptions = pkiSync.syncOptions as Record<string, unknown> | undefined;
return (
<>
@@ -40,54 +30,38 @@ export const PkiSyncOptionsSection = ({ pkiSync }: Props) => {
<AccordionTrigger>Sync Options</AccordionTrigger>
<AccordionContent>
<DetailGroup>
- <Detail>
- <DetailLabel>Inactive Certificate Removal</DetailLabel>
- <DetailValue>
- <EnabledBadge enabled={canRemoveCertificates} />
- </DetailValue>
- </Detail>
- {certificateNameSchema && (
- <Detail>
- <DetailLabel>Certificate Name Schema</DetailLabel>
- <DetailValue>
- <Badge variant="neutral" className="max-w-full truncate">
- {certificateNameSchema}
- </Badge>
- </DetailValue>
- </Detail>
- )}
- {preserveArn !== undefined && (
- <Detail>
- <DetailLabel>Preserve ARN</DetailLabel>
- <DetailValue>
- <EnabledBadge enabled={preserveArn} />
- </DetailValue>
- </Detail>
- )}
- {enableVersioning !== undefined && (
- <Detail>
- <DetailLabel>Versioning</DetailLabel>
- <DetailValue>
- <EnabledBadge enabled={enableVersioning} />
- </DetailValue>
- </Detail>
- )}
- {preserveItemOnRenewal !== undefined && (
- <Detail>
- <DetailLabel>Preserve Item on Renewal</DetailLabel>
- <DetailValue>
- <EnabledBadge enabled={preserveItemOnRenewal} />
- </DetailValue>
- </Detail>
- )}
- {updateExistingCertificates !== undefined && (
- <Detail>
- <DetailLabel>Update Existing Certificates</DetailLabel>
- <DetailValue>
- <EnabledBadge enabled={updateExistingCertificates} />
- </DetailValue>
- </Detail>
- )}
+ {BOOLEAN_SYNC_OPTION_FIELDS.map(({ key, label }) => {
+ const value = syncOptions?.[key];
+ if (typeof value !== "boolean") return null;
+
+ return (
+ <Detail key={key}>
+ <DetailLabel>{label}</DetailLabel>
+ <DetailValue>
+ <Badge variant={value ? "success" : "neutral"}>
+ {value ? "Enabled" : "Disabled"}
+ </Badge>
+ </DetailValue>
+ </Detail>
+ );
+ })}
+ {VALUE_SYNC_OPTION_FIELDS.map(({ key, label }) => {
+ if (DESTINATION_OWNED_OPTIONS.has(key)) return null;
+
+ const value = syncOptions?.[key];
+ if (value === undefined || value === null || value === "") return null;
+
+ return (
+ <Detail key={key}>
+ <DetailLabel>{label}</DetailLabel>
+ <DetailValue>
+ <Badge variant="neutral" className="max-w-full truncate">
+ {String(value)}
+ </Badge>
+ </DetailValue>
+ </Detail>
+ );
+ })}
</DetailGroup>
</AccordionContent>
</AccordionItem>
diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/route.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/route.tsx
index dca8def99f..4b1292468d 100644
--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/route.tsx
+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/route.tsx
@@ -20,7 +20,7 @@ export const Route = createFileRoute(
breadcrumbs: [
...context.breadcrumbs,
{
- label: "Integrations",
+ label: "Certificate Syncs",
link: linkOptions({
to: "/organizations/$orgId/projects/cert-manager/$projectId/integrations",
params,
@@ -30,7 +30,7 @@ export const Route = createFileRoute(
})
},
{
- label: "PKI Sync"
+ label: "Certificate Sync"
}
]
};
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificatePolicyOption.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificatePolicyOption.tsx
index 18fbeebec3..df1d4c8494 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificatePolicyOption.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificatePolicyOption.tsx
@@ -1,7 +1,5 @@
import { components, OptionProps } from "react-select";
-import { faCheckCircle } from "@fortawesome/free-regular-svg-icons";
-import { faPlus } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { CheckIcon, PlusIcon } from "lucide-react";
import { TCertificatePolicy } from "@app/hooks/api/certificatePolicies";
@@ -16,21 +14,17 @@ export const CertificatePolicyOption = ({
return (
<components.Option isSelected={isSelected} {...props}>
- <div className="flex items-center">
- {isCreateOption ? (
- <div className="flex items-center gap-x-1 text-mineshaft-400">
- <FontAwesomeIcon icon={faPlus} size="sm" />
- <span>Add Certificate Policy</span>
- </div>
- ) : (
- <>
- <p className="mr-auto truncate">{children}</p>
- {isSelected && (
- <FontAwesomeIcon className="ml-2 text-primary" icon={faCheckCircle} size="sm" />
- )}
- </>
- )}
- </div>
+ {isCreateOption ? (
+ <div className="flex cursor-pointer flex-row items-center gap-x-1.5 text-muted">
+ <PlusIcon className="size-4 shrink-0" />
+ <span>Add Certificate Policy</span>
+ </div>
+ ) : (
+ <div className="flex cursor-pointer flex-row items-center justify-between">
+ <p className="truncate">{children}</p>
+ {isSelected && <CheckIcon className="ml-2 size-4 shrink-0" />}
+ </div>
+ )}
</components.Option>
);
};
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificateProfilesTab.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificateProfilesTab.tsx
index aabb331bf5..b2f47dd055 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificateProfilesTab.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificateProfilesTab.tsx
@@ -4,7 +4,6 @@ import { PlusIcon } from "lucide-react";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { DeleteActionModal } from "@app/components/v2";
import {
Button,
Card,
@@ -13,6 +12,7 @@ import {
CardDescription,
CardHeader,
CardTitle,
+ DeleteConfirmDialog,
DocumentationLinkBadge
} from "@app/components/v3";
import {
@@ -137,17 +137,19 @@ export const CertificateProfilesTab = () => {
mode="clone"
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={isDeleteModalOpen}
- title={`Delete Certificate Profile ${selectedProfile.slug}?`}
- onChange={(isOpen) => {
+ onOpenChange={(isOpen) => {
setIsDeleteModalOpen(isOpen);
if (!isOpen) {
setSelectedProfile(null);
}
}}
- deleteKey={selectedProfile.slug}
- onDeleteApproved={handleDeleteConfirm}
+ title={`Delete Certificate Profile ${selectedProfile.slug}?`}
+ description="This permanently removes the profile. Certificates already issued from it are not affected."
+ confirmKey={selectedProfile.slug}
+ confirmLabel="Delete Profile"
+ onConfirm={handleDeleteConfirm}
/>
</>
)}
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx
index db40d2945d..92d3cac1ed 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx
@@ -476,7 +476,6 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
const queryClient = useQueryClient();
const [selectedStepIndex, setSelectedStepIndex] = useState(0);
- const currentStep = STEPS[selectedStepIndex];
const canCreatePolicy = permission.can(
ProjectPermissionCertificatePolicyActions.Create,
@@ -494,7 +493,10 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
const isEdit = mode === "edit" && profile;
const isClone = mode === "clone" && profile;
- const isFinalStep = selectedStepIndex === STEPS.length - 1;
+
+ const steps = useMemo(() => (isEdit ? STEPS.filter((s) => s.key !== "issuer") : STEPS), [isEdit]);
+ const currentStep = steps[selectedStepIndex];
+ const isFinalStep = selectedStepIndex === steps.length - 1;
const certificateAuthorities = (allCaData || []).map((ca) => ({
...ca,
@@ -726,7 +728,16 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
}
let effectiveDefaults = data.defaults;
- if (effectiveDefaults) {
+ if (effectiveDefaults && (isAzureAdcsCa || isAdcsCa)) {
+ const adcsSafeDefaults = { ...effectiveDefaults };
+ delete adcsSafeDefaults.ttlDays;
+ delete adcsSafeDefaults.signatureAlgorithm;
+ delete adcsSafeDefaults.keyUsages;
+ delete adcsSafeDefaults.extendedKeyUsages;
+ delete adcsSafeDefaults.basicConstraints;
+ effectiveDefaults = adcsSafeDefaults;
+ }
+ if (effectiveDefaults && !(isAzureAdcsCa || isAdcsCa)) {
const nextDefaults = { ...effectiveDefaults };
if (policyConstraints.requiredKeyUsages.length) {
const keyUsages = { ...(nextDefaults.keyUsages || {}) };
@@ -800,15 +811,21 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
};
const isStepValid = async (index: number) => {
- const { fields } = STEPS[index];
+ const { fields } = steps[index];
if (fields.length === 0) return true;
return trigger(fields as any);
};
const goNext = async () => {
const isValid = await isStepValid(selectedStepIndex);
- if (!isValid) return;
- setSelectedStepIndex((prev) => Math.min(prev + 1, STEPS.length - 1));
+ if (!isValid) {
+ createNotification({
+ text: "Please fix the highlighted fields before continuing.",
+ type: "error"
+ });
+ return;
+ }
+ setSelectedStepIndex((prev) => Math.min(prev + 1, steps.length - 1));
};
const goBack = () => {
@@ -877,7 +894,7 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
}}
>
<StepperList>
- {STEPS.map((s, i) => (
+ {steps.map((s, i) => (
<StepperStep
key={s.key}
index={i}
@@ -895,7 +912,7 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
<p className="mt-1 text-sm text-muted">{currentStep.subtitle}</p>
</div>
- {selectedStepIndex === 0 && (
+ {currentStep.key === "details" && (
<div className="space-y-5">
<Controller
control={control}
@@ -939,7 +956,7 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
</div>
)}
- {selectedStepIndex === 1 && (
+ {currentStep.key === "issuer" && (
<div className="space-y-5">
<Controller
control={control}
@@ -952,7 +969,6 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
<FieldContent>
<Select
value={value}
- disabled={Boolean(isEdit)}
onValueChange={(next) => {
if (next === IssuerType.SELF_SIGNED) {
setValue("certificateAuthorityId", "");
@@ -1013,7 +1029,6 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
groupBy={hasCas ? "groupType" : undefined}
getGroupHeaderLabel={hasCas ? getGroupHeaderLabel : undefined}
placeholder="Select a certificate authority"
- isDisabled={Boolean(isEdit)}
isError={Boolean(error)}
className="w-full"
/>
@@ -1084,7 +1099,6 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
? "No certificate policies available"
: "Select a certificate policy"
}
- isDisabled={Boolean(isEdit)}
isError={Boolean(error)}
components={{ Option: CertificatePolicyOption }}
className="w-full"
@@ -1102,13 +1116,14 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
</div>
)}
- {selectedStepIndex === 2 && (
+ {currentStep.key === "certificate-defaults" && (
<ProfileDefaultsStep
control={control}
watch={watch}
setValue={setValue}
policyConstraints={policyConstraints}
isAwsAcmPublicCa={isAwsAcmPublicCa}
+ isExternalAdcsCa={isAzureAdcsCa || isAdcsCa}
/>
)}
</div>
@@ -1133,7 +1148,7 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
<span className="text-xs text-muted" />
<div className="flex items-center gap-3">
<span className="text-xs text-muted">
- Step {selectedStepIndex + 1} of {STEPS.length}
+ Step {selectedStepIndex + 1} of {steps.length}
</span>
{selectedStepIndex > 0 && (
<Button type="button" variant="outline" onClick={goBack}>
@@ -1149,7 +1164,7 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }
isDisabled={isSubmitting}
onClick={handleSubmit(onFormSubmit, (errors) => {
const errorKeys = Object.keys(errors);
- const stepIndex = STEPS.findIndex((s) =>
+ const stepIndex = steps.findIndex((s) =>
s.fields.some((fld) => errorKeys.includes(fld))
);
if (stepIndex >= 0) setSelectedStepIndex(stepIndex);
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal/ProfileDefaultsStep.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal/ProfileDefaultsStep.tsx
index bd9718abdc..458c177313 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal/ProfileDefaultsStep.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal/ProfileDefaultsStep.tsx
@@ -14,6 +14,7 @@ import {
FieldDescription,
FieldError,
FieldLabel,
+ IconButton,
Input,
Select,
SelectContent,
@@ -153,14 +154,14 @@ const AttributeListEditor = <T extends string>({
onItemsChange(next);
}}
/>
- <Button
+ <IconButton
type="button"
variant="ghost"
- size="sm"
+ aria-label="Remove entry"
onClick={() => onItemsChange(items.filter((_, i) => i !== index))}
>
- <Trash2 className="size-4" />
- </Button>
+ <Trash2 />
+ </IconButton>
</div>
);
})}
@@ -232,14 +233,19 @@ type Props = {
setValue: UseFormSetValue<FormData>;
policyConstraints: PolicyConstraints;
isAwsAcmPublicCa: boolean;
+ isExternalAdcsCa: boolean;
};
+const EXTERNAL_ADCS_HINT =
+ "Validity, key usages, extended key usages and basic constraints are controlled by the external CA's certificate template.";
+
export const ProfileDefaultsStep = ({
control,
watch,
setValue,
policyConstraints,
- isAwsAcmPublicCa
+ isAwsAcmPublicCa,
+ isExternalAdcsCa
}: Props) => {
const watchedPolicyId = watch("certificatePolicyId");
const watchedDefaultsIsCA = watch("defaults.basicConstraints.isCA") || false;
@@ -288,34 +294,38 @@ export const ProfileDefaultsStep = ({
return (
<div className="space-y-8">
- <Controller
- name="defaults.ttlDays"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>Time to Live (TTL) in Days</FieldLabel>
- <FieldContent>
- <Input
- type="number"
- placeholder="e.g. 365"
- value={field.value == null ? "" : field.value}
- isError={Boolean(error)}
- disabled={isAwsAcmPublicCa}
- onChange={(e) => {
- const val = e.target.value;
- field.onChange(val === "" ? null : Number(val));
- }}
- />
- <FieldDescription>
- {isAwsAcmPublicCa
- ? "AWS ACM Public CA issues certificates with a fixed 198-day validity. This field cannot be changed."
- : "Fallback validity period used when not explicitly specified in a certificate request. Leave empty for no TTL default."}
- </FieldDescription>
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
+ {isExternalAdcsCa && <p className="text-xs text-muted">{EXTERNAL_ADCS_HINT}</p>}
+
+ {!isExternalAdcsCa && (
+ <Controller
+ name="defaults.ttlDays"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Time to Live (TTL) in Days</FieldLabel>
+ <FieldContent>
+ <Input
+ type="number"
+ placeholder="e.g. 365"
+ value={field.value == null ? "" : field.value}
+ isError={Boolean(error)}
+ disabled={isAwsAcmPublicCa}
+ onChange={(e) => {
+ const val = e.target.value;
+ field.onChange(val === "" ? null : Number(val));
+ }}
+ />
+ <FieldDescription>
+ {isAwsAcmPublicCa
+ ? "AWS ACM Public CA issues certificates with a fixed 198-day validity. This field cannot be changed."
+ : "Fallback validity period used when not explicitly specified in a certificate request. Leave empty for no TTL default."}
+ </FieldDescription>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ )}
{policyConstraints.shouldShowSubjectSection && (
<AttributeListEditor<CertSubjectAttributeType>
@@ -374,7 +384,7 @@ export const ProfileDefaultsStep = ({
/>
)}
- {(policyConstraints.allowedSignatureAlgorithms.length > 0 ||
+ {((!isExternalAdcsCa && policyConstraints.allowedSignatureAlgorithms.length > 0) ||
policyConstraints.allowedKeyAlgorithms.length > 0) && (
<div>
<SectionHeading
@@ -382,7 +392,7 @@ export const ProfileDefaultsStep = ({
description="Default signature and key algorithms applied when a request omits them."
/>
<div className="mt-4 flex gap-3">
- {policyConstraints.allowedSignatureAlgorithms.length > 0 && (
+ {!isExternalAdcsCa && policyConstraints.allowedSignatureAlgorithms.length > 0 && (
<Field className="flex-1">
<FieldLabel>Signature Algorithm</FieldLabel>
<FieldContent>
@@ -436,7 +446,7 @@ export const ProfileDefaultsStep = ({
</div>
)}
- {filteredKeyUsages.length > 0 && (
+ {!isExternalAdcsCa && filteredKeyUsages.length > 0 && (
<KeyUsageGrid
title="Key Usages"
description="Key usages applied by default to issued certificates."
@@ -448,7 +458,7 @@ export const ProfileDefaultsStep = ({
/>
)}
- {filteredExtendedKeyUsages.length > 0 && (
+ {!isExternalAdcsCa && filteredExtendedKeyUsages.length > 0 && (
<KeyUsageGrid
title="Extended Key Usages"
description="Extended key usages applied by default to issued certificates."
@@ -460,7 +470,7 @@ export const ProfileDefaultsStep = ({
/>
)}
- {policyConstraints.policyAllowsCA && (
+ {!isExternalAdcsCa && policyConstraints.policyAllowsCA && (
<div>
<SectionHeading
title="Basic Constraints"