Skip to content

Commit

Permalink
Don't show key icon for empty passwords (#3070)
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme authored Jul 23, 2024
1 parent 6cffaf1 commit 4978e9f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10186,7 +10186,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 174.0.1;
version = 175.0.0;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "63195a30b02e05d1b7176c76ebc55c2cff66c9c8",
"version" : "174.0.1"
"revision" : "b2f5a7159088ff5c4fd2eeaa4dcf5c001fc8f7fb",
"version" : "175.0.0"
}
},
{
Expand Down
18 changes: 18 additions & 0 deletions DuckDuckGoTests/MockSecureVault.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ final class MockSecureVault<T: AutofillDatabaseProvider>: AutofillSecureVault {

var storedAccounts: [SecureVaultModels.WebsiteAccount] = []
var storedCredentials: [Int64: SecureVaultModels.WebsiteCredentials] = [:]
var storedCredentialsForDomain: [String: [SecureVaultModels.WebsiteCredentials]] = [:]
var storedNeverPromptWebsites = [SecureVaultModels.NeverPromptWebsites]()
var storedNotes: [SecureVaultModels.Note] = []
var storedIdentities: [SecureVaultModels.Identity] = []
Expand Down Expand Up @@ -100,6 +101,14 @@ final class MockSecureVault<T: AutofillDatabaseProvider>: AutofillSecureVault {
return storedCredentials[accountId]
}

func websiteCredentialsFor(domain: String) throws -> [BrowserServicesKit.SecureVaultModels.WebsiteCredentials] {
return storedCredentialsForDomain[domain] ?? []
}

func websiteCredentialsWithPartialMatchesFor(eTLDplus1: String) throws -> [BrowserServicesKit.SecureVaultModels.WebsiteCredentials] {
return storedCredentialsForDomain[eTLDplus1] ?? []
}

func storeWebsiteCredentials(_ credentials: SecureVaultModels.WebsiteCredentials) throws -> Int64 {
let accountID = Int64(credentials.account.id!)!
storedCredentials[accountID] = credentials
Expand Down Expand Up @@ -264,6 +273,7 @@ class MockDatabaseProvider: AutofillDatabaseProvider {
var _creditCards = [Int64: SecureVaultModels.CreditCard]()
var _forDomain = [String]()
var _credentialsDict = [Int64: SecureVaultModels.WebsiteCredentials]()
var _credentialsForDomain = [String: [SecureVaultModels.WebsiteCredentials]]()
var _note: SecureVaultModels.Note?
var _neverPromptWebsites = [SecureVaultModels.NeverPromptWebsites]()

Expand Down Expand Up @@ -293,6 +303,14 @@ class MockDatabaseProvider: AutofillDatabaseProvider {
return _credentialsDict[accountId]
}

func websiteCredentialsForDomain(_ domain: String) throws -> [BrowserServicesKit.SecureVaultModels.WebsiteCredentials] {
return _credentialsForDomain[domain] ?? []
}

func websiteCredentialsForTopLevelDomain(_ domain: String) throws -> [BrowserServicesKit.SecureVaultModels.WebsiteCredentials] {
return _credentialsForDomain[domain] ?? []
}

func websiteAccountsForDomain(_ domain: String) throws -> [SecureVaultModels.WebsiteAccount] {
self._forDomain.append(domain)
return _accounts
Expand Down

0 comments on commit 4978e9f

Please sign in to comment.