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)
56
if (options.
Api
.AuthMode is ApiAuthMode.ApiKey &&
Components\Layout\MainLayout.razor.cs (2)
232
return !Options.CurrentValue.
Api
.Disabled.GetValueOrDefault() &&
233
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)
110
if (!options.
Api
.TryParseOptions(out var apiParseErrorMessage))
116
var effectiveApiAuthMode = options.
Api
.AuthMode;
122
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)
445
_logger.LogDebug("Dashboard API disabled: {ApiDisabled}", _dashboardOptionsMonitor.CurrentValue.
Api
.Disabled.GetValueOrDefault());
449
if (!_dashboardOptionsMonitor.CurrentValue.
Api
.Disabled.GetValueOrDefault() &&
450
_dashboardOptionsMonitor.CurrentValue.
Api
.AuthMode == ApiAuthMode.Unsecured)
Aspire.Dashboard.Tests (5)
Integration\StartupTests.cs (2)
562
Assert.Equal(ApiAuthMode.ApiKey, app.DashboardOptionsMonitor.CurrentValue.
Api
.AuthMode);
563
Assert.False(string.IsNullOrEmpty(app.DashboardOptionsMonitor.CurrentValue.
Api
.PrimaryApiKey), "A primary API key should be auto-generated.");
Integration\TelemetryApiTests.cs (3)
43
Assert.NotNull(options.
Api
);
44
Assert.Equal(ApiAuthMode.ApiKey, options.
Api
.AuthMode);
45
Assert.False(string.IsNullOrEmpty(options.
Api
.PrimaryApiKey), "A primary API key should be auto-generated.");