// 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;
 }
Esempio n. 3
0
        private static Authorization GetAuthorization(AuthorizationService authService)
        {
            Authorization auth = authService.GetAuthorizations().FirstOrDefault(a => a.Note == GithubAuthNote);

            if (auth == null)
            {
                auth = CreateSprintStatAuthorization(authService);
            }

            return auth;
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 private static Authorization CreateSprintStatAuthorization(AuthorizationService authService)
 {
     Authorization auth = authService.CreateAuthorization(note: GithubAuthNote,
         scopes: new[] {"repo", "public_repo", "repo:status"});
     return auth;
 }