diff --git a/apps/cli/src/auth/commands/login.command.ts b/apps/cli/src/auth/commands/login.command.ts index 15eb3c3b43d..03af0085e67 100644 --- a/apps/cli/src/auth/commands/login.command.ts +++ b/apps/cli/src/auth/commands/login.command.ts @@ -536,7 +536,7 @@ export class LoginCommand { ); const enforcedPolicyOptions = await firstValueFrom( - this.policyService.masterPasswordPolicyOptionsFromSync$(userId), + this.policyService.masterPasswordPolicyOptions$(userId), ); // Verify master password meets policy requirements diff --git a/apps/web/src/app/admin-console/organizations/members/components/reset-password.component.ts b/apps/web/src/app/admin-console/organizations/members/components/reset-password.component.ts index 7e6993f64f9..80f0745f6d5 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/reset-password.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/components/reset-password.component.ts @@ -98,7 +98,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy { this.accountService.activeAccount$ .pipe( getUserId, - switchMap((userId) => this.policyService.masterPasswordPolicyOptionsFromSync$(userId)), + switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId)), takeUntil(this.destroy$), ) .subscribe( diff --git a/apps/web/src/app/auth/core/services/login/web-login-component.service.spec.ts b/apps/web/src/app/auth/core/services/login/web-login-component.service.spec.ts index f9d3eeafef6..95ddc74c3c5 100644 --- a/apps/web/src/app/auth/core/services/login/web-login-component.service.spec.ts +++ b/apps/web/src/app/auth/core/services/login/web-login-component.service.spec.ts @@ -134,7 +134,7 @@ describe("WebLoginComponentService", () => { resetPasswordPolicyEnabled, ]); - internalPolicyService.masterPasswordPolicyOptionsFromSync$.mockReturnValue( + internalPolicyService.masterPasswordPolicyOptions$.mockReturnValue( of(masterPasswordPolicyOptions), ); diff --git a/apps/web/src/app/auth/core/services/login/web-login-component.service.ts b/apps/web/src/app/auth/core/services/login/web-login-component.service.ts index cfb807f41d0..a9d7de1c562 100644 --- a/apps/web/src/app/auth/core/services/login/web-login-component.service.ts +++ b/apps/web/src/app/auth/core/services/login/web-login-component.service.ts @@ -110,7 +110,7 @@ export class WebLoginComponentService this.accountService.activeAccount$.pipe( getUserId, switchMap((userId) => - this.policyService.masterPasswordPolicyOptionsFromSync$(userId, policies), + this.policyService.masterPasswordPolicyOptions$(userId, policies), ), ), ); diff --git a/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.spec.ts b/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.spec.ts index c7e8bd66a64..fe3b0837aa8 100644 --- a/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.spec.ts +++ b/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.spec.ts @@ -149,9 +149,7 @@ describe("WebRegistrationFinishService", () => { acceptOrgInviteService.getOrganizationInvite.mockResolvedValue(orgInvite); policyApiService.getPoliciesByToken.mockResolvedValue(masterPasswordPolicies); - policyService.masterPasswordPolicyOptionsFromSync$.mockReturnValue( - of(masterPasswordPolicyOptions), - ); + policyService.masterPasswordPolicyOptions$.mockReturnValue(of(masterPasswordPolicyOptions)); const result = await service.getMasterPasswordPolicyOptsFromOrgInvite(); diff --git a/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.ts b/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.ts index 4f24dc50f55..3d99b3b6712 100644 --- a/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.ts +++ b/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.ts @@ -70,7 +70,7 @@ export class WebRegistrationFinishService } const masterPasswordPolicyOpts: MasterPasswordPolicyOptions = await firstValueFrom( - this.policyService.masterPasswordPolicyOptionsFromSync$(null, policies), + this.policyService.masterPasswordPolicyOptions$(null, policies), ); return masterPasswordPolicyOpts; diff --git a/apps/web/src/app/auth/settings/emergency-access/takeover/emergency-access-takeover.component.ts b/apps/web/src/app/auth/settings/emergency-access/takeover/emergency-access-takeover.component.ts index b40086c5e7f..d683545db59 100644 --- a/apps/web/src/app/auth/settings/emergency-access/takeover/emergency-access-takeover.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/takeover/emergency-access-takeover.component.ts @@ -91,9 +91,7 @@ export class EmergencyAccessTakeoverComponent this.accountService.activeAccount$ .pipe( getUserId, - switchMap((userId) => - this.policyService.masterPasswordPolicyOptionsFromSync$(userId, policies), - ), + switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId, policies)), takeUntil(this.destroy$), ) .subscribe((enforcedPolicyOptions) => (this.enforcedPolicyOptions = enforcedPolicyOptions)); diff --git a/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.ts b/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.ts index 36a5e8f91e1..215035a0d16 100644 --- a/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.ts +++ b/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.ts @@ -191,9 +191,7 @@ export class CompleteTrialInitiationComponent implements OnInit, OnDestroy { this.accountService.activeAccount$ .pipe( getUserId, - switchMap((userId) => - this.policyService.masterPasswordPolicyOptionsFromSync$(userId, policies), - ), + switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId, policies)), takeUntil(this.destroy$), ) .subscribe((enforcedPasswordPolicyOptions) => { diff --git a/libs/angular/src/auth/components/change-password.component.ts b/libs/angular/src/auth/components/change-password.component.ts index b2d4b0b5860..ca81f741b23 100644 --- a/libs/angular/src/auth/components/change-password.component.ts +++ b/libs/angular/src/auth/components/change-password.component.ts @@ -56,7 +56,7 @@ export class ChangePasswordComponent implements OnInit, OnDestroy { this.accountService.activeAccount$ .pipe( getUserId, - switchMap((userId) => this.policyService.masterPasswordPolicyOptionsFromSync$(userId)), + switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId)), takeUntil(this.destroy$), ) .subscribe( diff --git a/libs/common/src/admin-console/abstractions/policy/policy.service.abstraction.ts b/libs/common/src/admin-console/abstractions/policy/policy.service.abstraction.ts index 4cdfdc80573..6707af460b6 100644 --- a/libs/common/src/admin-console/abstractions/policy/policy.service.abstraction.ts +++ b/libs/common/src/admin-console/abstractions/policy/policy.service.abstraction.ts @@ -45,7 +45,7 @@ export abstract class PolicyService { * @returns a set of options which represent the minimum Master Password settings that the user must * comply with in order to comply with **all** applicable Master Password policies. */ - abstract masterPasswordPolicyOptionsFromSync$: ( + abstract masterPasswordPolicyOptions$: ( userId: UserId, policies?: Policy[], ) => Observable; diff --git a/libs/common/src/admin-console/services/policy/default-policy.service.spec.ts b/libs/common/src/admin-console/services/policy/default-policy.service.spec.ts index 24fa5c45d7b..7787bdbc943 100644 --- a/libs/common/src/admin-console/services/policy/default-policy.service.spec.ts +++ b/libs/common/src/admin-console/services/policy/default-policy.service.spec.ts @@ -127,9 +127,7 @@ describe("PolicyService", () => { ]; jest.spyOn(policyService as any, "policies$").mockReturnValue(of(model)); - const result = await firstValueFrom( - policyService.masterPasswordPolicyOptionsFromSync$(userId), - ); + const result = await firstValueFrom(policyService.masterPasswordPolicyOptions$(userId)); expect(result).toEqual({ minComplexity: 5, @@ -154,9 +152,7 @@ describe("PolicyService", () => { ]; jest.spyOn(policyService as any, "policies$").mockReturnValue(of(model)); - const result = await firstValueFrom( - policyService.masterPasswordPolicyOptionsFromSync$(userId), - ); + const result = await firstValueFrom(policyService.masterPasswordPolicyOptions$(userId)); expect(result).toBeUndefined(); }); @@ -173,9 +169,7 @@ describe("PolicyService", () => { ]; jest.spyOn(policyService as any, "policies$").mockReturnValue(of(model)); - const result = await firstValueFrom( - policyService.masterPasswordPolicyOptionsFromSync$(userId), - ); + const result = await firstValueFrom(policyService.masterPasswordPolicyOptions$(userId)); expect(result).toEqual({ minComplexity: 0, diff --git a/libs/common/src/admin-console/services/policy/default-policy.service.ts b/libs/common/src/admin-console/services/policy/default-policy.service.ts index 17295fea434..6abb7f36528 100644 --- a/libs/common/src/admin-console/services/policy/default-policy.service.ts +++ b/libs/common/src/admin-console/services/policy/default-policy.service.ts @@ -82,7 +82,7 @@ export class DefaultPolicyService implements PolicyService { }); } - masterPasswordPolicyOptionsFromSync$( + masterPasswordPolicyOptions$( userId: UserId, policies?: Policy[], ): Observable { diff --git a/libs/common/src/admin-console/services/policy/policy-api.service.ts b/libs/common/src/admin-console/services/policy/policy-api.service.ts index dad4caff18e..a4ec8c9baa9 100644 --- a/libs/common/src/admin-console/services/policy/policy-api.service.ts +++ b/libs/common/src/admin-console/services/policy/policy-api.service.ts @@ -107,7 +107,7 @@ export class PolicyApiService implements PolicyApiServiceAbstraction { this.accountService.activeAccount$.pipe( getUserId, switchMap((userId) => - this.policyService.masterPasswordPolicyOptionsFromSync$(userId, [masterPasswordPolicy]), + this.policyService.masterPasswordPolicyOptions$(userId, [masterPasswordPolicy]), ), map((policy) => policy ?? null), ), diff --git a/libs/key-management-ui/src/lock/components/lock.component.ts b/libs/key-management-ui/src/lock/components/lock.component.ts index b101dbc2ab4..043e2333a9e 100644 --- a/libs/key-management-ui/src/lock/components/lock.component.ts +++ b/libs/key-management-ui/src/lock/components/lock.component.ts @@ -603,9 +603,7 @@ export class LockComponent implements OnInit, OnDestroy { this.enforcedMasterPasswordOptions = await firstValueFrom( this.accountService.activeAccount$.pipe( getUserId, - switchMap((userId) => - this.policyService.masterPasswordPolicyOptionsFromSync$(userId), - ), + switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId)), ), ); }