-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improve PIN handling for creating and importing accounts #1623
Merged
clangenb
merged 7 commits into
master
from
cl/profile-import-account-does-not-require-confirm
Jan 20, 2024
Merged
Improve PIN handling for creating and importing accounts #1623
clangenb
merged 7 commits into
master
from
cl/profile-import-account-does-not-require-confirm
Jan 20, 2024
Conversation
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
clangenb
commented
Jan 19, 2024
Comment on lines
+36
to
+43
/// Persists the new PIN in the secure storage. | ||
/// | ||
/// Attention: This function must be called *exclusively* upon: | ||
/// * Setting the PIN initially | ||
/// * Changing the PIN | ||
Future<void> persistNewPin(String pin) async { | ||
cachedPin = pin; | ||
await loginService.setPin(pin); | ||
await loginService.persistPin(pin); |
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 wanted this to be more expressive that this is a sensitive operation that should be used with caution.
clangenb
added
A1-bugfix
PR fixes a bug
B0-low
Does not elevate a release containing this beyond "low priority"
C0-breaksnothing
PR does not introduce any breaking changes
labels
Jan 19, 2024
clangenb
changed the title
Simplify creating or importing new accounts
Improve code paths around PIN handling for creating and importing accounts
Jan 19, 2024
clangenb
changed the title
Improve code paths around PIN handling for creating and importing accounts
Improve PIN handling for creating and importing accounts
Jan 19, 2024
clangenb
deleted the
cl/profile-import-account-does-not-require-confirm
branch
January 20, 2024 08:06
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A1-bugfix
PR fixes a bug
B0-low
Does not elevate a release containing this beyond "low priority"
C0-breaksnothing
PR does not introduce any breaking changes
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.
I was about to investigate #1496, where I noticed that the account importing and the PIN querying was much more complicated and obfuscated than necessary (to be fair, parts of the simplifications were only possible after #1618).
Summary of changes:
NewAccountStore
to also query the pin, as it is not even needed anymore to create new accounts. Simply ask for the PIN if not cached on the Create/Import page. Closes account import fails at first attempt if PIN not cached #1496.setPin
in cases where we only wanted to (runtime-)cache the PIN, butsetPin
actually persists them to the secure storage. I removed all cases ofsetPIN
except for when actually setting the PIN or changing the PIN.