pub fn validate_password(password: &str) -> PasswordValidationExpand description
Validate a password and return strength assessment with suggestions.
§Algorithm
- Check for presence of lowercase, uppercase, digits, and special characters
- Compute length score: 0 (0-7), 1 (8-11), 2 (12-15), 3 (16+)
- Sum all criteria to get score (0-7)
- Map score to strength level
§Example
use coding_agent_search::pages::password::{PasswordStrength, validate_password};
let result = validate_password("MySecureP@ssw0rd!");
assert_eq!(result.strength, PasswordStrength::Strong);
assert!(result.suggestions.is_empty());