PM-8353 MacOS passkey provider
đī¸ Tracking
https://bitwarden.atlassian.net/browse/PM-8353
đ Objective
This PR serves as the long running feature branch for passkey provider support.
đ¸ Screenshots
â° Reminders before review
- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team
đĻŽ 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
Codecov Report
:x: Patch coverage is 34.21053% with 300 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 41.70%. Comparing base (4a4ce83) to head (3bebe0a).
:warning: Report is 3 commits behind head on main.
:white_check_mark: All tests successful. No failed tests found.
Additional details and impacted files
@@ Coverage Diff @@
## main #13963 +/- ##
==========================================
+ Coverage 41.66% 41.70% +0.03%
==========================================
Files 3556 3559 +3
Lines 102355 102685 +330
Branches 15355 15399 +44
==========================================
+ Hits 42646 42824 +178
- Misses 57912 58061 +149
- Partials 1797 1800 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Checkmarx One â Scan Summary & Details â 92b34311-f23f-47f2-99f7-195a0dc304c1
Great job! No new security vulnerabilities introduced in this pull request
â ī¸ Files have been modified in this PR that impact the Autofill experience â ī¸
BIT was run to verify no regressions have been introduced to the core Autofill experience. The tests ran with the same feature flag configuration used by vault.bitwarden.com
â Unfortunately, one or more of these BIT tests failed. đ
Please resolve the failure before merging; reach out to @bitwarden/team-autofill-dev if you'd like help.
You can view the detailed results of the tests here.
â ī¸ Files have been modified in this PR that impact the Autofill experience â ī¸
BIT was run to verify no regressions have been introduced to the core Autofill experience. The tests ran with all feature flags disabled.
â Unfortunately, one or more of these BIT tests failed. đ
Please resolve the failure before merging; reach out to @bitwarden/team-autofill-dev if you'd like help.
You can view the detailed results of the tests here.
@dani-garcia We can detect if we're running the MAS or not right? I'm wondering if we should disable the feature / IPC connection if we're not on MAS since we may get a permission prompt otherwise?
@abergs: @dani-garcia We can detect if we're running the MAS or not right? I'm wondering if we should disable the feature / IPC connection if we're not on MAS since we may get a permission prompt otherwise?
That sounds reasonable yeah, we can check for MAS builds:
- In renderer: you can use
PlatformUtilsService.isMacAppStore() - In main: there is a utils file in
src/mainthat also has aisMacAppStore()
@jholland-livefront Are the blocking reviews from @coroiu and @quexten resolved? If so, would you please re-request their review?
@jholland-livefront There are some tests that fail, I think mainly in the fido2 create component. Could you make sure we're green on tests?
https://github.com/bitwarden/clients/actions/runs/17207515957/job/48811272770?pr=13963#step:8:376
Claude finished @abergs's task ââ View job
Code Review Complete
I've completed a comprehensive review of this large PR adding MacOS passkey provider support. Overall, the implementation is solid with good test coverage for the new components. Below are my findings organized by severity.
Findings Summary
Finding 1: PR description could be more detailed (đ)
The PR description provides good context with links to documentation, but could benefit from:
- A brief description of the technical approach (IPC architecture, Rust/Swift integration)
- Summary of key files changed
- Known limitations or future work items
This would help future reviewers understand the implementation faster.
Finding 2: Type safety issue with any type in session (â ī¸)
In apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts:58, currentSession is typed as any. This should be DesktopFido2UserInterfaceSession | undefined for type safety. The any type bypasses TypeScript's type checking.
Finding 3: Missing null safety check in Swift (â ī¸)
In apps/desktop/macos/autofill-extension/CredentialProviderViewController.swift:96 and line 120, force-unwrapping newClient! could crash if the connection fails after all retries. See inline comment for suggested guard statement pattern.
Finding 4: Inconsistent initialization pattern (đ)
In apps/desktop/src/autofill/modal/credentials/fido2-create.component.ts:56 and fido2-vault.component.ts:62, the optional type ? combined with explicit = null is redundant. See inline comment for consistent alternatives.
Finding 5: Magic number without full context (đ¨)
In apps/desktop/src/autofill/services/desktop-autofill.service.ts:451, the 100-pixel offset has a comment but could explain why 100 specifically. Also contains a typo: xPostionOffset â xPositionOffset. See inline comment.
Finding 6: Error handling loses context (đ¨)
In apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts:310-312, catching and rethrowing a generic error loses the original error context. Consider logging and preserving the original error message.
Finding 7: Potential race condition in connection monitoring (đ)
In apps/desktop/macos/autofill-extension/CredentialProviderViewController.swift:108-134, the checkConnectionStatus() method accesses self.client which could be modified by the async getClient() method. Consider using proper synchronization.
Finding 8: Missing test coverage for service methods (â ī¸)
Based on the Codecov report showing 34.21% patch coverage, several critical service methods lack tests:
desktop-autofill.service.ts(2.24% coverage)desktop-fido2-user-interface.service.ts(0.00% coverage)native-autofill.main.ts(0.00% coverage)
While complex integration code can be difficult to test, consider adding unit tests for error handling paths, message buffering logic, and IPC communication edge cases.
Finding 9: Rust unwrap usage needs addressing (â)
In apps/desktop/desktop_native/macos_provider/src/lib.rs:96, there's a FIXME comment acknowledging unwrap usage that could panic. While some unwraps were converted to expect() with messages (good progress!), the FIXME should be resolved before merging. See inline comment for specific lines.
Finding 10: Subscription cleanup could use newer pattern (đ¨)
In apps/desktop/src/autofill/modal/credentials/fido2-vault.component.ts:146, the subscription uses manual takeUntil(this.destroy$). Consider using takeUntilDestroyed() from Angular 16+ per ADR-0003 shown in CLAUDE.md. See inline comment for example.
Positive Observations
đ Good use of standalone components following Angular best practices
đ Comprehensive test suites for the new modal components
đ Proper use of Tailwind tw-app-region-* classes throughout
đ Clear separation of concerns between Rust IPC layer, TypeScript services, and Angular UI
đ Good error messaging for users with i18n support
đ Thoughtful async connection retry logic in Swift
Recommendations
- Before merging: Address Finding 9 (Rust unwraps) as marked by the FIXME comment
- High priority: Fix Finding 3 (Swift force unwrapping) - could cause production crashes
- Medium priority: Improve test coverage for core service methods (Finding 8)
- Nice to have: Address the code style improvements (Findings 4, 5, 6, 10)
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.2% Duplication on New Code
Seems we need another tick for merging this tomorrow after the RC cut.
Changes in this PR impact the Autofill experience of the browser client
BIT has tested the core experience with these changes and the feature flag configuration used by vault.bitwarden.com.
â Fortunately, these BIT tests have passed! đ
Changes in this PR impact the Autofill experience of the browser client
BIT has tested the core experience with these changes and all feature flags disabled.
â Fortunately, these BIT tests have passed! đ