-
Notifications
You must be signed in to change notification settings - Fork 26
feat: adds an ios.requireBiometrics config flag #43
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
base: main
Are you sure you want to change the base?
feat: adds an ios.requireBiometrics config flag #43
Conversation
WalkthroughThe changes introduce a configurable option for iOS to relax the biometric authentication requirement when creating or authenticating passkeys. A new Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant JSModule as ReactNativePasskeysModule.ts
participant Native as ReactNativePasskeysModule.swift
participant iOSSystem
App->>JSModule: create(request, { ios: { requireBiometrics: false } })
JSModule->>Native: create(request, requireBiometrics=false)
Native->>Native: isAvailable(requireBiometrics=false)
Native->>iOSSystem: Evaluate deviceOwnerAuthentication
iOSSystem-->>Native: Result
Native-->>JSModule: RegistrationResponseJSON
JSModule-->>App: RegistrationResponseJSON
Assessment against linked issues
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🧰 Additional context used🧬 Code Graph Analysis (3)example/src/app/index.tsx (2)
src/ReactNativePasskeysModule.ts (2)
src/index.ts (2)
🔇 Additional comments (14)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@peterferguson any thoughts on getting this merged in? Would love to use it |
Summary
Adds a new configuration flag to both
createandgetenabling a more lenient policy (deviceOwnerAuthentication) if the strong version (deviceOwnerAuthenticationWithBiometrics) is not desired.Closes #36
Implementation details
Defined a new configuration object (type
PasskeysConfig) shared between the two calls (create/get) but extended by their own interfaces (PasskeysCreateOptions,PasskeysGetOptions) for if/when we want to add new properties specific to each. This config object is documented (via JSDoc) and the flag is specified underiosto make it clear it is platform-specific.Because the option is relevant only to the iOS variant of the native module,
Platform.OSis used in thesrc/ReactNativePasskeysModule.tsto differentiate which arguments need to be passed in. This is inspired by the pattern used by Expo, for example in theirWebBrowsermodule,openAuthSessionAsyncmethod.Finally, in the iOS module itself, the core of the implementation change lives in the
isAvailablemethod, now responsible forcanEvaluatePolicydepending on therequireBiometricsoption, and conditionally checkingbiometricTypelike before.Testing
Tested in an iOS device with Face ID disabled, with the new option added to the test app:
Also tested in an Android device to validate other platforms were not affected.
Summary by CodeRabbit
New Features
Chores