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