2 writes to ResourceServiceClient
Aspire.Dashboard.Tests (2)
Integration\DashboardClientAuthTests.cs (1)
117
ResourceServiceClient
=
Model\DashboardClientTests.cs (1)
28
ResourceServiceClient
=
52 references to ResourceServiceClient
Aspire.Dashboard (23)
Configuration\PostConfigureDashboardOptions.cs (1)
51
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 (13)
85
if (dashboardOptions.Value.
ResourceServiceClient
.GetUri() is null)
94
var address = _dashboardOptions.
ResourceServiceClient
.GetUri()!;
101
if (_dashboardOptions.
ResourceServiceClient
.AuthMode is ResourceClientAuthMode.ApiKey)
104
_headers.Add(ApiKeyHeaderName, _dashboardOptions.
ResourceServiceClient
.ApiKey!);
119
var authMode = _dashboardOptions.
ResourceServiceClient
.AuthMode;
124
var certificates = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Source switch
171
_dashboardOptions.
ResourceServiceClient
.ClientCertificate.FilePath != null,
174
var filePath = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.FilePath;
175
var password = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Password;
183
_dashboardOptions.
ResourceServiceClient
.ClientCertificate.Subject != null,
186
var subject = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Subject;
187
var storeName = _dashboardOptions.
ResourceServiceClient
.ClientCertificate.Store ?? "My";
188
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)
59
await using var client = await CreateDashboardClientAsync(loggerFactory, server.Url, authMode: ResourceClientAuthMode.ApiKey, configureOptions: options => options.
ResourceServiceClient
.ApiKey = "TestApiKey!").DefaultTimeout();
126
options.
ResourceServiceClient
.TryParseOptions(out _);
Integration\StartupTests.cs (3)
511
Assert.Equal(ResourceClientAuthMode.Certificate, app.DashboardOptionsMonitor.CurrentValue.
ResourceServiceClient
.AuthMode);
512
Assert.Equal(DashboardClientCertificateSource.KeyStore, app.DashboardOptionsMonitor.CurrentValue.
ResourceServiceClient
.ClientCertificate.Source);
513
Assert.Equal("MySubject", app.DashboardOptionsMonitor.CurrentValue.
ResourceServiceClient
.ClientCertificate.Subject);
Model\DashboardClientTests.cs (1)
34
options.
ResourceServiceClient
.TryParseOptions(out _);