[PR #2238] [MERGED] [SG-886] MasterPassword Strength Indicator #40539

Closed
opened 2026-04-23 19:21:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2238
Author: @andrebispo5
Created: 12/14/2022
Status: Merged
Merged: 12/21/2022
Merged by: @andrebispo5

Base: feature/mp-security-checksHead: feature/SG-886-mp-strength


📝 Commits (10+)

  • e764c45 [SG-886] Add password strength indicator control
  • b05d470 [SG-570] Add weak password dialog check
  • 9593afe code format
  • b940107 [SG-886] rename enum password strength
  • 994fce6 Merge branch 'feature/mp-security-checks' into feature/SG-886-mp-strength
  • 4f365d4 [SG-886] Change control scale
  • 24bdb46 [SG-886] Move calculate user inputs to IPasswordGenerationService, refactor.
  • 925f778 [SG-886] Move formatted string to xaml. Move minimum chars to constant
  • 951a7ac [SG-886] String to enum converter
  • 8fb91a4 [SG-886] PR fixes. Code refactor control

📊 Changes

17 files changed (+433 additions, -31 deletions)

View changed files

📝 src/App/App.csproj (+2 -0)
src/App/Controls/PasswordStrengthProgressBar/IPasswordStrengthable.cs (+11 -0)
src/App/Controls/PasswordStrengthProgressBar/PasswordStrengthCategory.cs (+17 -0)
src/App/Controls/PasswordStrengthProgressBar/PasswordStrengthProgressBar.xaml (+28 -0)
src/App/Controls/PasswordStrengthProgressBar/PasswordStrengthProgressBar.xaml.cs (+107 -0)
src/App/Controls/PasswordStrengthProgressBar/PasswordStrengthViewModel.cs (+67 -0)
📝 src/App/Pages/Accounts/BaseChangePasswordViewModel.cs (+5 -17)
📝 src/App/Pages/Accounts/RegisterPage.xaml (+14 -3)
📝 src/App/Pages/Accounts/RegisterPageViewModel.cs (+40 -7)
📝 src/App/Pages/Accounts/SetPasswordPageViewModel.cs (+4 -3)
📝 src/App/Resources/AppResources.Designer.cs (+63 -0)
📝 src/App/Resources/AppResources.resx (+21 -0)
📝 src/App/Styles/Base.xaml (+11 -0)
src/App/Utilities/ProgressBarExtensions.cs (+25 -0)
📝 src/Core/Abstractions/IPasswordGenerationService.cs (+3 -1)
📝 src/Core/Constants.cs (+1 -0)
📝 src/Core/Services/PasswordGenerationService.cs (+14 -0)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Add new password security strength indicator to registration page.
Add dialog if user tries to create an account with a weak password.

Code Changes

Added new control PasswordStrengthProgressBar.
PasswordStrengthViewModel uses IPasswordStrengthable as IOC.
RegisterViewModel implements IPasswordStrengthable, this allows us to create a PasswordStrengthViewModel and Bind the BindingContext of the PasswordStrengthProgressBar to it. It also provides access to the control's viewmodel properties without extra bindings.

Added helper to contain GetPasswordStrengthUserInput method. Also refactored BaseChangePasswordViewMode and SetPasswordViewmodel to use this helper.

Added new constant MasterPasswordMinimumChars to hold to minimum number of characters for the master password. Refactored BaseChangePasswordViewMode and SetPasswordViewmodel to use this new constant.

Screenshots

https://user-images.githubusercontent.com/4648522/207601073-000bf85c-dcec-464e-8a63-b65629f8de7f.mov

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2238 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 12/14/2022 **Status:** ✅ Merged **Merged:** 12/21/2022 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `feature/mp-security-checks` ← **Head:** `feature/SG-886-mp-strength` --- ### 📝 Commits (10+) - [`e764c45`](https://github.com/bitwarden/android/commit/e764c456468b388ef1e866cde7c652eeaa13aea9) [SG-886] Add password strength indicator control - [`b05d470`](https://github.com/bitwarden/android/commit/b05d470f5deb8588228e93d8d463c6d12fd2d780) [SG-570] Add weak password dialog check - [`9593afe`](https://github.com/bitwarden/android/commit/9593afebac1dba28a212b038bcf5fc97a7bc2546) code format - [`b940107`](https://github.com/bitwarden/android/commit/b9401075d07db24bf621a3a1bef830aca778bd5b) [SG-886] rename enum password strength - [`994fce6`](https://github.com/bitwarden/android/commit/994fce64e6e1f0d7b9308de70ffb68cfa37e8791) Merge branch 'feature/mp-security-checks' into feature/SG-886-mp-strength - [`4f365d4`](https://github.com/bitwarden/android/commit/4f365d4a8182c105bd85cbdd3552e271888cc7cb) [SG-886] Change control scale - [`24bdb46`](https://github.com/bitwarden/android/commit/24bdb4666fe4484cf2d13ede8298e5110be77c3c) [SG-886] Move calculate user inputs to IPasswordGenerationService, refactor. - [`925f778`](https://github.com/bitwarden/android/commit/925f778dd45be088e47b6010e3e1ad7a4b35a5d3) [SG-886] Move formatted string to xaml. Move minimum chars to constant - [`951a7ac`](https://github.com/bitwarden/android/commit/951a7acf515f3f87a7a1730341d919a7b7f45424) [SG-886] String to enum converter - [`8fb91a4`](https://github.com/bitwarden/android/commit/8fb91a472d68695975eb463d6915217cfcba9850) [SG-886] PR fixes. Code refactor control ### 📊 Changes **17 files changed** (+433 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `src/App/App.csproj` (+2 -0) ➕ `src/App/Controls/PasswordStrengthProgressBar/IPasswordStrengthable.cs` (+11 -0) ➕ `src/App/Controls/PasswordStrengthProgressBar/PasswordStrengthCategory.cs` (+17 -0) ➕ `src/App/Controls/PasswordStrengthProgressBar/PasswordStrengthProgressBar.xaml` (+28 -0) ➕ `src/App/Controls/PasswordStrengthProgressBar/PasswordStrengthProgressBar.xaml.cs` (+107 -0) ➕ `src/App/Controls/PasswordStrengthProgressBar/PasswordStrengthViewModel.cs` (+67 -0) 📝 `src/App/Pages/Accounts/BaseChangePasswordViewModel.cs` (+5 -17) 📝 `src/App/Pages/Accounts/RegisterPage.xaml` (+14 -3) 📝 `src/App/Pages/Accounts/RegisterPageViewModel.cs` (+40 -7) 📝 `src/App/Pages/Accounts/SetPasswordPageViewModel.cs` (+4 -3) 📝 `src/App/Resources/AppResources.Designer.cs` (+63 -0) 📝 `src/App/Resources/AppResources.resx` (+21 -0) 📝 `src/App/Styles/Base.xaml` (+11 -0) ➕ `src/App/Utilities/ProgressBarExtensions.cs` (+25 -0) 📝 `src/Core/Abstractions/IPasswordGenerationService.cs` (+3 -1) 📝 `src/Core/Constants.cs` (+1 -0) 📝 `src/Core/Services/PasswordGenerationService.cs` (+14 -0) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [x] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Add new password security strength indicator to registration page. Add dialog if user tries to create an account with a weak password. ## Code Changes Added new control `PasswordStrengthProgressBar`. `PasswordStrengthViewModel` uses `IPasswordStrengthable` as IOC. `RegisterViewModel` implements `IPasswordStrengthable`, this allows us to create a `PasswordStrengthViewModel` and Bind the BindingContext of the `PasswordStrengthProgressBar` to it. It also provides access to the control's viewmodel properties without extra bindings. Added helper to contain `GetPasswordStrengthUserInput` method. Also refactored `BaseChangePasswordViewMode` and `SetPasswordViewmodel` to use this helper. Added new constant `MasterPasswordMinimumChars` to hold to minimum number of characters for the master password. Refactored `BaseChangePasswordViewMode` and `SetPasswordViewmodel` to use this new constant. ## Screenshots <!--Required for any UI changes. Delete if not applicable--> https://user-images.githubusercontent.com/4648522/207601073-000bf85c-dcec-464e-8a63-b65629f8de7f.mov ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 19:21:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#40539