Skip to content
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

Credential provider extension with credential list support #3658

Merged

Conversation

amddg44
Copy link
Contributor

@amddg44 amddg44 commented Dec 2, 2024

Task/Issue URL:
Tech Design URL:
CC:

Description:
Adds the Credential provider extension to the app, with functionality to view all + select from saved passwords for autofilling in 3rd party apps.

Steps to test this PR:
Note: Use the Alpha target for testing, as the extension has not been enabled on the main app target yet.

  1. From main branch, run up the app and save a few credentials e.g. for https://autofill.me/ (fill.dev is down!)
  2. Run up the app from this branch and confirm the credentials are still accessible from the Passwords screen on the main app thus confirming the vault migration was successful
  3. From system Settings, confirm that DuckDuckGo Alpha is available as a credential provider + enable
  4. From the activation screen, tap the ‘Open DuckDuckGo’ button and confirm you are taken to the Passwords screen of the app
  5. In Safari go to a site that you have saved credentials for and from the keyboard prompt select ‘DuckDuckGo’ to view your saved passwords
  6. Confirm authentication is needed to access the saved passwords, and that all the same passwords are present (including the suggested section) as in the main app
  7. Test search performs as expected
  8. Select a credential and confirm it is autofilled into Safari

<!—
Before submitting a PR, please ensure you have tested the combinations you expect the reviewer to test, then delete configurations you know do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
—>

Definition of Done (Internal Only):

Copy Testing:

  • Use of correct apostrophes in new copy, ie rather than

Orientation Testing:

  • Portrait
  • Landscape

Device Testing:

  • iPhone SE (1st Gen)
  • iPhone 8
  • iPhone X
  • iPhone 14 Pro
  • iPad

OS Testing:

  • iOS 15
  • iOS 16
  • iOS 17

Theme Testing:

  • Light theme
  • Dark theme

Internal references:

Software Engineering Expectations
Technical Design Template

…er' into anya/credential-provider-extension

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
…er' into anya/credential-provider-extension

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
…ersion and adding vault to the entitlement groups
Copy link

github-actions bot commented Dec 2, 2024

Fails
🚫 Please, don't forget to add a link to the internal task
Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 6d05447

…er' into anya/credential-provider-extension

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@amddg44 amddg44 marked this pull request as ready for review December 4, 2024 13:12
Copy link
Contributor

@aataraxiaa aataraxiaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great, @amddg44, left a few minor comments. Also tested and works as expected.

guard let cacheUrl = FaviconsCacheType.fireproof.cacheLocation() else { return nil }

// Slight leap here to avoid loading Kingisher as a library for the widgets.
// Once dependency management is fixed, link it and use Favicons directly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Comment on lines 124 to 127
guard let domain = domain else { return nil }

let key = FaviconHasher.createHash(ofDomain: domain)
guard let cacheUrl = FaviconsCacheType.fireproof.cacheLocation() else { return nil }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Maybe could slightly restructure this as:

guard let domain = domain,
          let cacheUrl = FaviconsCacheType.fireproof.cacheLocation() else {
        return nil
    }

Just putting the two guards at the beginning.

import Core
import SwiftUI

class CredentialProviderListViewController: UIViewController {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Can prob make final

import BrowserServicesKit
import Core

class CredentialProviderViewController: ASCredentialProviderViewController {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Can prob make final

extension UIResponder {

@discardableResult
func openUrl(_ url: URL?) -> Bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a small bit of documentation here explaining this would be helpful

amddg44 added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Dec 7, 2024
Task/Issue URL: 
iOS PR: duckduckgo/iOS#3658
macOS PR: duckduckgo/macos-browser#3628
What kind of version bump will this require?: Minor

**Description**:
Migrates secure vault DB file to shared storage, and migrates the vault
keychain items to shared keychain on iOS for usage by its new credential
provider extension
@amddg44 amddg44 merged commit 611e9dc into feature/system-credential-provider Dec 7, 2024
12 of 13 checks passed
@amddg44 amddg44 deleted the anya/credential-provider-extension branch December 7, 2024 17:38
@amddg44 amddg44 mentioned this pull request Dec 9, 2024
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants