2 writes to ResourceServiceClient
Aspire.Dashboard.Tests (2)
Integration\DashboardClientAuthTests.cs (1)
119
ResourceServiceClient
=
Model\DashboardClientTests.cs (1)
807
ResourceServiceClient
=
52 references to ResourceServiceClient
Aspire.Dashboard (23)
Configuration\PostConfigureDashboardOptions.cs (1)
75
options.
ResourceServiceClient
.Url = resourceServiceUrl;
Configuration\ValidateDashboardOptions.cs (9)
128
if (!options.
ResourceServiceClient
.TryParseOptions(out var resourceServiceClientParseErrorMessage))
135
if (options.
ResourceServiceClient
.GetUri() != null)
137
switch (options.
ResourceServiceClient
.AuthMode)
142
if (string.IsNullOrWhiteSpace(options.
ResourceServiceClient
.ApiKey))
148
switch (options.
ResourceServiceClient
.ClientCertificate.Source)
151
if (string.IsNullOrEmpty(options.
ResourceServiceClient
.ClientCertificate.FilePath))
157
if (string.IsNullOrEmpty(options.
ResourceServiceClient
.ClientCertificate.Subject))
166
errorMessages.Add($"Unexpected resource service client certificate source: {options.
ResourceServiceClient
.ClientCertificate.Source}");
174
errorMessages.Add($"Unexpected resource service client authentication mode: {options.
ResourceServiceClient
.AuthMode}");
ServiceClient\DashboardClient.cs (13)
117
if (dashboardOptions.Value.
ResourceServiceClient
.GetUri() is null)
126
var address = _dashboardOptions.
ResourceServiceClient
.GetUri()!;
133
if (_dashboardOptions.
ResourceServiceClient
.AuthMode is ResourceClientAuthMode.ApiKey)
136
_headers.Add(ApiKeyHeaderName, _dashboardOptions.
ResourceServiceClient
.ApiKey!);
151
var authMode = _dashboardOptions.
ResourceServiceClient
.AuthMode;
156
var certificates = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Source switch
204
_dashboardOptions.
ResourceServiceClient
.ClientCertificate.FilePath != null,
207
var filePath = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.FilePath;
208
var password = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Password;
216
_dashboardOptions.
ResourceServiceClient
.ClientCertificate.Subject != null,
219
var subject = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Subject;
220
var storeName = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Store ?? "My";
221
var location = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Location ?? StoreLocation.CurrentUser;
Aspire.Dashboard.Tests (29)
DashboardOptionsTests.cs (23)
153
options.
ResourceServiceClient
.Url = "invalid";
165
options.
ResourceServiceClient
.Url = "http://localhost";
166
options.
ResourceServiceClient
.AuthMode = ResourceClientAuthMode.ApiKey;
167
options.
ResourceServiceClient
.ApiKey = "";
179
options.
ResourceServiceClient
.Url = "http://localhost";
180
options.
ResourceServiceClient
.AuthMode = ResourceClientAuthMode.Certificate;
181
options.
ResourceServiceClient
.ClientCertificate.Source = DashboardClientCertificateSource.File;
182
options.
ResourceServiceClient
.ClientCertificate.FilePath = "";
194
options.
ResourceServiceClient
.Url = "http://localhost";
195
options.
ResourceServiceClient
.AuthMode = ResourceClientAuthMode.Certificate;
196
options.
ResourceServiceClient
.ClientCertificate.Source = DashboardClientCertificateSource.KeyStore;
197
options.
ResourceServiceClient
.ClientCertificate.Subject = "";
209
options.
ResourceServiceClient
.Url = "http://localhost";
210
options.
ResourceServiceClient
.AuthMode = ResourceClientAuthMode.Certificate;
211
options.
ResourceServiceClient
.ClientCertificate.Source = null;
223
options.
ResourceServiceClient
.Url = "http://localhost";
224
options.
ResourceServiceClient
.AuthMode = ResourceClientAuthMode.Certificate;
225
options.
ResourceServiceClient
.ClientCertificate.Source = (DashboardClientCertificateSource)int.MaxValue;
230
Assert.Equal($"Unexpected resource service client certificate source: {options.
ResourceServiceClient
.ClientCertificate.Source}", result.FailureMessage);
237
options.
ResourceServiceClient
.Url = "http://localhost";
238
options.
ResourceServiceClient
.AuthMode = null;
250
options.
ResourceServiceClient
.Url = "http://localhost";
251
options.
ResourceServiceClient
.AuthMode = (ResourceClientAuthMode)int.MaxValue;
Integration\DashboardClientAuthTests.cs (2)
60
await using var client = await CreateDashboardClientAsync(activitySource, loggerFactory, server.Url, authMode: ResourceClientAuthMode.ApiKey, configureOptions: options => options.
ResourceServiceClient
.ApiKey = "TestApiKey!").DefaultTimeout();
128
options.
ResourceServiceClient
.TryParseOptions(out _);
Integration\StartupTests.cs (3)
599
Assert.Equal(ResourceClientAuthMode.Certificate, app.DashboardOptionsMonitor.CurrentValue.
ResourceServiceClient
.AuthMode);
600
Assert.Equal(DashboardClientCertificateSource.KeyStore, app.DashboardOptionsMonitor.CurrentValue.
ResourceServiceClient
.ClientCertificate.Source);
601
Assert.Equal("MySubject", app.DashboardOptionsMonitor.CurrentValue.
ResourceServiceClient
.ClientCertificate.Subject);
Model\DashboardClientTests.cs (1)
813
options.
ResourceServiceClient
.TryParseOptions(out _);