Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/shared/Core/Interop/Linux/SecretServiceCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SecretServiceCollection(string @namespace)

public IList<string> GetAccounts(string service)
{
return Enumerate(service, null).Select(x => x.Account).ToList();
return Enumerate(service, null).Select(x => x.Account).Distinct().ToList();
}

public ICredential Get(string service, string account)
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Core/Interop/MacOS/MacOSKeychain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public IList<string> GetAccounts(string service)
if (typeId == CFArrayGetTypeID())
{
int len = (int)CFArrayGetCount(resultPtr);
var accounts = new List<string>(len);
var accounts = new HashSet<string>(len);
for (int i = 0; i < len; i++)
{
IntPtr dict = CFArrayGetValueAtIndex(resultPtr, i);
string account = GetStringAttribute(dict, kSecAttrAccount);
accounts.Add(account);
}

return accounts;
return accounts.ToList();
}

throw new InteropException($"Unknown keychain search result type CFTypeID: {typeId}.", -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public WindowsCredentialManager(string @namespace = null)

public IList<string> GetAccounts(string service)
{
return Enumerate(service, null).Select(x => x.UserName).ToList();
return Enumerate(service, null).Select(x => x.UserName).Distinct().ToList();
}

public ICredential Get(string service, string account)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/Core/PlaintextCredentialStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public PlaintextCredentialStore(IFileSystem fileSystem, string storeRoot, string

public IList<string> GetAccounts(string service)
{
return Enumerate(service, null).Select(x => x.Account).ToList();
return Enumerate(service, null).Select(x => x.Account).Distinct().ToList();
}

public ICredential Get(string service, string account)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public TestCredentialStore()

public IList<string> GetAccounts(string service)
{
return Query(service, null).Select(x => x.Account).ToList();
return Query(service, null).Select(x => x.Account).Distinct().ToList();
}

ICredential ICredentialStore.Get(string service, string account)
Expand Down