1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

feat(change-password-component): Change Password Update [18720] - Undid naming change.

This commit is contained in:
Patrick Pimentel
2025-06-11 21:41:09 -06:00
parent 7bae3d9f6b
commit 1fe3e79f12
14 changed files with 16 additions and 30 deletions

View File

@@ -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

View File

@@ -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(

View File

@@ -134,7 +134,7 @@ describe("WebLoginComponentService", () => {
resetPasswordPolicyEnabled,
]);
internalPolicyService.masterPasswordPolicyOptionsFromSync$.mockReturnValue(
internalPolicyService.masterPasswordPolicyOptions$.mockReturnValue(
of(masterPasswordPolicyOptions),
);

View File

@@ -110,7 +110,7 @@ export class WebLoginComponentService
this.accountService.activeAccount$.pipe(
getUserId,
switchMap((userId) =>
this.policyService.masterPasswordPolicyOptionsFromSync$(userId, policies),
this.policyService.masterPasswordPolicyOptions$(userId, policies),
),
),
);

View File

@@ -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();

View File

@@ -70,7 +70,7 @@ export class WebRegistrationFinishService
}
const masterPasswordPolicyOpts: MasterPasswordPolicyOptions = await firstValueFrom(
this.policyService.masterPasswordPolicyOptionsFromSync$(null, policies),
this.policyService.masterPasswordPolicyOptions$(null, policies),
);
return masterPasswordPolicyOpts;

View File

@@ -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));

View File

@@ -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) => {

View File

@@ -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(

View File

@@ -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<MasterPasswordPolicyOptions | undefined>;

View File

@@ -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,

View File

@@ -82,7 +82,7 @@ export class DefaultPolicyService implements PolicyService {
});
}
masterPasswordPolicyOptionsFromSync$(
masterPasswordPolicyOptions$(
userId: UserId,
policies?: Policy[],
): Observable<MasterPasswordPolicyOptions | undefined> {

View File

@@ -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),
),

View File

@@ -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)),
),
);
}