// ReSharper restore ParameterHidesMember public void Initialize(string username, string password, string prefix) { if (authClient == null) { authClient = new AuthorizationService(username, password); this.prefix = prefix; DeletePrefixedAuthorizations(); } }
public Authorization GetAuthorization(string username, string password) { if (authorization == null) { authService = new AuthorizationService(username, password); authorization = authService.CreateAuthorization("testGHTestSuite", scopes: new[] {"user", "repo"}); } return authorization; }
private static Authorization GetAuthorization(AuthorizationService authService) { Authorization auth = authService.GetAuthorizations().FirstOrDefault(a => a.Note == GithubAuthNote); if (auth == null) { auth = CreateSprintStatAuthorization(authService); } return auth; }
public static Authorization GetAuthorization(ICredentialProvider credentialProvider) { Credentials.Credentials credentials = credentialProvider.GetCredentials(); var authService = new AuthorizationService(credentials.Username, credentials.Password) { UserAgent = Program.UserAgent, AgentVersion = Program.AgentVersion }; return GetAuthorization(authService); }
private static Authorization CreateSprintStatAuthorization(AuthorizationService authService) { Authorization auth = authService.CreateAuthorization(note: GithubAuthNote, scopes: new[] {"repo", "public_repo", "repo:status"}); return auth; }