Allow configure required and optional symbols for password generation#251
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #251 +/- ##
============================================
- Coverage 94.69% 94.64% -0.05%
+ Complexity 1888 1877 -11
============================================
Files 193 194 +1
Lines 3955 3958 +3
Branches 393 391 -2
============================================
+ Hits 3745 3746 +1
- Misses 110 112 +2
Partials 100 100
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Contributor
|
I like it at lot, but do you think it should be part of Lorem? I know the underlying implementation is using Lorem, but wouldn't the builder be more at home in Internet? |
Collaborator
Author
|
Yes it looks also a bit strange for me... |
aa29526 to
c1b67c1
Compare
Collaborator
Author
|
I moved the logic to |
Contributor
|
Just had a look, looks fine to me! |
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.
The PR allows configuration of optional and required symbols for password generation.
For instance, this code snippet leads to generation of passwords containing at least 1 lowercase letter, 1 uppercase letter, 1 digit and 1 "special" symbol.
in case we want to generate a password containing at least 1 lowercase letter, 2 uppercase letters, 3 digits and 4 "special" symbols we need to adopt
timesIn case number of required symbols is larger than a length of pass to generate than there are 2 options:
IllegalArgumentExceptionto do this invoke.throwIfLengthSmall(true)forPassword.PasswordSymbolsBuilderFurthermore now it allows specify other symbols to generate password
for instance, this code will allow to generate a password containing small ru and en letters and custom special symbols: