Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
improvement(secret-sync): surface Include All Subfolders in the UI and docs
Calvina2ae88eb04d6
diff --git a/docs/integrations/secret-syncs/overview.mdx b/docs/integrations/secret-syncs/overview.mdxindex 7a262f4cfc..fbb93ee612 100644--- a/docs/integrations/secret-syncs/overview.mdx+++ b/docs/integrations/secret-syncs/overview.mdx@@ -71,7 +71,7 @@ via the UI or API for the third-party service you intend to sync secrets to.2. <strong>Create Secret Sync:</strong> Configure a Secret Sync in the desired project by specifying the following parameters via the UI or API:- <strong>Source:</strong> The project environment and folder path you wish to retrieve secrets from.- <strong>Destination:</strong> The App Connection to utilize and the destination endpoint to deploy secrets to. These can vary between services.- - <strong>Options:</strong> Customize how secrets should be synced, such as whether or not secrets should be imported from the destination on the initial sync.+ - <strong>Options:</strong> Customize how secrets should be synced, such as whether secrets should be imported from the destination on the initial sync, or whether the sync should [include all subfolders](#include-all-subfolders) beneath the source path.<Note>Secret Syncs are the source of truth for connected third-party services. Any secret,@@ -91,6 +91,27 @@ via the UI or API for the third-party service you intend to sync secrets to.you can contact us at [email protected] to make a request.</Note>+## Include all subfolders++A Secret Sync covers only the secrets in its source folder by default. Turn on **Include secrets from all subfolders** on the source step and the sync covers every folder beneath that path as well, however deep. Adding or changing a secret in any of those folders syncs it to the destination, the same as a change in the source folder itself. These syncs carry an **Includes All Subfolders** badge next to their source path in the Secret Syncs list.++Destinations store secrets in one flat list, so the folder structure isn't carried over. A secret named `DB_URL` in `/backend` and a secret named `DB_URL` in `/backend/api` both map to the same destination key, and the sync fails with an error naming both folders rather than picking one. Infisical checks for these collisions while you configure the sync, so you can rename or move one of the two before you save.++<div align="center">+ ```mermaid+ graph LR+ A[Infisical: **/backend**] --> C[Destination]+ B[Infisical: **/backend/api**] --> C+ style A fill:#E6F4FF,stroke:#0096D6,stroke-width:2px,color:black,rx:15px+ style B fill:#E6F4FF,stroke:#0096D6,stroke-width:2px,color:black,rx:15px+ style C fill:#F4FFE6,stroke:#96D600,stroke-width:2px,color:black,rx:15px+ ```+</div>++<Note>+ A sync that includes subfolders can't import secrets from the destination into Infisical, because there's no single folder to import them into. Its initial sync behavior is always overwrite destination.+</Note>+## Key schemasKey Schemas transform your secret keys by applying a prefix, suffix, or format pattern during sync to external destinations. This makes it clear which secrets are managed by Infisical and prevents accidental changes to unrelated secrets.diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncRow.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncRow.tsxindex df31ca9c61..c55fc71033 100644--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncRow.tsx+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncRow.tsx@@ -7,6 +7,7 @@ import {CopyIcon,DownloadIcon,EraserIcon,+ FolderTreeIcon,InfoIcon,MoreHorizontalIcon,RefreshCwIcon,@@ -58,23 +59,38 @@ type Props = {const SecretSyncDestinationSourceCell = ({folderPath,- environmentName+ environmentName,+ includeAllSubFolders}: {folderPath: string;environmentName: string;+ includeAllSubFolders: boolean;}) => {return (<TableCell className="max-w-0 min-w-32!"><Tooltip><TooltipTrigger asChild><div>- <p className="truncate text-sm">{folderPath}</p>+ <div className="flex items-center gap-1.5">+ <p className="truncate text-sm">{folderPath}</p>+ {includeAllSubFolders && (+ <Badge variant="neutral">+ <FolderTreeIcon />+ <span>Includes All Subfolders</span>+ </Badge>+ )}+ </div><p className="truncate text-xs leading-4 text-accent">{environmentName}</p></div></TooltipTrigger><TooltipContent side="left" className="max-w-2xl break-words"><p className="text-sm">{folderPath}</p><p className="text-xs leading-3 text-accent">{environmentName}</p>+ {includeAllSubFolders && (+ <p className="mt-1 max-w-xs text-xs">+ Secrets from every folder beneath this path are synced as well.+ </p>+ )}</TooltipContent></Tooltip></TableCell>@@ -101,7 +117,8 @@ export const SecretSyncRow = ({description,syncStatus,isAutoSyncEnabled,- projectId+ projectId,+ syncOptions} = secretSync;const { currentOrg } = useOrganization();@@ -175,6 +192,7 @@ export const SecretSyncRow = ({<SecretSyncDestinationSourceCellfolderPath={folder.path}environmentName={environment.name}+ includeAllSubFolders={Boolean(syncOptions.includeAllSubFolders)}/>) : (<TableCell>diff --git a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsxindex a2e87a9099..97fd8e543c 100644--- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncOptionsSection/SecretSyncOptionsSection.tsx@@ -30,7 +30,7 @@ type Props = {export const SecretSyncOptionsSection = ({ secretSync }: Props) => {const {destination,- syncOptions: { initialSyncBehavior, disableSecretDeletion, keySchema }+ syncOptions: { initialSyncBehavior, disableSecretDeletion, keySchema, includeAllSubFolders }} = secretSync;let AdditionalSyncOptionsComponent: ReactNode;@@ -132,6 +132,14 @@ export const SecretSyncOptionsSection = ({ secretSync }: Props) => {)}</Detail>{AdditionalSyncOptionsComponent}+ <Detail>+ <DetailLabel>Include All Subfolders</DetailLabel>+ <DetailValue>+ <Badge variant={includeAllSubFolders ? "success" : "neutral"}>+ {includeAllSubFolders ? "Enabled" : "Disabled"}+ </Badge>+ </DetailValue>+ </Detail><Detail><DetailLabel>Secret Deletion Protection</DetailLabel><DetailValue>