Skip to content

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

feat(frontend): unified external migrations settings UI

Igor Correa206d1a91d0f2
diff --git a/frontend/src/helpers/externalMigrationInPlatform.ts b/frontend/src/helpers/externalMigrationInPlatform.ts
new file mode 100644
index 0000000000..d6e1290b40
--- /dev/null
+++ b/frontend/src/helpers/externalMigrationInPlatform.ts
@@ -0,0 +1,33 @@
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+
+import { APP_CONNECTION_MAP } from "./appConnections";
+
+/** App connection types that support org-level in-platform migration configuration. */
+export const IN_PLATFORM_MIGRATION_APP_CONNECTIONS = [
+ AppConnection.HCVault,
+ AppConnection.Doppler
+] as const;
+
+export type TInPlatformMigrationApp = (typeof IN_PLATFORM_MIGRATION_APP_CONNECTIONS)[number];
+
+export const IN_PLATFORM_MIGRATION_PROVIDER_DETAILS: Record<
+ TInPlatformMigrationApp,
+ { description: string }
+> = {
+ [AppConnection.HCVault]: {
+ description:
+ "Policy imports, auth methods, secret engine migrations, and importing secrets from Vault in the UI."
+ },
+ [AppConnection.Doppler]: {
+ description: "Import secrets from Doppler into Infisical projects from the UI."
+ }
+};
+
+export function getInPlatformMigrationProviderMeta(app: TInPlatformMigrationApp) {
+ const meta = APP_CONNECTION_MAP[app];
+ return {
+ name: meta.name,
+ imageFileName: meta.image,
+ size: meta.size ?? 50
+ };
+}
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
index 8a793536cf..781475d919 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
@@ -6,8 +6,8 @@ import { useOrgPermission } from "@app/context";
import { OrgMembershipRole } from "@app/helpers/roles";
import { usePopUp } from "@app/hooks";
+import { InPlatformMigrationSection } from "./components/InPlatformMigrationSection";
import { SelectImportFromPlatformModal } from "./components/SelectImportFromPlatformModal";
-import { VaultConnectionSection } from "./components/VaultConnectionSection";
export const ExternalMigrationsTab = () => {
const { hasOrgRole } = useOrgPermission();
@@ -19,13 +19,31 @@ export const ExternalMigrationsTab = () => {
{/* In-Platform Migration Tooling Section */}
<div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
<div className="mb-4">
- <h2 className="text-xl font-medium text-mineshaft-100">In-Platform Migration Tooling</h2>
+ <div className="flex flex-wrap items-center gap-2">
+ <h2 className="text-xl font-medium text-mineshaft-100">In-Platform Migration Tooling</h2>
+ <a
+ target="_blank"
+ rel="noopener noreferrer"
+ href="https://infisical.com/docs/documentation/platform/external-migrations/overview"
+ >
+ <div className="inline-block rounded-md bg-yellow/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-yellow opacity-80 hover:opacity-100">
+ <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ Docs
+ <FontAwesomeIcon
+ icon={faArrowUpRightFromSquare}
+ className="text-xxs mb-[0.07rem] ml-1.5"
+ />
+ </div>
+ </a>
+ </div>
<p className="mt-1 mb-6 text-sm text-gray-400">
- Configure platform connections to enable migration features throughout Infisical, such
- as importing policies and resources directly within the UI.
+ Connect <span className="text-mineshaft-200">HashiCorp Vault</span> or{" "}
+ <span className="text-mineshaft-200">Doppler</span> to enable migration features across
+ Infisical: import KV secrets (and from Vault, policies, Kubernetes-related resources,
+ and more) directly from the UI.
</p>
</div>
- <VaultConnectionSection />
+ <InPlatformMigrationSection />
</div>
{/* Bulk Data Import Section */}
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/DopplerConfigModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/DopplerConfigModal.tsx
new file mode 100644
index 0000000000..923f224671
--- /dev/null
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/DopplerConfigModal.tsx
@@ -0,0 +1,140 @@
+import { useEffect, useMemo } from "react";
+import { Controller, useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { z } from "zod";
+
+import { createNotification } from "@app/components/notifications";
+import { Button, FilterableSelect, FormControl, Modal, ModalContent } from "@app/components/v2";
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import { useListAppConnections } from "@app/hooks/api/appConnections/queries";
+import {
+ useCreateDopplerExternalMigrationConfig,
+ useUpdateDopplerExternalMigrationConfig
+} from "@app/hooks/api/migration";
+import { TDopplerExternalMigrationConfig } from "@app/hooks/api/migration/types";
+
+const schema = z.object({
+ connectionId: z.string().min(1, "Connection is required")
+});
+
+type FormData = z.infer<typeof schema>;
+
+type Props = {
+ isOpen: boolean;
+ onOpenChange: (isOpen: boolean) => void;
+ editConfig?: TDopplerExternalMigrationConfig;
+};
+
+export const DopplerConfigModal = ({ isOpen, onOpenChange, editConfig }: Props) => {
+ const isEdit = Boolean(editConfig);
+
+ const { data: appConnections = [], isPending: isLoadingConnections } = useListAppConnections();
+
+ const dopplerConnections = useMemo(
+ () => appConnections.filter((conn) => conn.app === AppConnection.Doppler),
+ [appConnections]
+ );
+
+ const { mutateAsync: createConfig, isPending: isCreating } =
+ useCreateDopplerExternalMigrationConfig();
+ const { mutateAsync: updateConfig, isPending: isUpdating } =
+ useUpdateDopplerExternalMigrationConfig();
+
+ const {
+ control,
+ handleSubmit,
+ reset,
+ formState: { errors, isSubmitting }
+ } = useForm<FormData>({
+ resolver: zodResolver(schema),
+ defaultValues: {
+ connectionId: ""
+ }
+ });
+
+ useEffect(() => {
+ if (isOpen) {
+ reset({
+ connectionId: editConfig?.connectionId || ""
+ });
+ }
+ }, [isOpen, editConfig, reset]);
+
+ const onFormSubmit = async (data: FormData) => {
+ if (isEdit && editConfig) {
+ await updateConfig({ id: editConfig.id, connectionId: data.connectionId });
+ createNotification({ type: "success", text: "Doppler configuration updated successfully" });
+ } else {
+ await createConfig({ connectionId: data.connectionId });
+ createNotification({ type: "success", text: "Doppler configuration created successfully" });
+ }
+ reset();
+ onOpenChange(false);
+ };
+
+ const handleClose = () => {
+ reset();
+ onOpenChange(false);
+ };
+
+ return (
+ <Modal isOpen={isOpen} onOpenChange={handleClose}>
+ <ModalContent
+ title={isEdit ? "Edit Doppler Configuration" : "Add Doppler Configuration"}
+ subTitle="Configure a Doppler connection for in-platform migration tooling"
+ bodyClassName="overflow-visible"
+ >
+ <form onSubmit={handleSubmit(onFormSubmit)}>
+ <Controller
+ control={control}
+ name="connectionId"
+ render={({ field }) => {
+ const selectedConnection = dopplerConnections.find((conn) => conn.id === field.value);
+
+ return (
+ <FormControl
+ label="Doppler Connection"
+ isError={Boolean(errors.connectionId)}
+ errorText={errors.connectionId?.message}
+ tooltipText="Select a Doppler app connection"
+ >
+ <FilterableSelect
+ value={selectedConnection || null}
+ onChange={(newValue) => {
+ const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
+ if (singleValue && "id" in singleValue) {
+ field.onChange(singleValue.id);
+ } else {
+ field.onChange("");
+ }
+ }}
+ isLoading={isLoadingConnections}
+ options={dopplerConnections}
+ placeholder="Select connection..."
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ );
+ }}
+ />
+
+ <div className="mt-8 flex items-center gap-2">
+ <Button
+ className="mr-4"
+ size="sm"
+ type="submit"
+ isLoading={isSubmitting || isCreating || isUpdating}
+ isDisabled={isSubmitting || isCreating || isUpdating}
+ >
+ {isEdit ? "Update" : "Create"}
+ </Button>
+ <Button colorSchema="secondary" variant="plain" onClick={handleClose}>
+ Cancel
+ </Button>
+ </div>
+ </form>
+ </ModalContent>
+ </Modal>
+ );
+};
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/DopplerImportModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/DopplerImportModal.tsx
new file mode 100644
index 0000000000..4cbd88e458
--- /dev/null
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/DopplerImportModal.tsx
@@ -0,0 +1,282 @@
+import { useMemo } from "react";
+import { Controller, useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { z } from "zod";
+
+import { createNotification } from "@app/components/notifications";
+import {
+ Button,
+ FilterableSelect,
+ FormControl,
+ Input,
+ Modal,
+ ModalContent
+} from "@app/components/v2";
+import { useGetUserProjects } from "@app/hooks/api";
+import {
+ useGetDopplerEnvironments,
+ useGetDopplerProjects,
+ useImportDopplerSecrets
+} from "@app/hooks/api/migration";
+import { TDopplerExternalMigrationConfig } from "@app/hooks/api/migration/types";
+import { ProjectType } from "@app/hooks/api/projects/types";
+
+const schema = z.object({
+ dopplerProject: z.string().min(1, "Doppler project is required"),
+ dopplerEnvironment: z.string().min(1, "Doppler environment is required"),
+ targetProjectId: z.string().min(1, "Target project is required"),
+ targetEnvironment: z.string().min(1, "Target environment is required"),
+ targetSecretPath: z.string().min(1, "Secret path is required")
+});
+
+type FormData = z.infer<typeof schema>;
+
+type Props = {
+ isOpen: boolean;
+ onOpenChange: (isOpen: boolean) => void;
+ config: TDopplerExternalMigrationConfig;
+};
+
+export const DopplerImportModal = ({ isOpen, onOpenChange, config }: Props) => {
+ const {
+ control,
+ handleSubmit,
+ watch,
+ reset,
+ formState: { errors, isSubmitting }
+ } = useForm<FormData>({
+ resolver: zodResolver(schema),
+ defaultValues: {
+ dopplerProject: "",
+ dopplerEnvironment: "",
+ targetProjectId: "",
+ targetEnvironment: "",
+ targetSecretPath: "/"
+ }
+ });
+
+ const selectedDopplerProject = watch("dopplerProject");
+ const selectedTargetProjectId = watch("targetProjectId");
+
+ const { data: dopplerProjects = [], isPending: isLoadingProjects } = useGetDopplerProjects(
+ config.id
+ );
+ const { data: dopplerEnvironments = [], isPending: isLoadingEnvironments } =
+ useGetDopplerEnvironments(config.id, selectedDopplerProject || undefined);
+
+ const { data: userProjects = [], isPending: isLoadingUserProjects } = useGetUserProjects();
+
+ const secretManagerProjects = useMemo(
+ () => userProjects.filter((p) => p.type === ProjectType.SecretManager),
+ [userProjects]
+ );
+
+ const selectedProject = useMemo(
+ () => secretManagerProjects.find((p) => p.id === selectedTargetProjectId),
+ [secretManagerProjects, selectedTargetProjectId]
+ );
+
+ const { mutateAsync: importSecrets } = useImportDopplerSecrets();
+
+ const onFormSubmit = async (data: FormData) => {
+ await importSecrets({
+ configId: config.id,
+ dopplerProject: data.dopplerProject,
+ dopplerEnvironment: data.dopplerEnvironment,
+ targetProjectId: data.targetProjectId,
+ targetEnvironment: data.targetEnvironment,
+ targetSecretPath: data.targetSecretPath
+ });
+ createNotification({
+ type: "success",
+ text: "Secrets imported successfully from Doppler"
+ });
+ reset();
+ onOpenChange(false);
+ };
+
+ const handleClose = () => {
+ reset();
+ onOpenChange(false);
+ };
+
+ return (
+ <Modal isOpen={isOpen} onOpenChange={handleClose}>
+ <ModalContent
+ title="Import Secrets from Doppler"
+ subTitle="Select source and destination to import secrets"
+ bodyClassName="overflow-visible"
+ >
+ <form onSubmit={handleSubmit(onFormSubmit)}>
+ <p className="mb-4 text-sm font-medium text-mineshaft-300">Doppler Source</p>
+
+ <Controller
+ control={control}
+ name="dopplerProject"
+ render={({ field }) => {
+ const selectedItem = dopplerProjects.find((p) => p.slug === field.value);
+
+ return (
+ <FormControl
+ label="Project"
+ isError={Boolean(errors.dopplerProject)}
+ errorText={errors.dopplerProject?.message}
+ >
+ <FilterableSelect
+ value={selectedItem || null}
+ onChange={(newValue) => {
+ const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
+ if (singleValue && "slug" in singleValue) {
+ field.onChange(singleValue.slug);
+ } else {
+ field.onChange("");
+ }
+ }}
+ isLoading={isLoadingProjects}
+ options={dopplerProjects}
+ placeholder="Select Doppler project..."
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.slug}
+ />
+ </FormControl>
+ );
+ }}
+ />
+
+ <Controller
+ control={control}
+ name="dopplerEnvironment"
+ render={({ field }) => {
+ const selectedItem = dopplerEnvironments.find((e) => e.slug === field.value);
+
+ return (
+ <FormControl
+ label="Environment"
+ isError={Boolean(errors.dopplerEnvironment)}
+ errorText={errors.dopplerEnvironment?.message}
+ >
+ <FilterableSelect
+ value={selectedItem || null}
+ onChange={(newValue) => {
+ const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
+ if (singleValue && "slug" in singleValue) {
+ field.onChange(singleValue.slug);
+ } else {
+ field.onChange("");
+ }
+ }}
+ isLoading={isLoadingEnvironments}
+ isDisabled={!selectedDopplerProject}
+ options={dopplerEnvironments}
+ placeholder="Select Doppler environment..."
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.slug}
+ />
+ </FormControl>
+ );
+ }}
+ />
+
+ <p className="mb-4 mt-6 text-sm font-medium text-mineshaft-300">Infisical Destination</p>
+
+ <Controller
+ control={control}
+ name="targetProjectId"
+ render={({ field }) => {
+ const selectedItem = secretManagerProjects.find((p) => p.id === field.value);
+
+ return (
+ <FormControl
+ label="Project"
+ isError={Boolean(errors.targetProjectId)}
+ errorText={errors.targetProjectId?.message}
+ >
+ <FilterableSelect
+ value={selectedItem || null}
+ onChange={(newValue) => {
+ const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
+ if (singleValue && "id" in singleValue) {
+ field.onChange(singleValue.id);
+ } else {
+ field.onChange("");
+ }
+ }}
+ isLoading={isLoadingUserProjects}
+ options={secretManagerProjects}
+ placeholder="Select Infisical project..."
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ );
+ }}
+ />
+
+ <Controller
+ control={control}
+ name="targetEnvironment"
+ render={({ field }) => {
+ const environments = selectedProject?.environments ?? [];
+ const selectedItem = environments.find((e) => e.slug === field.value);
+
+ return (
+ <FormControl
+ label="Environment"
+ isError={Boolean(errors.targetEnvironment)}
+ errorText={errors.targetEnvironment?.message}
+ >
+ <FilterableSelect
+ value={selectedItem || null}
+ onChange={(newValue) => {
+ const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
+ if (singleValue && "slug" in singleValue) {
+ field.onChange(singleValue.slug);
+ } else {
+ field.onChange("");
+ }
+ }}
+ isDisabled={!selectedTargetProjectId}
+ options={environments}
+ placeholder="Select environment..."
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.slug}
+ />
+ </FormControl>
+ );
+ }}
+ />
+
+ <Controller
+ control={control}
+ name="targetSecretPath"
+ render={({ field, fieldState: { error } }) => (
+ <FormControl
+ label="Secret Path"
+ isError={Boolean(error)}
+ errorText={error?.message}
+ tooltipText="The path in Infisical where secrets will be imported"
+ >
+ <Input {...field} placeholder="e.g., /" autoComplete="off" />
+ </FormControl>
+ )}
+ />
+
+ <div className="mt-8 flex items-center gap-2">
+ <Button
+ className="mr-4"
+ size="sm"
+ type="submit"
+ isLoading={isSubmitting}
+ isDisabled={isSubmitting}
+ >
+ Import Secrets
+ </Button>
+ <Button colorSchema="secondary" variant="plain" onClick={handleClose}>
+ Cancel
+ </Button>
+ </div>
+ </form>
+ </ModalContent>
+ </Modal>
+ );
+};
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/InPlatformMigrationSection.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/InPlatformMigrationSection.tsx
new file mode 100644
index 0000000000..51820db116
--- /dev/null
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/InPlatformMigrationSection.tsx
@@ -0,0 +1,368 @@
+import { useMemo, useState } from "react";
+import { Download, Edit, MoreVertical, Plus, Trash2 } from "lucide-react";
+import { Link } from "@tanstack/react-router";
+
+import { createNotification } from "@app/components/notifications";
+import { DeleteActionModal } from "@app/components/v2";
+import {
+ Button,
+ EmptyMedia,
+ Skeleton,
+ UnstableDropdownMenu,
+ UnstableDropdownMenuContent,
+ UnstableDropdownMenuItem,
+ UnstableDropdownMenuTrigger,
+ UnstableEmpty,
+ UnstableEmptyDescription,
+ UnstableEmptyHeader,
+ UnstableEmptyTitle,
+ UnstableIconButton,
+ UnstableTable,
+ UnstableTableBody,
+ UnstableTableCell,
+ UnstableTableHead,
+ UnstableTableHeader,
+ UnstableTableRow
+} from "@app/components/v3";
+import { useOrganization } from "@app/context";
+import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
+import {
+ getInPlatformMigrationProviderMeta,
+ TInPlatformMigrationApp
+} from "@app/helpers/externalMigrationInPlatform";
+import { useListAppConnections } from "@app/hooks/api/appConnections/queries";
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import {
+ useDeleteDopplerExternalMigrationConfig,
+ useDeleteVaultExternalMigrationConfig,
+ useGetDopplerExternalMigrationConfigs,
+ useGetVaultExternalMigrationConfigs
+} from "@app/hooks/api/migration";
+import {
+ TDopplerExternalMigrationConfig,
+ TVaultExternalMigrationConfig
+} from "@app/hooks/api/migration/types";
+
+import { DopplerConfigModal } from "./DopplerConfigModal";
+import { DopplerImportModal } from "./DopplerImportModal";
+import { SelectInPlatformMigrationProviderModal } from "./SelectInPlatformMigrationProviderModal";
+import { VaultNamespaceConfigModal } from "./VaultNamespaceConfigModal";
+
+type TMergedRow =
+ | { kind: "vault"; config: TVaultExternalMigrationConfig }
+ | { kind: "doppler"; config: TDopplerExternalMigrationConfig };
+
+const SKELETON_ROW_KEYS = ["sk-1", "sk-2", "sk-3"] as const;
+
+export const InPlatformMigrationSection = () => {
+ const [isProviderPickerOpen, setIsProviderPickerOpen] = useState(false);
+
+ const [vaultModalOpen, setVaultModalOpen] = useState(false);
+ const [vaultEditConfig, setVaultEditConfig] = useState<TVaultExternalMigrationConfig | undefined>();
+
+ const [dopplerConfigModalOpen, setDopplerConfigModalOpen] = useState(false);
+ const [dopplerEditConfig, setDopplerEditConfig] = useState<
+ TDopplerExternalMigrationConfig | undefined
+ >();
+
+ const [dopplerImportModalOpen, setDopplerImportModalOpen] = useState(false);
+ const [dopplerImportConfig, setDopplerImportConfig] = useState<TDopplerExternalMigrationConfig | null>(
+ null
+ );
+
+ const [vaultDeleteOpen, setVaultDeleteOpen] = useState(false);
+ const [vaultToDelete, setVaultToDelete] = useState<TVaultExternalMigrationConfig | null>(null);
+
+ const [dopplerDeleteOpen, setDopplerDeleteOpen] = useState(false);
+ const [dopplerToDelete, setDopplerToDelete] = useState<TDopplerExternalMigrationConfig | null>(null);
+
+ const { data: vaultConfigs = [], isPending: isVaultLoading } = useGetVaultExternalMigrationConfigs();
+ const { data: dopplerConfigs = [], isPending: isDopplerLoading } =
+ useGetDopplerExternalMigrationConfigs();
+
+ const { currentOrg } = useOrganization();
+ const { data: appConnections = [] } = useListAppConnections();
+
+ const { mutateAsync: deleteVaultConfig } = useDeleteVaultExternalMigrationConfig();
+ const { mutateAsync: deleteDopplerConfig } = useDeleteDopplerExternalMigrationConfig();
+
+ const mergedRows = useMemo(() => {
+ const rows: TMergedRow[] = [
+ ...vaultConfigs.map((config) => ({ kind: "vault" as const, config })),
+ ...dopplerConfigs.map((config) => ({ kind: "doppler" as const, config }))
+ ];
+ rows.sort((a, b) => b.config.createdAt.localeCompare(a.config.createdAt));
+ return rows;
+ }, [vaultConfigs, dopplerConfigs]);
+
+ const isLoading = isVaultLoading || isDopplerLoading;
+
+ const getConnectionName = (connectionId: string | null) => {
+ if (!connectionId) return "None";
+ const connection = appConnections.find((conn) => conn.id === connectionId);
+ return connection?.name || "Unknown";
+ };
+
+ const providerApp = (row: TMergedRow): TInPlatformMigrationApp =>
+ row.kind === "vault" ? AppConnection.HCVault : AppConnection.Doppler;
+
+ const openAddForProvider = (app: TInPlatformMigrationApp) => {
+ if (app === AppConnection.HCVault) {
+ setVaultEditConfig(undefined);
+ setVaultModalOpen(true);
+ } else {
+ setDopplerEditConfig(undefined);
+ setDopplerConfigModalOpen(true);
+ }
+ };
+
+ const handleVaultDeleteConfirm = async () => {
+ if (!vaultToDelete) return;
+ await deleteVaultConfig({ id: vaultToDelete.id });
+ createNotification({
+ type: "success",
+ text: "Namespace configuration deleted successfully"
+ });
+ setVaultDeleteOpen(false);
+ setVaultToDelete(null);
+ };
+
+ const handleDopplerDeleteConfirm = async () => {
+ if (!dopplerToDelete) return;
+ await deleteDopplerConfig({ id: dopplerToDelete.id });
+ createNotification({
+ type: "success",
+ text: "Doppler configuration deleted successfully"
+ });
+ setDopplerDeleteOpen(false);
+ setDopplerToDelete(null);
+ };
+
+ return (
+ <div>
+ <div className="mb-4 flex flex-wrap items-center justify-between gap-2">
+ <div>
+ <h3 className="text-lg font-medium text-mineshaft-100">Configured platforms</h3>
+ <p className="text-sm text-gray-400">
+ Link HashiCorp Vault namespaces or Doppler to enable migration actions across Infisical.
+ </p>
+ </div>
+ <Button
+ variant="project"
+ type="button"
+ className="gap-1.5"
+ onClick={() => setIsProviderPickerOpen(true)}
+ >
+ <Plus className="size-4 shrink-0" />
+ Add configuration
+ </Button>
+ </div>
+
+ {isLoading ? (
+ <UnstableTable>
+ <UnstableTableHeader>
+ <UnstableTableRow>
+ <UnstableTableHead>Platform</UnstableTableHead>
+ <UnstableTableHead>Namespace</UnstableTableHead>
+ <UnstableTableHead>Connection</UnstableTableHead>
+ <UnstableTableHead className="w-12 text-right" />
+ </UnstableTableRow>
+ </UnstableTableHeader>
+ <UnstableTableBody>
+ {SKELETON_ROW_KEYS.map((key) => (
+ <UnstableTableRow key={key}>
+ <UnstableTableCell>
+ <Skeleton className="h-4 w-36" />
+ </UnstableTableCell>
+ <UnstableTableCell>
+ <Skeleton className="h-4 w-28" />
+ </UnstableTableCell>
+ <UnstableTableCell>
+ <Skeleton className="h-4 w-32" />
+ </UnstableTableCell>
+ <UnstableTableCell className="text-right">
+ <Skeleton className="ml-auto size-7 shrink-0 rounded-md" />
+ </UnstableTableCell>
+ </UnstableTableRow>
+ ))}
+ </UnstableTableBody>
+ </UnstableTable>
+ ) : mergedRows.length === 0 ? (
+ <UnstableEmpty>
+ <UnstableEmptyHeader>
+ <EmptyMedia variant="icon">
+ <Plus />
+ </EmptyMedia>
+ <UnstableEmptyTitle>No migration configurations</UnstableEmptyTitle>
+ <UnstableEmptyDescription>
+ Add a platform configuration to enable in-platform migration features.
+ </UnstableEmptyDescription>
+ </UnstableEmptyHeader>
+ </UnstableEmpty>
+ ) : (
+ <UnstableTable>
+ <UnstableTableHeader>
+ <UnstableTableRow>
+ <UnstableTableHead>Platform</UnstableTableHead>
+ <UnstableTableHead>Namespace</UnstableTableHead>
+ <UnstableTableHead>Connection</UnstableTableHead>
+ <UnstableTableHead className="w-12 text-right" />
+ </UnstableTableRow>
+ </UnstableTableHeader>
+ <UnstableTableBody>
+ {mergedRows.map((row) => {
+ const app = providerApp(row);
+ const { name, imageFileName } = getInPlatformMigrationProviderMeta(app);
+
+ return (
+ <UnstableTableRow key={`${row.kind}-${row.config.id}`}>
+ <UnstableTableCell>
+ <div className="flex items-center gap-2">
+ <img
+ src={`/images/integrations/${imageFileName}`}
+ alt=""
+ className="size-8 rounded-md bg-bunker-500 p-1"
+ />
+ <span className="text-sm text-mineshaft-200">{name}</span>
+ </div>
+ </UnstableTableCell>
+ <UnstableTableCell className="text-sm text-mineshaft-300">
+ {row.kind === "vault" ? row.config.namespace : "—"}
+ </UnstableTableCell>
+ <UnstableTableCell>{getConnectionName(row.config.connectionId)}</UnstableTableCell>
+ <UnstableTableCell className="text-right">
+ <UnstableDropdownMenu>
+ <UnstableDropdownMenuTrigger asChild>
+ <UnstableIconButton
+ variant="ghost"
+ size="xs"
+ aria-label="Row actions"
+ className="text-mineshaft-300"
+ >
+ <MoreVertical className="size-4" />
+ </UnstableIconButton>
+ </UnstableDropdownMenuTrigger>
+ <UnstableDropdownMenuContent align="end" className="min-w-40">
+ {row.kind === "doppler" && (
+ <UnstableDropdownMenuItem
+ onClick={() => {
+ setDopplerImportConfig(row.config);
+ setDopplerImportModalOpen(true);
+ }}
+ >
+ <Download />
+ Import secrets
+ </UnstableDropdownMenuItem>
+ )}
+ <UnstableDropdownMenuItem
+ onClick={() => {
+ if (row.kind === "vault") {
+ setVaultEditConfig(row.config);
+ setVaultModalOpen(true);
+ } else {
+ setDopplerEditConfig(row.config);
+ setDopplerConfigModalOpen(true);
+ }
+ }}
+ >
+ <Edit />
+ Edit
+ </UnstableDropdownMenuItem>
+ <UnstableDropdownMenuItem
+ variant="danger"
+ onClick={() => {
+ if (row.kind === "vault") {
+ setVaultToDelete(row.config);
+ setVaultDeleteOpen(true);
+ } else {
+ setDopplerToDelete(row.config);
+ setDopplerDeleteOpen(true);
+ }
+ }}
+ >
+ <Trash2 />
+ Delete
+ </UnstableDropdownMenuItem>
+ </UnstableDropdownMenuContent>
+ </UnstableDropdownMenu>
+ </UnstableTableCell>
+ </UnstableTableRow>
+ );
+ })}
+ </UnstableTableBody>
+ </UnstableTable>
+ )}
+
+ <p className="mt-4 text-xs text-mineshaft-400">
+ Manage credentials in{" "}
+ <Link
+ to="/organizations/$orgId/app-connections"
+ params={{ orgId: currentOrg.id }}
+ className="text-primary underline hover:text-primary-300"
+ >
+ App Connections
+ </Link>
+ . Use <span className="text-mineshaft-300">{APP_CONNECTION_MAP[AppConnection.HCVault].name}</span>{" "}
+ or <span className="text-mineshaft-300">{APP_CONNECTION_MAP[AppConnection.Doppler].name}</span>{" "}
+ connection types as needed.
+ </p>
+
+ <SelectInPlatformMigrationProviderModal
+ isOpen={isProviderPickerOpen}
+ onOpenChange={setIsProviderPickerOpen}
+ onSelect={openAddForProvider}
+ />
+
+ <VaultNamespaceConfigModal
+ isOpen={vaultModalOpen}
+ onOpenChange={(open) => {
+ setVaultModalOpen(open);
+ if (!open) setVaultEditConfig(undefined);
+ }}
+ editConfig={vaultEditConfig}
+ />
+
+ <DopplerConfigModal
+ isOpen={dopplerConfigModalOpen}
+ onOpenChange={(open) => {
+ setDopplerConfigModalOpen(open);
+ if (!open) setDopplerEditConfig(undefined);
+ }}
+ editConfig={dopplerEditConfig}
+ />
+
+ {dopplerImportConfig && (
+ <DopplerImportModal
+ isOpen={dopplerImportModalOpen}
+ onOpenChange={(open) => {
+ setDopplerImportModalOpen(open);
+ if (!open) setDopplerImportConfig(null);
+ }}
+ config={dopplerImportConfig}
+ />
+ )}
+
+ <DeleteActionModal
+ isOpen={vaultDeleteOpen}
+ title={`Delete namespace configuration for "${vaultToDelete?.namespace}"?`}
+ onChange={(open) => {
+ setVaultDeleteOpen(open);
+ if (!open) setVaultToDelete(null);
+ }}
+ deleteKey="confirm"
+ onDeleteApproved={handleVaultDeleteConfirm}
+ />
+
+ <DeleteActionModal
+ isOpen={dopplerDeleteOpen}
+ title="Delete Doppler configuration?"
+ onChange={(open) => {
+ setDopplerDeleteOpen(open);
+ if (!open) setDopplerToDelete(null);
+ }}
+ deleteKey="confirm"
+ onDeleteApproved={handleDopplerDeleteConfirm}
+ />
+ </div>
+ );
+};
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectInPlatformMigrationProviderModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectInPlatformMigrationProviderModal.tsx
new file mode 100644
index 0000000000..6fb4cf12f1
--- /dev/null
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectInPlatformMigrationProviderModal.tsx
@@ -0,0 +1,74 @@
+import { Link } from "@tanstack/react-router";
+
+import { Modal, ModalContent } from "@app/components/v2";
+import { useOrganization } from "@app/context";
+import {
+ getInPlatformMigrationProviderMeta,
+ IN_PLATFORM_MIGRATION_APP_CONNECTIONS,
+ IN_PLATFORM_MIGRATION_PROVIDER_DETAILS,
+ TInPlatformMigrationApp
+} from "@app/helpers/externalMigrationInPlatform";
+
+type Props = {
+ isOpen: boolean;
+ onOpenChange: (open: boolean) => void;
+ onSelect: (app: TInPlatformMigrationApp) => void;
+};
+
+export const SelectInPlatformMigrationProviderModal = ({
+ isOpen,
+ onOpenChange,
+ onSelect
+}: Props) => {
+ const { currentOrg } = useOrganization();
+
+ return (
+ <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
+ <ModalContent title="Add migration configuration" className="max-w-lg">
+ <p className="mb-4 text-sm text-mineshaft-300">
+ Select a platform to link to in-platform migration. Credentials are managed in{" "}
+ <Link
+ to="/organizations/$orgId/app-connections"
+ params={{ orgId: currentOrg.id }}
+ className="text-primary underline hover:text-primary-300"
+ onClick={() => onOpenChange(false)}
+ >
+ App Connections
+ </Link>
+ .
+ </p>
+ <div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
+ {IN_PLATFORM_MIGRATION_APP_CONNECTIONS.map((app) => {
+ const { name, imageFileName, size } = getInPlatformMigrationProviderMeta(app);
+ const { description } = IN_PLATFORM_MIGRATION_PROVIDER_DETAILS[app];
+
+ return (
+ <button
+ key={app}
+ type="button"
+ onClick={() => {
+ onSelect(app);
+ onOpenChange(false);
+ }}
+ className="group flex flex-col items-center rounded-md border border-mineshaft-600 bg-mineshaft-700 p-4 text-left duration-200 hover:bg-mineshaft-600"
+ >
+ <img
+ src={`/images/integrations/${imageFileName}`}
+ style={{ width: `${size}px` }}
+ className="mt-1"
+ alt=""
+ />
+ <span className="mt-3 text-center text-sm font-medium text-gray-200 group-hover:text-white">
+ {name}
+ </span>
+ <span className="mt-2 text-center text-xs leading-snug text-mineshaft-400">
+ {description}
+ </span>
+ </button>
+ );
+ })}
+ </div>
+ </ModalContent>
+ </Modal>
+ );
+};
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultConnectionSection.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultConnectionSection.tsx
deleted file mode 100644
index 070d9929d1..0000000000
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultConnectionSection.tsx
+++ /dev/null
@@ -1,193 +0,0 @@
-import { useState } from "react";
-import { faEdit, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { Link } from "@tanstack/react-router";
-
-import { createNotification } from "@app/components/notifications";
-import {
- Button,
- DeleteActionModal,
- EmptyState,
- Table,
- TableContainer,
- TableSkeleton,
- TBody,
- Td,
- Th,
- THead,
- Tr
-} from "@app/components/v2";
-import { useOrganization } from "@app/context";
-import { useListAppConnections } from "@app/hooks/api/appConnections/queries";
-import {
- useDeleteVaultExternalMigrationConfig,
- useGetVaultExternalMigrationConfigs
-} from "@app/hooks/api/migration";
-import { TVaultExternalMigrationConfig } from "@app/hooks/api/migration/types";
-
-import { VaultNamespaceConfigModal } from "./VaultNamespaceConfigModal";
-
-export const VaultConnectionSection = () => {
- const [selectedConfig, setSelectedConfig] = useState<TVaultExternalMigrationConfig | null>(null);
- const [isModalOpen, setIsModalOpen] = useState(false);
- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
- const [configToDelete, setConfigToDelete] = useState<TVaultExternalMigrationConfig | null>(null);
-
- const { data: configs = [], isPending: isLoadingConfigs } = useGetVaultExternalMigrationConfigs();
-
- const { currentOrg } = useOrganization();
- const { data: appConnections = [] } = useListAppConnections();
- const { mutateAsync: deleteConfig } = useDeleteVaultExternalMigrationConfig();
-
- const handleEdit = (config: TVaultExternalMigrationConfig) => {
- setSelectedConfig(config);
- setIsModalOpen(true);
- };
-
- const handleAdd = () => {
- setSelectedConfig(null);
- setIsModalOpen(true);
- };
-
- const handleDeleteClick = (config: TVaultExternalMigrationConfig) => {
- setConfigToDelete(config);
- setIsDeleteModalOpen(true);
- };
-
- const handleDeleteConfirm = async () => {
- if (!configToDelete) return;
-
- await deleteConfig({ id: configToDelete.id });
- createNotification({
- type: "success",
- text: "Namespace configuration deleted successfully"
- });
- setIsDeleteModalOpen(false);
- setConfigToDelete(null);
- };
-
- const getConnectionName = (connectionId: string | null) => {
- if (!connectionId) return "None";
- const connection = appConnections.find((conn) => conn.id === connectionId);
- return connection?.name || "Unknown";
- };
-
- return (
- <div>
- <div className="mb-4 flex flex-wrap items-center justify-between gap-2">
- <div className="flex items-center gap-3">
- <img
- src="/images/integrations/Vault.png"
- alt="HashiCorp Vault logo"
- className="h-10 w-10 rounded-md bg-bunker-500 p-2"
- />
- <div>
- <h3 className="text-lg font-medium text-mineshaft-100">HashiCorp Vault</h3>
- <p className="text-sm text-gray-400">
- Enable in-platform migration tooling for policy imports, auth methods, and secret
- engine migrations
- </p>
- </div>
- </div>
- <Button
- colorSchema="primary"
- type="submit"
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
- onClick={handleAdd}
- >
- Add Namespace
- </Button>
- </div>
-
- <TableContainer>
- <Table>
- <THead>
- <Tr>
- <Th>Namespace</Th>
- <Th>Connection</Th>
- <Th className="w-5" />
- </Tr>
- </THead>
- <TBody>
- {isLoadingConfigs && (
- <TableSkeleton columns={3} innerKey="vault-configs-loading" rows={3} />
- )}
- {!isLoadingConfigs && configs.length === 0 && (
- <Tr>
- <Td colSpan={3}>
- <EmptyState title="No namespace configurations" icon={faPlus} className="py-8">
- <p className="mb-4 text-sm text-mineshaft-400">
- Add a namespace configuration to enable in-platform migration features.
- </p>
- </EmptyState>
- </Td>
- </Tr>
- )}
- {!isLoadingConfigs &&
- configs.map((config) => (
- <Tr key={config.id} className="group h-10">
- <Td>{config.namespace}</Td>
- <Td>{getConnectionName(config.connectionId)}</Td>
- <Td>
- <div className="flex items-center justify-end gap-2 opacity-0 transition-opacity group-hover:opacity-100">
- <Button
- variant="plain"
- colorSchema="secondary"
- size="xs"
- onClick={() => handleEdit(config)}
- leftIcon={<FontAwesomeIcon icon={faEdit} />}
- >
- Edit
- </Button>
- <Button
- variant="plain"
- colorSchema="danger"
- size="xs"
- onClick={() => handleDeleteClick(config)}
- leftIcon={<FontAwesomeIcon icon={faTrash} />}
- >
- Delete
- </Button>
- </div>
- </Td>
- </Tr>
- ))}
- </TBody>
- </Table>
- </TableContainer>
-
- <p className="mt-4 text-xs text-mineshaft-400">
- Configure namespace-specific connections to enable in-platform migration features. Manage
- connections in the{" "}
- <Link
- to="/organizations/$orgId/app-connections"
- params={{ orgId: currentOrg.id }}
- className="text-primary underline hover:text-primary-300"
- >
- App Connections
- </Link>{" "}
- section.
- </p>
-
- <VaultNamespaceConfigModal
- isOpen={isModalOpen}
- onOpenChange={(open) => {
- setIsModalOpen(open);
- if (!open) setSelectedConfig(null);
- }}
- editConfig={selectedConfig || undefined}
- />
-
- <DeleteActionModal
- isOpen={isDeleteModalOpen}
- title={`Delete namespace configuration for "${configToDelete?.namespace}"?`}
- onChange={(open) => {
- setIsDeleteModalOpen(open);
- if (!open) setConfigToDelete(null);
- }}
- deleteKey="confirm"
- onDeleteApproved={handleDeleteConfirm}
- />
- </div>
- );
-};