mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-31 02:05:39 +00:00
4e804f61a6
* updated XML docs and added some missing bits. * prefer nameof(x) over literal "x"
32 lines
917 B
C#
32 lines
917 B
C#
using System.Threading.Tasks;
|
|
|
|
namespace Octokit.Internal
|
|
{
|
|
/// <summary>
|
|
/// Abstraction for interacting with credentials
|
|
/// </summary>
|
|
public class InMemoryCredentialStore : ICredentialStore
|
|
{
|
|
readonly Credentials _credentials;
|
|
|
|
/// <summary>
|
|
/// Create an instance of the InMemoryCredentialStore
|
|
/// </summary>
|
|
/// <param name="credentials"></param>
|
|
public InMemoryCredentialStore(Credentials credentials)
|
|
{
|
|
Ensure.ArgumentNotNull(credentials, nameof(credentials));
|
|
|
|
_credentials = credentials;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retrieve the credentials from the underlying store
|
|
/// </summary>
|
|
/// <returns>A continuation containing credentials</returns>
|
|
public Task<Credentials> GetCredentials()
|
|
{
|
|
return Task.FromResult(_credentials);
|
|
}
|
|
}
|
|
} |