Skip to content

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

feat(backend): add connection validation and approval-required status for Doppler imports

Igor Corread1aa42b9ff06
diff --git a/backend/src/services/external-migration/external-migration-service.ts b/backend/src/services/external-migration/external-migration-service.ts
index 557ca03314..772e066971 100644
--- a/backend/src/services/external-migration/external-migration-service.ts
+++ b/backend/src/services/external-migration/external-migration-service.ts
@@ -890,7 +890,7 @@ export const externalMigrationServiceFactory = ({
const dopplerSecrets = await getDopplerSecrets(appConnection, dopplerProject, dopplerEnvironment);
try {
- await secretService.createManySecretsRaw({
+ const secretOperation = await secretService.createManySecretsRaw({
actorId: actor.id,
actor: actor.type,
actorAuthMethod: actor.authMethod,
@@ -903,13 +903,17 @@ export const externalMigrationServiceFactory = ({
secretValue
}))
});
+
+ if (secretOperation.type === SecretProtectionType.Approval) {
+ return { status: VaultImportStatus.ApprovalRequired, imported: 0 };
+ }
} catch (error) {
throw new BadRequestError({
message: `Failed to import Doppler secrets. ${error instanceof Error ? error.message : "Unknown error"}`
});
}
- return { imported: Object.keys(dopplerSecrets).length };
+ return { status: VaultImportStatus.Imported, imported: Object.keys(dopplerSecrets).length };
};
return {