Repository navigation
Expand file tree
/
Copy pathICredentialStore.cs
More file actions
57 lines (51 loc) · 2.62 KB
/
Copy pathICredentialStore.cs
File metadata and controls
57 lines (51 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.Collections.Generic;
namespace GitCredentialManager
{
/// <summary>
/// Represents a secure storage location for <see cref="ICredential"/>s.
/// </summary>
public interface ICredentialStore
{
/// <summary>
/// Get the name of the credential store.
/// </summary>
string Name { get; }
/// <summary>
/// Gets the maximum width of a secret that can be stored by this CredentialStore. When set allows credentials
/// to be stored in chunks of at most the size configured.
///
/// A value of LTE 0 (default of 0) indicates there is no limits set by the CredentialStore
/// </summary>
/// <remarks>
/// The size represented here is the number of characters (<see langword="char"/>) of the string.
/// </remarks>
int MaxCredentialSize => 0;
/// <summary>
/// Get all accounts from the store for the given service.
/// </summary>
/// <param name="service">Name of the service to match against. Use null to match all values.</param>
/// <returns>All accounts that match the query.</returns>
IList<string> GetAccounts(string service);
/// <summary>
/// Get the first credential from the store that matches the given query.
/// </summary>
/// <param name="service">Name of the service to match against. Use null to match all values.</param>
/// <param name="account">Account name to match against. Use null to match all values.</param>
/// <returns>First matching credential or null if none are found.</returns>
ICredential Get(string service, string account);
/// <summary>
/// Add or update credential in the store with the specified key.
/// </summary>
/// <param name="service">Name of the service this credential is for. Use null to match all values.</param>
/// <param name="account">Account associated with this credential. Use null to match all values.</param>
/// <param name="secret">Secret value to store.</param>
void AddOrUpdate(string service, string account, string secret);
/// <summary>
/// Delete credential from the store that matches the given query.
/// </summary>
/// <param name="service">Name of the service to match against. Use null to match all values.</param>
/// <param name="account">Account name to match against. Use null to match all values.</param>
/// <returns>True if the credential was deleted, false otherwise.</returns>
bool Remove(string service, string account);
}
}