1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-02 11:34:53 +02:00
The browser extension vault (Chrome, Firefox, Opera, Edge, Safari, & more).
Go to file
Shane Melton 07c2c2af20
[AC-1070] Enforce master password policy on login (#4795)
* [EC-1070] Introduce flag for enforcing master password policy on login

* [EC-1070] Update master password policy form

Add the ability to toggle enforceOnLogin flag in web

* [EC-1070] Add API method to retrieve all policies for the current user

* [EC-1070] Refactor forcePasswordReset in state service to support more options

- Use an options class to provide a reason and optional organization id
- Use the OnDiskMemory storage location so the option persists between the same auth session

* [AC-1070] Retrieve single master password policy from identity token response

Additionally, store the policy in the login strategy for future use

* [EC-1070] Introduce master password evaluation in the password login strategy

- If a master password policy is returned from the identity result, evaluate the password.
- If the password does not meet the requirements, save the forcePasswordReset options
- Add support for 2FA by storing the results of the password evaluation on the login strategy instance
- Add unit tests to password login strategy

* [AC-1070] Modify admin password reset component to support update master password on login

- Modify the warning message to depend on the reason

- Use the forcePasswordResetOptions in the update temp password component

* [EC-1070] Require current master password when updating weak mp on login

- Inject user verification service to verify the user
- Conditionally show the current master password field only when updating a weak mp. Admin reset does not require the current master password.

* [EC-1070] Implement password policy check during vault unlock

Checking the master password during unlock is the only applicable place to enforce the master password policy check for SSO users.

* [EC-1070] CLI - Add ability to load MP policies on login

Inject policyApi and organization services into the login command

* [EC-1070] CLI - Refactor update temp password logic to support updating weak passwords

- Introduce new shared method for collecting a valid and confirmed master password from the CLI and generating a new encryption key
- Add separate methods for updating temp passwords and weak passwords.
- Utilize those methods during login flow if not using an API key

* [EC-1070] Add route guard to force password reset when required

* [AC-1070] Use master password policy from verify password response in lock component

* [EC-1070] Update labels in update password component

* [AC-1070] Fix policy service tests

* [AC-1070] CLI - Force sync before any password reset flow

Move up the call to sync the vault before attempting to collect a new master password. Ensures the master password policies are available.

* [AC-1070] Remove unused getAllPolicies method from policy api service

* [AC-1070] Fix missing enforceOnLogin copy in policy service

* [AC-1070] Include current master password on desktop/browser update password page templates

* [AC-1070] Check for forced password reset on account switch in Desktop

* [AC-1070] Rename WeakMasterPasswordOnLogin to WeakMasterPassword

* [AC-1070] Update AuthServiceInitOptions

* [AC-1070] Add None force reset password reason

* [AC-1070] Remove redundant ForcePasswordResetOptions class and replace with ForcePasswordResetReason enum

* [AC-1070] Rename ForceResetPasswordReason file

* [AC-1070] Simplify conditional

* [AC-1070] Refactor logic that saves password reset flag

* [AC-1070] Remove redundant constructors

* [AC-1070] Remove unnecessary state service call

* [AC-1070] Update master password policy component

- Use typed reactive form
- Use CL form components
- Remove bootstrap
- Update error component to support min/max
- Use Utils.minimumPasswordLength value for min value form validation

* [AC-1070] Cleanup leftover html comment

* [AC-1070] Remove overridden default values from MasterPasswordPolicyResponse

* [AC-1070] Hide current master password input in browser for admin password reset

* [AC-1070] Remove clientside user verification

* [AC-1070] Update temp password web component to use CL

- Use CL for form inputs in the Web component template
- Remove most of the bootstrap classes in the Web component template
- Use userVerificationService to build the password request
- Remove redundant current master password null check

* [AC-1070] Replace repeated user inputs email parsing helpers

- Update passwordStrength() method to accept an optional email argument that will be parsed into separate user inputs for use with zxcvbn
- Remove all other repeated getUserInput helper methods that parsed user emails and use the new passwordStrength signature

* [AC-1070] Fix broken login command after forcePasswordReset enum refactor

* [AC-1070] Reduce side effects in base login strategy

- Remove masterPasswordPolicy property from base login.strategy.ts
- Include an IdentityResponse in base startLogin() in addition to AuthResult
- Use the new IdentityResponse to parse the master password policy info only in the PasswordLoginStrategy

* [AC-1070] Cleanup password login strategy tests

* [AC-1070] Remove unused field

* [AC-1070] Strongly type postAccountVerifyPassword API service method

- Remove redundant verify master password response
- Use MasterPasswordPolicyResponse instead

* [AC-1070] Use ForceResetPassword.None during account switch check

* [AC-1070] Fix check for forcePasswordReset reason after addition of None

* [AC-1070] Redirect a user home if on the update temp password page without a reason

* [AC-1070] Use bit-select and bit-option

* [AC-1070] Reduce explicit form control definitions for readability

* [AC-1070] Import SelectModule in Shared web module

* [AC-1070] Add check for missing 'at' symbol

* [AC-1070] Remove redundant unpacking and null coalescing

* [AC-1070] Update passwordStrength signature and add jsdocs

* [AC-1070] Remove variable abbreviation

* [AC-1070] Restore Id attributes on form inputs

* [AC-1070] Clarify input value min/max error messages

* [AC-1070] Add input min/max value example to storybook

* [AC-1070] Add missing spinner to update temp password form

* [AC-1070] Add missing ids to form elements

* [AC-1070] Remove duplicate force sync and update comment

* [AC-1070] Switch backticks to quotation marks

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-04-17 07:35:37 -07:00
.github [DEVOPS-1260] - Update KV names (#5209) 2023-04-13 09:24:09 -06:00
.husky Make husky hook executable (#2900) 2022-06-14 07:26:50 +02:00
.storybook [SM-43] create product-switcher (#4189) 2022-12-21 16:50:41 -05:00
.vscode Add eslint-plugin-rxjs & rxjs-angular (#3373) 2022-08-26 18:09:28 +02:00
apps [AC-1070] Enforce master password policy on login (#4795) 2023-04-17 07:35:37 -07:00
bitwarden_license [AC-1045] add action to vault timeout policy (#4782) 2023-04-15 00:11:33 +01:00
libs [AC-1070] Enforce master password policy on login (#4795) 2023-04-17 07:35:37 -07:00
.editorconfig Add support for migrated jslib (#2826) 2022-06-03 18:01:07 +02:00
.eslintignore Auth/ps 2298 reorg auth (#4564) 2023-02-06 15:53:37 -06:00
.eslintrc.json [PM-328] Move common/importer to libs/importer (tools-migration) (#5060) 2023-03-23 11:43:27 +01:00
.git-blame-ignore-revs Add support for migrated jslib (#2826) 2022-06-03 18:01:07 +02:00
.gitattributes Apply Prettier (#2238) 2021-12-21 15:43:35 +01:00
.gitignore Upload and process test results as an artifact and report (#4435) 2023-01-11 09:01:02 -05:00
.nvmrc [EC-184] Desktop cleanup (#2553) 2022-05-05 19:03:56 +02:00
.prettierignore Auth/ps 2298 reorg auth (#4564) 2023-02-06 15:53:37 -06:00
.prettierrc.json [EC-183] Move eslint and prettier to project root (#2536) 2022-05-03 21:45:37 +02:00
angular.json Disable Angular Usage Analytics & Storybook Telemetry (#3903) 2022-10-27 12:22:33 -04:00
clients.code-workspace Override eslint config for vscode workspace (#4566) 2023-01-26 14:26:21 +01:00
CONTRIBUTING.md Update README and CONTRIBUTING to point to contributing.bitwarden.com (#2771) 2022-06-13 17:34:07 +10:00
jest.config.js [PM-328] Move common/importer to libs/importer (tools-migration) (#5060) 2023-03-23 11:43:27 +01:00
LICENSE_BITWARDEN.txt Update LICENSE_BITWARDEN.txt (#3505) 2022-09-13 09:04:36 -04:00
LICENSE_GPL.txt Prepare bitwarden_license directory (#2663) 2022-05-09 17:50:15 +02:00
LICENSE.txt Prepare bitwarden_license directory (#2663) 2022-05-09 17:50:15 +02:00
package-lock.json Bumped desktop version to 2023.3.3 (#5195) 2023-04-10 14:04:00 -07:00
package.json [PM-1691] Upgrade electron builder (#5038) 2023-04-10 20:19:28 +02:00
README.md Remove migration details from the readme (#4780) 2023-02-16 16:11:38 +01:00
SECURITY.md Revise language on SECURITY.md 2022-03-15 15:39:14 -04:00
tailwind.config.js SM-310 [] Secrets (#3355) 2022-12-09 11:21:07 +01:00
tsconfig.eslint.json [SM-329] Merge libs/electron into desktop (#3989) 2022-12-02 12:45:09 +01:00
tsconfig.json [PM-328] Move common/importer to libs/importer (tools-migration) (#5060) 2023-03-23 11:43:27 +01:00

Bitwarden

Github Workflow browser build on master Github Workflow CLI build on master Github Workflow desktop build on master Github Workflow web build on master gitter chat


Bitwarden Client Applications

This repository houses all Bitwarden client applications except the Mobile application.

Please refer to the Clients section of the Contributing Documentation for build instructions, recommended tooling, code style tips, and lots of other great information to get you started.

We're Hiring!

Interested in contributing in a big way? Consider joining our team! We're hiring for many positions. Please take a look at our Careers page to see what opportunities are currently open as well as what it's like to work at Bitwarden.

Contribute

Code contributions are welcome! Please commit any pull requests against the master branch. Learn more about how to contribute by reading the Contributing Guidelines. Check out the Contributing Documentation for how to get started with your first contribution.

Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the SECURITY.md file.