28 references to Api
Aspire.Dashboard (23)
Api\ApiAuthenticationHandler.cs (3)
34
var apiAuthMode = currentOptions.
Api
.AuthMode;
46
var apiKeyBytes = currentOptions.
Api
.GetPrimaryApiKeyBytesOrNull();
76
if (currentOptions.
Api
.GetSecondaryApiKeyBytes() is { } secondaryBytes &&
Components\Dialogs\AIAgentsDialog.razor.cs (1)
55
if (options.
Api
.AuthMode is ApiAuthMode.ApiKey &&
Components\Layout\MainLayout.razor.cs (2)
248
return !Options.CurrentValue.
Api
.Disabled.GetValueOrDefault() &&
249
Options.CurrentValue.
Api
.AuthMode == ApiAuthMode.Unsecured;
Configuration\PostConfigureDashboardOptions.cs (8)
87
options.
Api
.AuthMode = ApiAuthMode.Unsecured;
95
options.
Api
.AuthMode ??= ApiAuthMode.ApiKey;
108
if (options.
Api
.AuthMode == ApiAuthMode.ApiKey && string.IsNullOrEmpty(options.
Api
.PrimaryApiKey))
115
options.
Api
.PrimaryApiKey = apiKey;
121
options.
Api
.Disabled ??= apiDisabled;
126
options.
Api
.Enabled ??= apiEnabled;
130
options.
Api
.Disabled ??= false;
Configuration\ValidateDashboardOptions.cs (3)
114
if (!options.
Api
.TryParseOptions(out var apiParseErrorMessage))
120
var effectiveApiAuthMode = options.
Api
.AuthMode;
126
if (string.IsNullOrEmpty(options.
Api
.PrimaryApiKey))
DashboardEndpointsBuilder.cs (3)
98
if (dashboardOptions.
Api
.Disabled.GetValueOrDefault())
129
var apiKey = currentOptions.
Api
.AuthMode == ApiAuthMode.ApiKey
130
? currentOptions.
Api
.PrimaryApiKey
DashboardWebApplication.cs (3)
514
_logger.LogDebug("Dashboard API disabled: {ApiDisabled}", _dashboardOptionsMonitor.CurrentValue.
Api
.Disabled.GetValueOrDefault());
518
if (!_dashboardOptionsMonitor.CurrentValue.
Api
.Disabled.GetValueOrDefault() &&
519
_dashboardOptionsMonitor.CurrentValue.
Api
.AuthMode == ApiAuthMode.Unsecured)
Aspire.Dashboard.Tests (5)
Integration\StartupTests.cs (2)
567
Assert.Equal(ApiAuthMode.ApiKey, app.DashboardOptionsMonitor.CurrentValue.
Api
.AuthMode);
568
Assert.False(string.IsNullOrEmpty(app.DashboardOptionsMonitor.CurrentValue.
Api
.PrimaryApiKey), "A primary API key should be auto-generated.");
Integration\TelemetryApiTests.cs (3)
42
Assert.NotNull(options.
Api
);
43
Assert.Equal(ApiAuthMode.ApiKey, options.
Api
.AuthMode);
44
Assert.False(string.IsNullOrEmpty(options.
Api
.PrimaryApiKey), "A primary API key should be auto-generated.");