22 references to Api
Aspire.Dashboard (18)
Api\ApiAuthenticationHandler.cs (3)
37
var apiAuthMode = currentOptions.
Api
.AuthMode;
49
var apiKeyBytes = currentOptions.
Api
.GetPrimaryApiKeyBytesOrNull();
80
if (currentOptions.
Api
.GetSecondaryApiKeyBytes() is { } secondaryBytes &&
Components\Layout\MainLayout.razor.cs (2)
195
return Options.CurrentValue.
Api
.Enabled == true &&
196
Options.CurrentValue.
Api
.AuthMode == ApiAuthMode.Unsecured;
Configuration\PostConfigureDashboardOptions.cs (7)
66
options.
Api
.AuthMode = ApiAuthMode.Unsecured;
75
options.
Api
.AuthMode ??= string.IsNullOrEmpty(options.
Api
.PrimaryApiKey) ? ApiAuthMode.Unsecured : ApiAuthMode.ApiKey;
92
if (string.IsNullOrEmpty(options.Mcp.PrimaryApiKey) && !string.IsNullOrEmpty(options.
Api
.PrimaryApiKey))
95
options.Mcp.PrimaryApiKey = options.
Api
.PrimaryApiKey;
98
if (string.IsNullOrEmpty(options.Mcp.SecondaryApiKey) && !string.IsNullOrEmpty(options.
Api
.SecondaryApiKey))
100
options.Mcp.SecondaryApiKey = options.
Api
.SecondaryApiKey;
Configuration\ValidateDashboardOptions.cs (3)
107
if (!options.
Api
.TryParseOptions(out var apiParseErrorMessage))
113
var effectiveApiAuthMode = options.
Api
.AuthMode;
128
var hasApiKey = !string.IsNullOrEmpty(options.
Api
.PrimaryApiKey) || !string.IsNullOrEmpty(options.Mcp.PrimaryApiKey);
DashboardEndpointsBuilder.cs (1)
112
if (dashboardOptions.
Api
.Enabled == false)
DashboardWebApplication.cs (2)
415
if (_dashboardOptionsMonitor.CurrentValue.
Api
.Enabled == true &&
416
_dashboardOptionsMonitor.CurrentValue.
Api
.AuthMode == ApiAuthMode.Unsecured)
Aspire.Dashboard.Tests (4)
Integration\TelemetryApiTests.cs (4)
41
Assert.NotNull(options.
Api
);
42
Assert.Equal(ApiAuthMode.Unsecured, options.
Api
.AuthMode);
81
Assert.NotNull(options.
Api
.GetPrimaryApiKeyBytesOrNull());
82
Assert.Equal(apiKey.Length, options.
Api
.GetPrimaryApiKeyBytesOrNull()!.Length);