mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 11:40:42 +00:00
Rename to Octokit to be consistent with other API libs
GitHub is naming all of the libraries Octokit for their respective platforms
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Octokit.Http
|
||||
{
|
||||
public class Credentials
|
||||
{
|
||||
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes"
|
||||
, Justification = "Credentials is immutable")]
|
||||
public readonly static Credentials Anonymous = new Credentials();
|
||||
|
||||
private Credentials()
|
||||
{
|
||||
AuthenticationType = AuthenticationType.Anonymous;
|
||||
}
|
||||
|
||||
public Credentials(string token)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(token, "token");
|
||||
|
||||
Login = null;
|
||||
Password = token;
|
||||
AuthenticationType = AuthenticationType.Oauth;
|
||||
}
|
||||
|
||||
public Credentials(string login, string password)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, "login");
|
||||
Ensure.ArgumentNotNullOrEmptyString(password, "password");
|
||||
|
||||
Login = login;
|
||||
Password = password;
|
||||
AuthenticationType = AuthenticationType.Basic;
|
||||
}
|
||||
|
||||
public string Login
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public AuthenticationType AuthenticationType
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user