2 writes to ResourceServiceClient
Aspire.Dashboard.Tests (2)
Integration\DashboardClientAuthTests.cs (1)
119ResourceServiceClient =
Model\DashboardClientTests.cs (1)
30ResourceServiceClient =
51 references to ResourceServiceClient
Aspire.Dashboard (22)
Configuration\PostConfigureDashboardOptions.cs (1)
45options.ResourceServiceClient.Url = resourceServiceUrl;
Configuration\ValidateDashboardOptions.cs (9)
96if (!options.ResourceServiceClient.TryParseOptions(out var resourceServiceClientParseErrorMessage)) 103if (options.ResourceServiceClient.GetUri() != null) 105switch (options.ResourceServiceClient.AuthMode) 110if (string.IsNullOrWhiteSpace(options.ResourceServiceClient.ApiKey)) 116switch (options.ResourceServiceClient.ClientCertificate.Source) 119if (string.IsNullOrEmpty(options.ResourceServiceClient.ClientCertificate.FilePath)) 125if (string.IsNullOrEmpty(options.ResourceServiceClient.ClientCertificate.Subject)) 134errorMessages.Add($"Unexpected resource service client certificate source: {options.ResourceServiceClient.ClientCertificate.Source}"); 142errorMessages.Add($"Unexpected resource service client authentication mode: {options.ResourceServiceClient.AuthMode}");
ResourceService\DashboardClient.cs (12)
100var address = _dashboardOptions.ResourceServiceClient.GetUri()!; 107if (_dashboardOptions.ResourceServiceClient.AuthMode is ResourceClientAuthMode.ApiKey) 110_headers.Add(ApiKeyHeaderName, _dashboardOptions.ResourceServiceClient.ApiKey!); 125var authMode = _dashboardOptions.ResourceServiceClient.AuthMode; 130var certificates = _dashboardOptions.ResourceServiceClient.ClientCertificate.Source switch 177_dashboardOptions.ResourceServiceClient.ClientCertificate.FilePath != null, 180var filePath = _dashboardOptions.ResourceServiceClient.ClientCertificate.FilePath; 181var password = _dashboardOptions.ResourceServiceClient.ClientCertificate.Password; 189_dashboardOptions.ResourceServiceClient.ClientCertificate.Subject != null, 192var subject = _dashboardOptions.ResourceServiceClient.ClientCertificate.Subject; 193var storeName = _dashboardOptions.ResourceServiceClient.ClientCertificate.Store ?? "My"; 194var location = _dashboardOptions.ResourceServiceClient.ClientCertificate.Location ?? StoreLocation.CurrentUser;
Aspire.Dashboard.Tests (29)
DashboardOptionsTests.cs (23)
99options.ResourceServiceClient.Url = "invalid"; 111options.ResourceServiceClient.Url = "http://localhost"; 112options.ResourceServiceClient.AuthMode = ResourceClientAuthMode.ApiKey; 113options.ResourceServiceClient.ApiKey = ""; 125options.ResourceServiceClient.Url = "http://localhost"; 126options.ResourceServiceClient.AuthMode = ResourceClientAuthMode.Certificate; 127options.ResourceServiceClient.ClientCertificate.Source = DashboardClientCertificateSource.File; 128options.ResourceServiceClient.ClientCertificate.FilePath = ""; 140options.ResourceServiceClient.Url = "http://localhost"; 141options.ResourceServiceClient.AuthMode = ResourceClientAuthMode.Certificate; 142options.ResourceServiceClient.ClientCertificate.Source = DashboardClientCertificateSource.KeyStore; 143options.ResourceServiceClient.ClientCertificate.Subject = ""; 155options.ResourceServiceClient.Url = "http://localhost"; 156options.ResourceServiceClient.AuthMode = ResourceClientAuthMode.Certificate; 157options.ResourceServiceClient.ClientCertificate.Source = null; 169options.ResourceServiceClient.Url = "http://localhost"; 170options.ResourceServiceClient.AuthMode = ResourceClientAuthMode.Certificate; 171options.ResourceServiceClient.ClientCertificate.Source = (DashboardClientCertificateSource)int.MaxValue; 176Assert.Equal($"Unexpected resource service client certificate source: {options.ResourceServiceClient.ClientCertificate.Source}", result.FailureMessage); 183options.ResourceServiceClient.Url = "http://localhost"; 184options.ResourceServiceClient.AuthMode = null; 196options.ResourceServiceClient.Url = "http://localhost"; 197options.ResourceServiceClient.AuthMode = (ResourceClientAuthMode)int.MaxValue;
Integration\DashboardClientAuthTests.cs (2)
61await using var client = await CreateDashboardClientAsync(loggerFactory, server.Url, authMode: ResourceClientAuthMode.ApiKey, configureOptions: options => options.ResourceServiceClient.ApiKey = "TestApiKey!").DefaultTimeout(); 128options.ResourceServiceClient.TryParseOptions(out _);
Integration\StartupTests.cs (3)
475Assert.Equal(ResourceClientAuthMode.Certificate, app.DashboardOptionsMonitor.CurrentValue.ResourceServiceClient.AuthMode); 476Assert.Equal(DashboardClientCertificateSource.KeyStore, app.DashboardOptionsMonitor.CurrentValue.ResourceServiceClient.ClientCertificate.Source); 477Assert.Equal("MySubject", app.DashboardOptionsMonitor.CurrentValue.ResourceServiceClient.ClientCertificate.Subject);
Model\DashboardClientTests.cs (1)
36options.ResourceServiceClient.TryParseOptions(out _);