Skip to content

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

requested changes

Danielce98399bc043
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts
index 3e0144513e..be27ed04c6 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -723,7 +723,12 @@ export enum EventType {
// Secret Validation Rules
SECRET_VALIDATION_RULE_CREATE = "secret-validation-rule-create",
SECRET_VALIDATION_RULE_UPDATE = "secret-validation-rule-update",
- SECRET_VALIDATION_RULE_DELETE = "secret-validation-rule-delete"
+ SECRET_VALIDATION_RULE_DELETE = "secret-validation-rule-delete",
+
+ // External Migration
+ EXTERNAL_MIGRATION_CREATE = "external-migration-create",
+ EXTERNAL_MIGRATION_UPDATE = "external-migration-update",
+ EXTERNAL_MIGRATION_DELETE = "external-migration-delete"
}
// Maps each actor type to the JSONB key that holds the actor's primary ID in actorMetadata.
@@ -5748,6 +5753,32 @@ interface SecretValidationRuleDeleteEvent {
};
}
+interface ExternalMigrationCreateEvent {
+ type: EventType.EXTERNAL_MIGRATION_CREATE;
+ metadata: {
+ configId: string;
+ provider: string;
+ connectionId: string | null;
+ };
+}
+
+interface ExternalMigrationUpdateEvent {
+ type: EventType.EXTERNAL_MIGRATION_UPDATE;
+ metadata: {
+ configId: string;
+ provider: string;
+ connectionId: string | null;
+ };
+}
+
+interface ExternalMigrationDeleteEvent {
+ type: EventType.EXTERNAL_MIGRATION_DELETE;
+ metadata: {
+ configId: string;
+ provider: string;
+ };
+}
+
export type Event =
| CreateSubOrganizationEvent
| UpdateSubOrganizationEvent
@@ -6268,4 +6299,7 @@ export type Event =
| ScepRenewalEvent
| SecretValidationRuleCreateEvent
| SecretValidationRuleUpdateEvent
- | SecretValidationRuleDeleteEvent;
+ | SecretValidationRuleDeleteEvent
+ | ExternalMigrationCreateEvent
+ | ExternalMigrationUpdateEvent
+ | ExternalMigrationDeleteEvent;
diff --git a/backend/src/server/routes/v3/external-migration-router.ts b/backend/src/server/routes/v3/external-migration-router.ts
index 8764220449..3784a6bfac 100644
--- a/backend/src/server/routes/v3/external-migration-router.ts
+++ b/backend/src/server/routes/v3/external-migration-router.ts
@@ -1,6 +1,7 @@
import fastifyMultipart from "@fastify/multipart";
import { z } from "zod";
+import { EventType } from "@app/ee/services/audit-log/audit-log-types";
import { BadRequestError } from "@app/lib/errors";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
@@ -9,7 +10,10 @@ import {
ExternalMigrationConfigSchema,
ExternalMigrationProviders
} from "@app/services/external-migration/external-migration-schemas";
-import { VaultImportStatus, VaultMappingType } from "@app/services/external-migration/external-migration-types";
+import {
+ ExternalMigrationImportStatus,
+ VaultMappingType
+} from "@app/services/external-migration/external-migration-types";
const MB25_IN_BYTES = 26214400;
@@ -193,6 +197,19 @@ export const registerExternalMigrationRouter = async (server: FastifyZodProvider
actor: req.permission
});
+ await server.services.auditLog.createAuditLog({
+ orgId: req.permission.orgId,
+ ...req.auditLogInfo,
+ event: {
+ type: EventType.EXTERNAL_MIGRATION_CREATE,
+ metadata: {
+ configId: config.id,
+ provider: req.params.provider,
+ connectionId: req.body.connectionId
+ }
+ }
+ });
+
return { config };
}
});
@@ -235,6 +252,19 @@ export const registerExternalMigrationRouter = async (server: FastifyZodProvider
actor: req.permission
});
+ await server.services.auditLog.createAuditLog({
+ orgId: req.permission.orgId,
+ ...req.auditLogInfo,
+ event: {
+ type: EventType.EXTERNAL_MIGRATION_UPDATE,
+ metadata: {
+ configId: req.params.id,
+ provider: req.params.provider,
+ connectionId: req.body.connectionId
+ }
+ }
+ });
+
return { config };
}
});
@@ -271,6 +301,18 @@ export const registerExternalMigrationRouter = async (server: FastifyZodProvider
actor: req.permission
});
+ await server.services.auditLog.createAuditLog({
+ orgId: req.permission.orgId,
+ ...req.auditLogInfo,
+ event: {
+ type: EventType.EXTERNAL_MIGRATION_DELETE,
+ metadata: {
+ configId: req.params.id,
+ provider: req.params.provider
+ }
+ }
+ });
+
return { config };
}
});
@@ -402,7 +444,7 @@ export const registerExternalMigrationRouter = async (server: FastifyZodProvider
}),
response: {
200: z.object({
- status: z.nativeEnum(VaultImportStatus)
+ status: z.nativeEnum(ExternalMigrationImportStatus)
})
}
},
diff --git a/backend/src/services/external-migration/external-migration-service.ts b/backend/src/services/external-migration/external-migration-service.ts
index 0bc2dca715..59b0997501 100644
--- a/backend/src/services/external-migration/external-migration-service.ts
+++ b/backend/src/services/external-migration/external-migration-service.ts
@@ -53,6 +53,7 @@ import {
import { TExternalMigrationQueueFactory } from "./external-migration-queue";
import { ExternalMigrationConfigVaultConfigSchema, ExternalMigrationProviders } from "./external-migration-schemas";
import {
+ ExternalMigrationImportStatus,
ExternalPlatforms,
TCreateExternalMigrationDTO,
TDeleteExternalMigrationDTO,
@@ -60,8 +61,7 @@ import {
TImportDopplerSecretsDTO,
TImportEnvKeyDataDTO,
TImportVaultDataDTO,
- TUpdateExternalMigrationDTO,
- VaultImportStatus
+ TUpdateExternalMigrationDTO
} from "./external-migration-types";
type TExternalMigrationServiceFactoryDep = {
@@ -668,10 +668,10 @@ export const externalMigrationServiceFactory = ({
}
});
- return { status: VaultImportStatus.ApprovalRequired };
+ return { status: ExternalMigrationImportStatus.ApprovalRequired };
}
- return { status: VaultImportStatus.Imported };
+ return { status: ExternalMigrationImportStatus.Imported };
} catch (error) {
throw new BadRequestError({
message: `Failed to import Vault secrets. ${error instanceof Error ? error.message : "Unknown error"}`
@@ -869,7 +869,7 @@ export const externalMigrationServiceFactory = ({
}
});
- return { status: VaultImportStatus.ApprovalRequired, imported: 0 };
+ return { status: ExternalMigrationImportStatus.ApprovalRequired, imported: 0 };
}
} catch (error) {
throw new BadRequestError({
@@ -877,7 +877,7 @@ export const externalMigrationServiceFactory = ({
});
}
- return { status: VaultImportStatus.Imported, imported: Object.keys(dopplerSecrets).length };
+ return { status: ExternalMigrationImportStatus.Imported, imported: Object.keys(dopplerSecrets).length };
};
return {
diff --git a/backend/src/services/external-migration/external-migration-types.ts b/backend/src/services/external-migration/external-migration-types.ts
index 557f8bd2b0..fd3dbfcf45 100644
--- a/backend/src/services/external-migration/external-migration-types.ts
+++ b/backend/src/services/external-migration/external-migration-types.ts
@@ -125,7 +125,7 @@ export enum ExternalPlatforms {
Doppler = "Doppler"
}
-export enum VaultImportStatus {
+export enum ExternalMigrationImportStatus {
Imported = "imported",
ApprovalRequired = "approval-required"
}
diff --git a/docs/documentation/platform/external-migrations/doppler.mdx b/docs/documentation/platform/external-migrations/doppler.mdx
index 84837732ba..cea2e75689 100644
--- a/docs/documentation/platform/external-migrations/doppler.mdx
+++ b/docs/documentation/platform/external-migrations/doppler.mdx
@@ -90,10 +90,6 @@ When you are already in a **Secret Manager** project and have **one** environmen
![Import from Doppler modal on secret overview](/images/platform/external-migrations/doppler-in-platform/import-doppler-secret-overview-modal.png)
-<Info>
- **First time in this project?** Create a [project](/documentation/platform/project) and environments if you have not already. The overview import always targets the project you are viewing.
-</Info>
-
## Next Steps
<CardGroup cols={2}>
diff --git a/docs/images/app-connections/doppler/doppler-service-account-configure-role.png b/docs/images/app-connections/doppler/doppler-service-account-configure-role.png
new file mode 100644
index 0000000000..fa956f6176
Binary files /dev/null and b/docs/images/app-connections/doppler/doppler-service-account-configure-role.png differ
diff --git a/docs/images/app-connections/doppler/doppler-service-account-select-role.png b/docs/images/app-connections/doppler/doppler-service-account-select-role.png
new file mode 100644
index 0000000000..b23e25dc2f
Binary files /dev/null and b/docs/images/app-connections/doppler/doppler-service-account-select-role.png differ
diff --git a/docs/integrations/app-connections/doppler.mdx b/docs/integrations/app-connections/doppler.mdx
index ca12d21bf8..91e228028b 100644
--- a/docs/integrations/app-connections/doppler.mdx
+++ b/docs/integrations/app-connections/doppler.mdx
@@ -23,6 +23,16 @@ Infisical supports the use of API Tokens to connect with Doppler. This connectio
![Doppler Create Token](/images/app-connections/doppler/doppler-create-service-account.png)
</Step>
+ <Step title="Assign permissions to the service account">
+ Click the pencil icon next to your service account role to modify the role of the service account.
+ ![Doppler Service Account Role](/images/app-connections/doppler/doppler-service-account-select-role.png)
+
+
+ For the best migration experience, we recommend that you give the service account full access to all your projects in order to migrate from all projects within Doppler.
+
+ ![Doppler Service Account Role](/images/app-connections/doppler/doppler-service-account-configure-role.png)
+ </Step>
+
<Step title="Click in create service account token">
Click in the "+" icon in the Service Account API Tokens container
diff --git a/docs/snippets/AppConnectionsBrowser.jsx b/docs/snippets/AppConnectionsBrowser.jsx
index 8fa67f89da..b625b51460 100644
--- a/docs/snippets/AppConnectionsBrowser.jsx
+++ b/docs/snippets/AppConnectionsBrowser.jsx
@@ -437,6 +437,14 @@ export const AppConnectionsBrowser = () => {
description:
"Learn how to connect a remote Infisical instance to sync secrets between Infisical projects.",
category: "Security",
+ },
+ {
+ name: "Doppler",
+ slug: "doppler",
+ path: "/integrations/app-connections/doppler",
+ description:
+ "Learn how to connect Doppler for migrating data from Doppler to Infisical.",
+ category: "DevOps Tools",
}
].sort(function (a, b) {
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
diff --git a/frontend/src/hooks/api/auditLogs/constants.tsx b/frontend/src/hooks/api/auditLogs/constants.tsx
index 997693067f..644d18a690 100644
--- a/frontend/src/hooks/api/auditLogs/constants.tsx
+++ b/frontend/src/hooks/api/auditLogs/constants.tsx
@@ -369,7 +369,12 @@ export const eventToNameMap: { [K in EventType]: string } = {
[EventType.SECRET_VALIDATION_RULE_CREATE]: "Create Secret Validation Rule",
[EventType.SECRET_VALIDATION_RULE_UPDATE]: "Update Secret Validation Rule",
- [EventType.SECRET_VALIDATION_RULE_DELETE]: "Delete Secret Validation Rule"
+ [EventType.SECRET_VALIDATION_RULE_DELETE]: "Delete Secret Validation Rule",
+
+ // External Migration
+ [EventType.EXTERNAL_MIGRATION_CREATE]: "Create External Migration",
+ [EventType.EXTERNAL_MIGRATION_UPDATE]: "Update External Migration",
+ [EventType.EXTERNAL_MIGRATION_DELETE]: "Delete External Migration"
};
export const userAgentTypeToNameMap: { [K in UserAgentType]: string } = {
diff --git a/frontend/src/hooks/api/auditLogs/enums.tsx b/frontend/src/hooks/api/auditLogs/enums.tsx
index 5956e5516d..88a2107206 100644
--- a/frontend/src/hooks/api/auditLogs/enums.tsx
+++ b/frontend/src/hooks/api/auditLogs/enums.tsx
@@ -367,5 +367,10 @@ export enum EventType {
// Secret Validation Rules
SECRET_VALIDATION_RULE_CREATE = "secret-validation-rule-create",
SECRET_VALIDATION_RULE_UPDATE = "secret-validation-rule-update",
- SECRET_VALIDATION_RULE_DELETE = "secret-validation-rule-delete"
+ SECRET_VALIDATION_RULE_DELETE = "secret-validation-rule-delete",
+
+ // External Migration
+ EXTERNAL_MIGRATION_CREATE = "external-migration-create",
+ EXTERNAL_MIGRATION_UPDATE = "external-migration-update",
+ EXTERNAL_MIGRATION_DELETE = "external-migration-delete"
}
diff --git a/frontend/src/hooks/api/migration/mutations.tsx b/frontend/src/hooks/api/migration/mutations.tsx
index 1a2d1a4358..216f471023 100644
--- a/frontend/src/hooks/api/migration/mutations.tsx
+++ b/frontend/src/hooks/api/migration/mutations.tsx
@@ -7,13 +7,13 @@ import { secretKeys } from "@app/hooks/api/secrets/queries";
import { projectKeys } from "../projects";
import { externalMigrationQueryKeys } from "./queries";
import {
+ ExternalMigrationImportStatus,
TCreateExternalMigrationConfigDTO,
TDeleteExternalMigrationConfigDTO,
TExternalMigrationConfig,
TImportDopplerSecretsDTO,
TImportVaultSecretsDTO,
- TUpdateExternalMigrationConfigDTO,
- VaultImportStatus
+ TUpdateExternalMigrationConfigDTO
} from "./types";
export const useImportEnvKey = () => {
@@ -81,9 +81,9 @@ export const useImportVault = () => {
export const useImportVaultSecrets = () => {
const queryClient = useQueryClient();
- return useMutation<{ status: VaultImportStatus }, object, TImportVaultSecretsDTO>({
+ return useMutation<{ status: ExternalMigrationImportStatus }, object, TImportVaultSecretsDTO>({
mutationFn: async (dto) => {
- const { data } = await apiRequest.post<{ status: VaultImportStatus }>(
+ const { data } = await apiRequest.post<{ status: ExternalMigrationImportStatus }>(
"/api/v3/external-migration/vault/import-secrets",
dto
);
diff --git a/frontend/src/hooks/api/migration/types.ts b/frontend/src/hooks/api/migration/types.ts
index a23b1b2519..83be73b5f9 100644
--- a/frontend/src/hooks/api/migration/types.ts
+++ b/frontend/src/hooks/api/migration/types.ts
@@ -64,7 +64,7 @@ export type TImportDopplerSecretsDTO = {
targetSecretPath: string;
};
-export enum VaultImportStatus {
+export enum ExternalMigrationImportStatus {
Imported = "imported",
ApprovalRequired = "approval-required"
}
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
index 422bb9014c..10d2ea460e 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
@@ -26,10 +26,9 @@ export const ExternalMigrationsTab = () => {
<DocumentationLinkBadge href={EXTERNAL_MIGRATIONS_DOCS_HREF} />
</div>
<p className="mt-1 mb-6 text-sm text-muted">
- Connect <span className="text-foreground/90">HashiCorp Vault</span> or{" "}
- <span className="text-foreground/90">Doppler</span> to enable migration features across
- Infisical: import KV secrets (and from Vault, policies, Kubernetes-related resources,
- and more) directly from the UI.
+ Connect HashiCorp Vault or Doppler to enable migration features across Infisical: import
+ KV secrets (and from Vault, policies, Kubernetes-related resources, and more) directly
+ from the UI.
</p>
</div>
<InPlatformMigrationSection />
@@ -56,7 +55,7 @@ export const ExternalMigrationsTab = () => {
</div>
<Button
- variant="project"
+ variant="org"
type="button"
className="gap-1.5"
onClick={() => {
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/InPlatformMigrationSection.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/InPlatformMigrationSection.tsx
index 4a10098a98..8f0d24c8f0 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/InPlatformMigrationSection.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/InPlatformMigrationSection.tsx
@@ -247,7 +247,7 @@ export const InPlatformMigrationSection = () => {
<div className="mb-4 flex flex-wrap items-center justify-between gap-2">
<h3 className="text-lg font-medium text-mineshaft-100">Configurations</h3>
<Button
- variant="project"
+ variant="org"
type="button"
className="gap-1.5"
onClick={() => setIsProviderPickerOpen(true)}
@@ -259,22 +259,6 @@ export const InPlatformMigrationSection = () => {
{renderTable()}
- <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}
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectInPlatformMigrationProviderModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectInPlatformMigrationProviderModal.tsx
index 9f8aadeacf..38174d2b62 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectInPlatformMigrationProviderModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/SelectInPlatformMigrationProviderModal.tsx
@@ -63,16 +63,18 @@ export const SelectInPlatformMigrationProviderModal = ({
}}
className="group flex flex-col items-center rounded-md border border-border bg-container p-4 text-left duration-200 hover:bg-foreground/5"
>
- <img
- src={`/images/integrations/${imageFileName}`}
- style={{ width: size, height: size }}
- className="mt-1 object-contain"
- alt=""
- />
+ <div className="flex h-12 items-center justify-center">
+ <img
+ src={`/images/integrations/${imageFileName}`}
+ style={{ width: size, height: size }}
+ className="object-contain"
+ alt=""
+ />
+ </div>
<span className="mt-3 text-center text-sm font-medium text-foreground group-hover:text-foreground">
{name}
</span>
- <span className="mt-2 text-center text-xs leading-snug text-muted">
+ <span className="mt-2 flex-1 text-center text-xs leading-snug text-muted">
{description}
</span>
</button>
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultNamespaceConfigModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultNamespaceConfigModal.tsx
index 0ef39579be..e9de0debcb 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultNamespaceConfigModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultNamespaceConfigModal.tsx
@@ -210,7 +210,7 @@ export const VaultNamespaceConfigModal = ({ isOpen, onOpenChange, editConfig }:
<Button type="button" variant="ghost" onClick={handleClose}>
Cancel
</Button>
- <Button type="submit" variant="project" isPending={isPending} isDisabled={isPending}>
+ <Button type="submit" variant="org" isPending={isPending} isDisabled={isPending}>
{isEdit ? "Update" : "Create"}
</Button>
</DialogFooter>
diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
index 33cd117bbc..bbec4c2d10 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
@@ -146,7 +146,10 @@ import {
useImportDopplerSecrets,
useImportVaultSecrets
} from "@app/hooks/api/migration";
-import { ExternalMigrationProviders, VaultImportStatus } from "@app/hooks/api/migration/types";
+import {
+ ExternalMigrationImportStatus,
+ ExternalMigrationProviders
+} from "@app/hooks/api/migration/types";
import { ProjectType, ProjectVersion } from "@app/hooks/api/projects/types";
import { useUpdateFolderBatch } from "@app/hooks/api/secretFolders/queries";
import { PendingAction, TUpdateFolderBatchDTO } from "@app/hooks/api/secretFolders/types";
@@ -840,7 +843,7 @@ const OverviewPageContent = () => {
vaultSecretPath: vaultPath
});
- if (result.status === VaultImportStatus.ApprovalRequired) {
+ if (result.status === ExternalMigrationImportStatus.ApprovalRequired) {
createNotification({
type: "info",
text: "Secret change request created successfully. Awaiting approval."
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
index 241e8cc5ac..c71e7417ff 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
@@ -87,7 +87,10 @@ import {
} from "@app/hooks/api/dashboard/queries";
import { UsedBySecretSyncs } from "@app/hooks/api/dashboard/types";
import { useGetExternalMigrationConfigs, useImportVaultSecrets } from "@app/hooks/api/migration";
-import { ExternalMigrationProviders, VaultImportStatus } from "@app/hooks/api/migration/types";
+import {
+ ExternalMigrationImportStatus,
+ ExternalMigrationProviders
+} from "@app/hooks/api/migration/types";
import { secretApprovalRequestKeys } from "@app/hooks/api/secretApprovalRequest/queries";
import { PendingAction } from "@app/hooks/api/secretFolders/types";
import { fetchProjectSecrets, secretKeys } from "@app/hooks/api/secrets/queries";
@@ -676,7 +679,7 @@ export const ActionBar = ({
vaultSecretPath: vaultPath
});
- if (result.status === VaultImportStatus.ApprovalRequired) {
+ if (result.status === ExternalMigrationImportStatus.ApprovalRequired) {
createNotification({
type: "info",
text: "Secret change request created successfully. Awaiting approval."
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/DopplerSecretImportModal.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/DopplerSecretImportModal.tsx
index afb5a45cf2..27fcaf9568 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/DopplerSecretImportModal.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/DopplerSecretImportModal.tsx
@@ -1,18 +1,23 @@
import { useEffect, useMemo } from "react";
import { Controller, useForm } from "react-hook-form";
-import { faInfoCircle } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod";
+import { InfoIcon } from "lucide-react";
import { z } from "zod";
import {
Button,
- FilterableSelect,
- FormControl,
- Modal,
- ModalClose,
- ModalContent
-} from "@app/components/v2";
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ Field,
+ FieldContent,
+ FieldError,
+ FieldLabel
+} from "@app/components/v3";
+import { FilterableSelect } from "@app/components/v3/generic/ReactSelect";
import { useListAppConnections } from "@app/hooks/api/appConnections/queries";
import { useGetDopplerEnvironments, useGetDopplerProjects } from "@app/hooks/api/migration/queries";
import { TExternalMigrationConfig } from "@app/hooks/api/migration/types";
@@ -101,38 +106,35 @@ export const DopplerSecretImportModal = ({
};
return (
- <Modal
- isOpen={isOpen}
+ <Dialog
+ open={isOpen}
onOpenChange={(open) => {
if (!open) reset();
onOpenChange(open);
}}
>
- <ModalContent
- bodyClassName="overflow-visible"
- title="Import from Doppler"
- subTitle="Select a Doppler project and environment to import secrets into the current Infisical folder."
- className="max-w-2xl"
- >
- <div className="mb-4 rounded-md bg-primary/10 p-3 text-sm text-mineshaft-200">
- <div className="flex items-start gap-2">
- <FontAwesomeIcon icon={faInfoCircle} className="mt-0.5 text-primary" />
- <div>
- <div className="mb-2">
- <strong>Import secrets from Doppler</strong>
- </div>
- <div className="space-y-1.5 text-xs leading-relaxed">
- <p>
- Secrets will be imported into environment{" "}
- <code className="text-xs">{environment}</code> at path{" "}
- <code className="text-xs">{secretPath}</code>.
- </p>
- </div>
- </div>
+ <DialogContent className="max-w-lg overflow-visible" showCloseButton>
+ <DialogHeader>
+ <DialogTitle>Import from Doppler</DialogTitle>
+ <DialogDescription>
+ Select a Doppler project and environment to import secrets into the current Infisical
+ folder.
+ </DialogDescription>
+ </DialogHeader>
+
+ <div className="mb-4 flex items-start gap-3 rounded-md border border-project/20 bg-project/5 p-3 text-sm text-project">
+ <InfoIcon className="mt-0.5 size-4 shrink-0" />
+ <div>
+ <p className="font-medium text-foreground">Import destination</p>
+ <p className="mt-1 text-foreground/75">
+ Secrets will be imported into environment{" "}
+ <code className="text-xs">{environment}</code> at path{" "}
+ <code className="text-xs">{secretPath}</code>.
+ </p>
</div>
</div>
- <form onSubmit={handleSubmit(onFormSubmit)}>
+ <form onSubmit={handleSubmit(onFormSubmit)} className="space-y-4">
{hasMultipleConfigs && (
<Controller
control={control}
@@ -140,24 +142,23 @@ export const DopplerSecretImportModal = ({
render={({ field }) => {
const selectedItem = configOptions.find((o) => o.id === field.value);
return (
- <FormControl
- label="Doppler configuration"
- className="mb-4"
- isError={Boolean(errors.configId)}
- errorText={errors.configId?.message}
- >
- <FilterableSelect
- value={selectedItem || null}
- onChange={(newValue) => {
- const single = Array.isArray(newValue) ? newValue[0] : newValue;
- field.onChange(single && "id" in single ? single.id : "");
- }}
- options={configOptions}
- placeholder="Select Doppler configuration..."
- getOptionLabel={(option) => option.label}
- getOptionValue={(option) => option.id}
- />
- </FormControl>
+ <Field>
+ <FieldLabel>Doppler Configuration</FieldLabel>
+ <FieldContent>
+ <FilterableSelect
+ value={selectedItem || null}
+ onChange={(newValue) => {
+ const single = Array.isArray(newValue) ? newValue[0] : newValue;
+ field.onChange(single && "id" in single ? single.id : "");
+ }}
+ options={configOptions}
+ placeholder="Select Doppler configuration..."
+ getOptionLabel={(option) => option.label}
+ getOptionValue={(option) => option.id}
+ />
+ </FieldContent>
+ <FieldError>{errors.configId?.message}</FieldError>
+ </Field>
);
}}
/>
@@ -170,30 +171,29 @@ export const DopplerSecretImportModal = ({
const selectedItem = dopplerProjects.find((p) => p.slug === field.value);
return (
- <FormControl
- label="Source project"
- className="mb-4"
- 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}
- isDisabled={!selectedConfigId}
- options={dopplerProjects}
- placeholder="Select source project..."
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.slug}
- />
- </FormControl>
+ <Field>
+ <FieldLabel>Source Project</FieldLabel>
+ <FieldContent>
+ <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 && Boolean(selectedConfigId)}
+ isDisabled={!selectedConfigId}
+ options={dopplerProjects}
+ placeholder="Select source project..."
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.slug}
+ />
+ </FieldContent>
+ <FieldError>{errors.dopplerProject?.message}</FieldError>
+ </Field>
);
}}
/>
@@ -205,46 +205,48 @@ export const DopplerSecretImportModal = ({
const selectedItem = dopplerEnvironments.find((e) => e.slug === field.value);
return (
- <FormControl
- label="Source environment"
- className="mb-4"
- 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>
+ <Field>
+ <FieldLabel>Source Environment</FieldLabel>
+ <FieldContent>
+ <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 && Boolean(selectedDopplerProject)}
+ isDisabled={!selectedDopplerProject}
+ options={dopplerEnvironments}
+ placeholder="Select source environment..."
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.slug}
+ />
+ </FieldContent>
+ <FieldError>{errors.dopplerEnvironment?.message}</FieldError>
+ </Field>
);
}}
/>
- <div className="mt-8 flex space-x-4">
- <Button type="submit" isLoading={isSubmitting} isDisabled={isSubmitting}>
- Import secrets
+ <DialogFooter className="gap-2 sm:gap-2">
+ <Button type="button" variant="ghost" onClick={handleClose}>
+ Cancel
</Button>
- <ModalClose asChild>
- <Button colorSchema="secondary" variant="plain">
- Cancel
- </Button>
- </ModalClose>
- </div>
+ <Button
+ type="submit"
+ variant="project"
+ isPending={isSubmitting}
+ isDisabled={isSubmitting}
+ >
+ Import Secrets
+ </Button>
+ </DialogFooter>
</form>
- </ModalContent>
- </Modal>
+ </DialogContent>
+ </Dialog>
);
};