-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve the PIN Enter repetition validation rule and add relevant messages #1401
Open
jian4on
wants to merge
10
commits into
openwallet-foundation:main
Choose a base branch
from
jian4on:jian4on/did-2011
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
276f31e
Refactor the PINValidation for adjacent numbers repetition and releva…
jian4on 8f4d738
Fixed typo in commments
jian4on a0fd478
Resolved the 'Cognitive Complexity' issue in code scan
jian4on 013a819
Removed the 4-times repetition rule, fixed test failures
jian4on 5c412ff
Changed the no_repeated_numbers PIN rule to max_repeated_numbers and …
jian4on 354f500
Fixed test
jian4on bafa89c
Restore the default no_repeated_numbers behavior, but keep the new va…
jian4on fc6edee
Changed the adjacent PIN number repetition validation to a number typ…
jian4on 9cadf77
Merge branch 'main' into jian4on/did-2011
al-rosenthal 005976c
Refactor the repetition validating rule, set '0' as 'disable repetiti…
jian4on File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -10,11 +10,16 @@ export enum AuthLevel { | |||||||||
BiometricsOnly = 'BiometricsOnly', | ||||||||||
} | ||||||||||
|
||||||||||
/* | ||||||||||
no_repeated_numbers - adjacent characters allowed repeating times | ||||||||||
0 - Disable adjacent number repeating validation, any times repeating are allowed | ||||||||||
n > 0 - Enable the repeating validation, n repeating times are forbidden, e.g. n = 2 forbid repeating 2 times, '11' is allowed but '111' forbidden | ||||||||||
*/ | ||||||||||
export interface PINValidationRules { | ||||||||||
only_numbers: boolean | ||||||||||
min_length: number | ||||||||||
max_length: number | ||||||||||
no_repeated_numbers: boolean | number | ||||||||||
no_repeated_numbers: number | ||||||||||
no_repetition_of_the_two_same_numbers: boolean | number | ||||||||||
Comment on lines
+22
to
23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably make the same change for the rules below:
Suggested change
|
||||||||||
no_series_of_numbers: boolean | ||||||||||
no_even_or_odd_series_of_numbers: boolean | ||||||||||
|
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is in draft but if it's doable could we keep the defaults the same and just allow for opt-in behavior with the injectable
PINSecurity.rules
config we have currently?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put both PINSecurity and PINCreationValidation to IoC container, then the wallet variants can customize them without changinf Bifold default validating behavior. I will discuss with team. Thanks @bryce-mcmath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back to default, but change the validating logic for '0' as 'repeating times' instead of its boolean value, keep the extra message for numbers repeating allowed but the repeating times exceeding the max times rule