mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-06 23:51:28 +01:00
Remove uses of rxjs in CLI (#4028)
This commit is contained in:
parent
4410eb6270
commit
586ae4346c
@ -1,6 +1,5 @@
|
||||
import * as program from "commander";
|
||||
import * as inquirer from "inquirer";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
import { ExportFormat, ExportService } from "@bitwarden/common/abstractions/export.service";
|
||||
import { PolicyService } from "@bitwarden/common/abstractions/policy/policy.service.abstraction";
|
||||
@ -16,9 +15,7 @@ export class ExportCommand {
|
||||
async run(options: program.OptionValues): Promise<Response> {
|
||||
if (
|
||||
options.organizationid == null &&
|
||||
(await firstValueFrom(
|
||||
this.policyService.policyAppliesToActiveUser$(PolicyType.DisablePersonalVaultExport)
|
||||
))
|
||||
(await this.policyService.policyAppliesToUser(PolicyType.DisablePersonalVaultExport))
|
||||
) {
|
||||
return Response.badRequest(
|
||||
"One or more organization policies prevents you from exporting your personal vault."
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { firstValueFrom, map } from "rxjs";
|
||||
import * as zxcvbn from "zxcvbn";
|
||||
|
||||
import { CryptoService } from "../abstractions/crypto.service";
|
||||
@ -11,7 +10,6 @@ import { EncString } from "../models/domain/enc-string";
|
||||
import { GeneratedPasswordHistory } from "../models/domain/generated-password-history";
|
||||
import { PasswordGeneratorOptions } from "../models/domain/password-generator-options";
|
||||
import { PasswordGeneratorPolicyOptions } from "../models/domain/password-generator-policy-options";
|
||||
import { Policy } from "../models/domain/policy";
|
||||
|
||||
const DefaultOptions: PasswordGeneratorOptions = {
|
||||
length: 14,
|
||||
@ -257,14 +255,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
|
||||
}
|
||||
|
||||
async getPasswordGeneratorPolicyOptions(): Promise<PasswordGeneratorPolicyOptions> {
|
||||
const policies: Policy[] =
|
||||
this.policyService == null
|
||||
? null
|
||||
: await firstValueFrom(
|
||||
this.policyService.policies$.pipe(
|
||||
map((p) => p.filter((policy) => policy.type === PolicyType.PasswordGenerator))
|
||||
)
|
||||
);
|
||||
const policies = await this.policyService?.getAll(PolicyType.PasswordGenerator);
|
||||
let enforcedOptions: PasswordGeneratorPolicyOptions = null;
|
||||
|
||||
if (policies == null || policies.length === 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user