Skip to content

[PM-29572] feat: Add save-password-credential flow with user interaction#2762

Open
fedemkr wants to merge 6 commits into
mainfrom
PM-29572/save-extension-with-ui
Open

[PM-29572] feat: Add save-password-credential flow with user interaction#2762
fedemkr wants to merge 6 commits into
mainfrom
PM-29572/save-extension-with-ui

Conversation

@fedemkr

@fedemkr fedemkr commented Jun 5, 2026

Copy link
Copy Markdown
Member

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-29572

📔 Objective

Implements the iOS 26.2 prepareInterface(for:ASSavePasswordRequest) override in the AutoFill extension — the with-user-interaction path for saving a new password credential.

When iOS determines the vault is locked (or the no-UI path fails), it escalates to this flow, which presents the full Add/Edit Item form pre-populated with the credential's username, password, URI, and title. On successful save the extension is dismissed via completeSavePasswordRequest(completionHandler:). On error an alert is shown and the user stays on the form.

Note: CredentialProviderMode now uses a single savePasswordCredential(any SavePasswordRequestProxy, userInteraction: Bool) case for both the UI and no-UI paths, mirroring the autofillFido2Credential pattern.

📸 Screenshots

Save.autofill.extension.with.user.interaction.mov

fedemkr added 6 commits June 3, 2026 17:10
Implements iOS 26.2 silent password save via
performWithoutUserInteractionIfPossible(savePasswordRequest:). Adds the
savePasswordWithoutUserInteraction extension mode, a new
savePasswordCredential method on AppProcessor, and a CipherView
convenience initialiser that builds a login cipher from a username,
password, and URI.
…iceIdentifier extension

The same serviceIdentifier.type switch existed in two places.
Extracted to a single normalizedURI property so future changes
to identifier-type handling only need to be made once.
Implements the iOS 26.2 prepareInterface(for:ASSavePasswordRequest) path in
the AutoFill extension, which presents the full Add/Edit Item form pre-populated
with the credential data. On successful save the extension is dismissed via
completeSavePasswordRequest(). On error an alert is shown and the user stays on
the form.
@fedemkr fedemkr added the ai-review Request a Claude code review label Jun 5, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:feature labels Jun 5, 2026
@fedemkr fedemkr marked this pull request as ready for review June 5, 2026 16:12
@fedemkr fedemkr requested review from a team and matt-livefront as code owners June 5, 2026 16:13
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds the iOS 26.2 prepareInterface(for:ASSavePasswordRequest) with-UI path to the AutoFill extension, complementing the no-UI flow from PM-29571. The change unifies the two paths under a single savePasswordCredential(_, userInteraction:) case (mirroring autofillFido2Credential), routes the with-UI flow to the Add/Edit Item form pre-populated from the request, and completes the extension on save via the new completeSavePasswordRequest() delegate hook. The behavioral change in the no-UI catch block to cancel with ASExtensionError(.userInteractionRequired) is the correct mechanism for iOS to escalate to the with-UI path when the no-UI attempt fails.

Code Review Details

No issues found. Notes:

  • The authCompletionRoute for .savePasswordCredential(_, userInteraction: true) correctly guards on iOSApplicationExtension 26.2 and falls back to nil when the proxy isn't an ASSavePasswordRequest; the AppCoordinator then falls back to .vault(.autofillList), which is a safe default.
  • The unified CredentialProviderMode case mirrors the established autofillFido2Credential / autofillOTPCredential pattern and propagates userInteraction through flowWithUserInteraction consistently.
  • Test coverage is appropriate: success path completes the save request without navigation, error path stays on screen with an alert, and the context tests cover the new mode for authCompletionRoute, extensionMode, flowWithUserInteraction, and serviceIdentifiers.
  • completeSavePasswordRequest() defensively guards on iOS 26.2 availability even though the mode itself is only reachable on that OS — consistent with sibling completion methods.

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.14286% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.80%. Comparing base (4938573) to head (9660745).

Files with missing lines Patch % Lines
...llExtension/CredentialProviderViewController.swift 0.00% 11 Missing ⚠️
...ialProviderContext/CredentialProviderContext.swift 47.36% 10 Missing ⚠️
...oviderContext/CredentialProviderContextTests.swift 93.93% 2 Missing ⚠️
...lication/CredentialProviderExtensionDelegate.swift 83.33% 1 Missing ⚠️
Additional details and impacted files
@@                            Coverage Diff                             @@
##           PM-29571/extension-save-password-no-ui    #2762      +/-   ##
==========================================================================
- Coverage                                   87.80%   87.80%   -0.01%     
==========================================================================
  Files                                        1709     1709              
  Lines                                      165862   165956      +94     
==========================================================================
+ Hits                                       145641   145712      +71     
- Misses                                      20221    20244      +23     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from PM-29571/extension-save-password-no-ui to main June 8, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant