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