Skip to content

Commit

Permalink
Update zxcvbn (#864)
Browse files Browse the repository at this point in the history
## 📔 Objective

This contains a small breaking change in the zxcvbn API, so I've created
the PR manually.

With this update and #865 we get rid of any dependencies using `syn
0.x`, which should help a little bit with build times.

## ⏰ Reminders before review

- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or
informed the documentation
  team

## 🦮 Reviewer guidelines

<!-- Suggested interactions but feel free to use (or not) as you desire!
-->

- 👍 (`:+1:`) or similar for great changes
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
- ❓ (`:question:`) for questions
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry
that's not quite a confirmed
  issue and could potentially benefit from discussion
- 🎨 (`:art:`) for suggestions / improvements
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or
concerns needing attention
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or
indications of technical debt
- ⛏ (`:pick:`) for minor or nitpick changes
  • Loading branch information
dani-garcia authored Jun 28, 2024
1 parent 56547d7 commit adeb707
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 72 deletions.
95 changes: 25 additions & 70 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/bitwarden-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ thiserror = ">=1.0.40, <2.0"
uniffi = { version = "=0.27.2", optional = true, features = ["tokio"] }
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] }
zxcvbn = ">= 2.2.2, <3.0"
zxcvbn = ">=3.0.1, <4.0"

[target.'cfg(all(not(target_os = "android"), not(target_arch="wasm32")))'.dependencies]
# By default, we use rustls as the TLS stack and rust-platform-verifier to support user-installed root certificates
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-core/src/auth/password/strength.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) fn password_strength(
let mut arr: Vec<_> = inputs.iter().map(String::as_str).collect();
arr.extend(GLOBAL_INPUTS);

zxcvbn(&password, &arr).map_or(0, |e| e.score())
zxcvbn(&password, &arr).score().into()
}

fn email_to_user_inputs(email: &str) -> Vec<String> {
Expand Down

0 comments on commit adeb707

Please sign in to comment.