Example #1
0
        public GitHubHostProvider(ICommandContext context, IGitHubRestApi gitHubApi, IGitHubAuthentication gitHubAuth)
            : base(context)
        {
            EnsureArgument.NotNull(gitHubApi, nameof(gitHubApi));
            EnsureArgument.NotNull(gitHubAuth, nameof(gitHubAuth));

            _gitHubApi  = gitHubApi;
            _gitHubAuth = gitHubAuth;
        }
Example #2
0
 public static Task <AuthenticationResult> CreatePersonalTokenAsync(
     this IGitHubRestApi api,
     Uri targetUri,
     ICredential credentials,
     string authenticationCode,
     IEnumerable <string> scopes)
 {
     return(api.CreatePersonalAccessTokenAsync(
                targetUri,
                credentials?.Account,
                credentials?.Password,
                authenticationCode,
                scopes));
 }
 public static Task <AuthenticationResult> AcquireTokenAsync(
     this IGitHubRestApi api,
     Uri targetUri,
     ICredential credentials,
     string authenticationCode,
     IEnumerable <string> scopes)
 {
     return(api.AcquireTokenAsync(
                targetUri,
                credentials?.UserName,
                credentials?.Password,
                authenticationCode,
                scopes));
 }
 public GitHubApiDiagnostic(IGitHubRestApi api)
     : base("GitHub API")
 {
     _api = api;
 }