import { Controller, useFormContext } from "react-hook-form"; import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FormControl, Input, Switch, Tooltip } from "@app/components/v2"; import { PkiSync, usePkiSyncOption } from "@app/hooks/api/pkiSyncs"; import { TPkiSyncForm } from "../schemas/pki-sync-schema"; type Props = { destination?: PkiSync; }; export const PkiSyncOptionsFields = ({ destination }: Props) => { const { control, watch } = useFormContext(); const currentDestination = destination || watch("destination"); const { syncOption } = usePkiSyncOption(currentDestination); return ( <>

Configure how certificates should be synced.

{/* TODO: Re-enable this when we have a way to import certificates (

Auto Import Certificates{" "}

When enabled, Infisical will automatically import certificates from the PKI subscriber to the destination during sync operations.

This allows you to automatically populate your destination with certificates issued by your Certificate Authority.

} >

)} /> */} (

Enable Removal of Expired/Revoked Certificates{" "}

When enabled, Infisical will remove certificates from the destination during a sync if they are no longer active in Infisical.

Disable this option if you intend to manage some certificates manually outside of Infisical.

} >

)} /> {currentDestination === PkiSync.AwsCertificateManager && ( (

Preserve ARN on Renewal{" "}

When enabled, Infisical will replace the contents of existing certificates while preserving the same ARN during certificate renewal syncs.

This allows consuming services like load balancers to continue using the same ARN without requiring manual updates.

When disabled, new certificates will be created with new ARNs, and old certificates will be removed.

} >

)} /> )} {currentDestination === PkiSync.AzureKeyVault && ( (

Enable Versioning on Renewal{" "}

When enabled, Infisical will create a new version of the existing certificate in Azure Key Vault during certificate renewal syncs, preserving the original certificate name.

This allows consuming services to continue using the same certificate name while automatically using the latest version without requiring manual updates.

When disabled, new certificates will be created with new names, and old certificates will be removed.

} >

)} /> )} {currentDestination === PkiSync.Chef && ( (

Preserve Data Bag Item on Renewal{" "}

Only applies to certificate renewals: When a certificate is renewed in Infisical, this option controls how the renewed certificate is handled in Chef.

When enabled, the renewed certificate will update the existing data bag item, preserving the same item name. This allows consuming services to continue using the same data bag item without requiring updates to Chef cookbooks or recipes.

When disabled, the renewed certificate will be created as a new data bag item with a new name, and the old item will be removed.

} >

)} /> )} ( When a certificate is synced, the certificate name schema will be applied before it reaches the destination.
Available placeholders:
  • {"{{certificateId}}"} - The unique ID of the certificate
{syncOption?.forbiddenCharacters && syncOption.forbiddenCharacters.length > 0 && (
Character restrictions for {syncOption.name}:
The following characters are not allowed:{" "} {syncOption.forbiddenCharacters.split("").join(" ")}
)} } isError={Boolean(error)} isOptional errorText={error?.message} label="Certificate Name Schema" helperText="Infisical strongly advises setting a Certificate Name Schema to ensure that Infisical only manages the specific certificates you intend to manage, keeping everything else untouched." > onChange(e.target.value || undefined)} placeholder={ syncOption?.defaultCertificateNameSchema || "INFISICAL_{{certificateId}}" } />
)} /> ); };