diff --git a/apps/cli/src/tools/export.command.ts b/apps/cli/src/tools/export.command.ts index f5fea794ee..3fbc466efe 100644 --- a/apps/cli/src/tools/export.command.ts +++ b/apps/cli/src/tools/export.command.ts @@ -10,8 +10,6 @@ import { PolicyType } from "@bitwarden/common/admin-console/enums"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { getUserId } from "@bitwarden/common/auth/services/account.service"; import { EventType } from "@bitwarden/common/enums"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { ExportFormat, @@ -30,7 +28,6 @@ export class ExportCommand { private policyService: PolicyService, private eventCollectionService: EventCollectionService, private accountService: AccountService, - private configService: ConfigService, ) {} async run(options: OptionValues): Promise { @@ -55,13 +52,6 @@ export class ExportCommand { const format = password && options.format == "json" ? "encrypted_json" : (options.format ?? "csv"); - if ( - format == "zip" && - !(await this.configService.getFeatureFlag(FeatureFlag.ExportAttachments)) - ) { - return Response.badRequest("Exporting attachments is not supported in this environment."); - } - if (!this.isSupportedExportFormat(format)) { return Response.badRequest( `'${format}' is not a supported export format. Supported formats: ${EXPORT_FORMATS.join( diff --git a/apps/cli/src/vault.program.ts b/apps/cli/src/vault.program.ts index c004d3597c..ce6ac2af94 100644 --- a/apps/cli/src/vault.program.ts +++ b/apps/cli/src/vault.program.ts @@ -464,7 +464,7 @@ export class VaultProgram extends BaseProgram { private exportCommand(): Command { return new Command("export") - .description("Export vault data to a CSV or JSON file.") + .description("Export vault data to a CSV, JSON or ZIP file.") .option("--output ", "Output directory or filename.") .option("--format ", "Export file format.") .option( @@ -476,7 +476,7 @@ export class VaultProgram extends BaseProgram { writeLn("\n Notes:"); writeLn(""); writeLn( - " Valid formats are `csv`, `json`, and `encrypted_json`. Default format is `csv`.", + " Valid formats are `csv`, `json`, `encrypted_json` and zip. Default format is `csv`.", ); writeLn(""); writeLn( @@ -504,7 +504,6 @@ export class VaultProgram extends BaseProgram { this.serviceContainer.policyService, this.serviceContainer.eventCollectionService, this.serviceContainer.accountService, - this.serviceContainer.configService, ); const response = await command.run(options); this.processResponse(response); diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index f9e2d9757b..1d0b1521db 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -46,7 +46,6 @@ export enum FeatureFlag { CriticalApps = "pm-14466-risk-insights-critical-application", EnableRiskInsightsNotifications = "enable-risk-insights-notifications", DesktopSendUIRefresh = "desktop-send-ui-refresh", - ExportAttachments = "export-attachments", /* Vault */ PM8851_BrowserOnboardingNudge = "pm-8851-browser-onboarding-nudge", @@ -97,7 +96,6 @@ export const DefaultFeatureFlagValue = { [FeatureFlag.CriticalApps]: FALSE, [FeatureFlag.EnableRiskInsightsNotifications]: FALSE, [FeatureFlag.DesktopSendUIRefresh]: FALSE, - [FeatureFlag.ExportAttachments]: FALSE, /* Vault */ [FeatureFlag.PM8851_BrowserOnboardingNudge]: FALSE, diff --git a/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts b/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts index 69f77c6ca3..4e9b417583 100644 --- a/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts +++ b/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts @@ -39,8 +39,6 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { getUserId } from "@bitwarden/common/auth/services/account.service"; import { EventType } from "@bitwarden/common/enums"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { FileDownloadService } from "@bitwarden/common/platform/abstractions/file-download/file-download.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; @@ -184,10 +182,6 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit { private onlyManagedCollections = true; private onGenerate$ = new Subject(); - private isExportAttachmentsEnabled$ = this.configService.getFeatureFlag$( - FeatureFlag.ExportAttachments, - ); - constructor( protected i18nService: I18nService, protected toastService: ToastService, @@ -202,7 +196,6 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit { protected organizationService: OrganizationService, private accountService: AccountService, private collectionService: CollectionService, - private configService: ConfigService, ) {} async ngOnInit() { @@ -225,17 +218,14 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit { ), ); - combineLatest([ - this.exportForm.controls.vaultSelector.valueChanges, - this.isExportAttachmentsEnabled$, - ]) + this.exportForm.controls.vaultSelector.valueChanges .pipe(takeUntil(this.destroy$)) - .subscribe(([value, isExportAttachmentsEnabled]) => { + .subscribe(([value]) => { this.organizationId = value !== "myVault" ? value : undefined; this.formatOptions = this.formatOptions.filter((option) => option.value !== "zip"); this.exportForm.get("format").setValue("json"); - if (value === "myVault" && isExportAttachmentsEnabled) { + if (value === "myVault") { this.formatOptions.push({ name: ".zip (with attachments)", value: "zip" }); } });