Repository navigation
Add configurable password strength validation - #124
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds local password-strength validation with
it.HasPasswordStrength(), standalonevalidate.PasswordStrength, andvalidate.EstimatePasswordStrengthfor score displays. The default minimum is Medium (2), configurable from Weak (1) to VeryStrong (4).The estimator reproduces Symfony 8.0's byte-based entropy heuristic without dictionaries, sequence detection, normalization, dependencies, or network requests. README documents its limitations, including high scores for predictable sequences. Custom estimators can replace the algorithm; out-of-range scores and invalid minimums produce configuration errors, and nil estimators restore the default.
Nil pointers are skipped. Empty strings are evaluated and rejected by the default estimator, matching Symfony. Violations only receive strength/minimum parameters, never the password automatically. Includes customizable errors/messages, groups, generic This/Each support, English/Russian translations, examples, and an Unreleased changelog entry.
Validation:
bash scripts/test-all.shpassed (formatting, vet, golangci-lint v2.13.2, unit and race tests, module tidy and verification). Tests cover Symfony reference examples, all category/score thresholds, repeats and UTF-8 examples, custom estimators and invalid configurations, empty input, translations, and absence of password data in violation parameters.Closes #109.