public AzureDevOpsService(AzureDevOpsConfig config, HttpClient httpClient)
    {
        _config     = config;
        _httpClient = httpClient;

        var byteArray = Encoding.ASCII.GetBytes(_config.UserEmail + ":" + _config.Token);

        _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
    }
示例#2
0
        public NotificationProcessService(NotificationProcessChannel processingChannel, IOptions <AzureDevOpsConfig> azureOptions, IOptions <KestrelConfig> kestrelOptions, IOptions <JWTConfig> JWTOptions)
        {
            this.processingChannel = processingChannel;
            this.kestrelConfig     = kestrelOptions.Value;
            this.azureDevopsConfig = azureOptions.Value;
            this.JWTOptions        = JWTOptions.Value;

            var credentials = new VssBasicCredential("", azureDevopsConfig.PatToken);

            connection         = new VssConnection(new Uri(azureDevopsConfig.CollectionUri), credentials);
            subscriptionClient = connection.GetClient <ServiceHooksPublisherHttpClient>();
        }
        public async Task UpdateDependencies()
        {
            var config = new AzureDevOpsConfig
            {
                BaseUrl    = "https://dev.azure.com/if-it",
                Token      = "vzj4iyh7e64lcif6jtlv5gwz3ka5hwhcwy5pqjcij3j7rdcbxbba",
                Project    = "claims-private",
                Repository = "riga-claims-dashboard"
            };

            var updater = new DependencyUpdater(config);

            await updater.UpdateDependencies(new UpdateCheckingConfig
            {
                IncludePrereleaseVersions = true,
                UpdateMajorVersions       = true
            });
        }
 public AzureDevOpsService(ProjectConfigAzureDevOps config, HttpClient httpClient)
     : this(AzureDevOpsConfig.FromConfig(config), httpClient)
 {
 }