Files
octokit.net/Octokit/Http/Credentials.cs
Haacked 2d81cb37cc Move more types into the Octokit namespace
This makes it so GHfW doesn't have to reference Octokit.Internal
2013-10-08 17:02:51 -07:00

53 lines
1.3 KiB
C#

using System.Diagnostics.CodeAnalysis;
namespace Octokit
{
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;
}
}
}