-
Notifications
You must be signed in to change notification settings - Fork 32
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
[PM-14983] Support Optic ID and any future biometric authentication types #1146
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # BitwardenShared/UI/Platform/Application/Support/Localizations/en.lproj/Localizable.strings
Thank you for your contribution! We've added this to our internal Community PR board for review. |
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.
Thank you for your contribution! I've left a quick note about some comments, but will try to give this the fuller attention it deserves when I get a chance.
BitwardenShared/UI/Auth/VaultUnlockSetup/VaultUnlockSetupProcessorTests.swift
Outdated
Show resolved
Hide resolved
Hi! 👋🏻 It looks like there's a conflict in the strings file; can you please resolve that? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1146 +/- ##
==========================================
- Coverage 89.49% 89.48% -0.02%
==========================================
Files 688 688
Lines 43498 43519 +21
==========================================
+ Hits 38929 38943 +14
- Misses 4569 4576 +7 ☔ View full report in Codecov by Sentry. |
No New Or Fixed Issues Found |
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.
Thank you again for your contribution! On the whole this looks good, just a lot of little things to get it in line with our typical code organization.
I'm not sure what the best solution for the capitalization of "biometrics" for the unknown case is, though. I would say it may make more sense to leave it out as a default case, but it looks like that's an error as of Swift 6, which is reasonable. We may need a string specifically for when the generic biometrics is used in a larger string, like this; it's probably worth investigating how we handle this elsewhere in the app, I just don't know it offhand.
case opticID | ||
|
||
/// Unknown other biometric authentication | ||
case biometrics |
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 think this case would be better named unknown
, in line with its comment. Based on the type we already know it's biometrics, and it'd be better to be clear that it's a type unknown to us currently. That said, I think keeping it the generic "Use biometrics to unlock" in the strings file is fine.
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 have renamed the case to unknown
.
@@ -129,6 +129,30 @@ class VaultUnlockSetupProcessorTests: BitwardenTestCase { | |||
XCTAssertEqual(subject.state.unlockMethods, [.biometrics(.touchID), .pin]) | |||
} | |||
|
|||
/// `perform(_:)` with `.loadData` fetches the biometrics unlock status for a device with Optic ID. |
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.
🎨 We prefer tests to be alphabetized if possible
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 have alphabetized the added tests.
case .opticID: | ||
Localizations.unlockWith(Localizations.opticID) | ||
case .biometrics: | ||
Localizations.unlockWith(Localizations.biometrics) |
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.
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 added a new localization string entry for unknownBiometrics
that is lowercased.
case .opticID: | ||
Localizations.pinRequireBioOrMasterPasswordRestart(Localizations.opticID) | ||
case .biometrics: | ||
Localizations.pinRequireBioOrMasterPasswordRestart(Localizations.biometrics) |
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.
🎨 This is another case where "Biometrics" being capitalized looks weird.
@@ -222,6 +222,28 @@ class AlertSettingsTests: BitwardenTestCase { | |||
XCTAssertEqual(subject.message, Localizations.pinRequireBioOrMasterPasswordRestart(Localizations.touchID)) | |||
} | |||
|
|||
/// `unlockWithPINCodeAlert(action)` constructs an `Alert` with the correct title, message, Yes and No buttons | |||
/// when `biometricType` is `opticID`. | |||
func test_unlockWithPINAlert_opticID() { |
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.
🎨 We prefer tests to be in alphabetical order
@@ -251,6 +251,10 @@ extension Alert { | |||
Localizations.pinRequireBioOrMasterPasswordRestart(Localizations.faceID) | |||
case .touchID: | |||
Localizations.pinRequireBioOrMasterPasswordRestart(Localizations.touchID) | |||
case .opticID: |
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.
🎨 We prefer cases in a switch
statement be alphabetized
@@ -43,6 +43,10 @@ struct VaultUnlockSetupState: Equatable { | |||
"FaceID" | |||
case .touchID: | |||
"TouchID" | |||
case .opticID: |
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.
🎨 We prefer cases in a switch
be alphabetized
@@ -270,6 +270,10 @@ struct AccountSecurityView: View { | |||
return Localizations.unlockWith(Localizations.faceID) | |||
case .touchID: | |||
return Localizations.unlockWith(Localizations.touchID) | |||
case .opticID: |
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.
🎨 We prefer cases in a switch
statement to be alphabetized
case .opticID: | ||
return Localizations.unlockWith(Localizations.opticID) | ||
case .biometrics: | ||
return Localizations.unlockWith(Localizations.biometrics) |
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.
🎨 This is another case where the capitalization gets us
# Conflicts: # BitwardenShared/UI/Platform/Application/Support/Localizations/en.lproj/Localizable.strings
🎟️ Tracking
📔 Objective
Support Optic ID and any future biometric authentication types.
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes