2 writes to Frontend
Aspire.Dashboard.Tests (2)
DashboardOptionsTests.cs (1)
17Frontend =
Middleware\ValidateTokenMiddlewareTests.cs (1)
80o.Frontend = new FrontendOptions
37 references to Frontend
Aspire.Dashboard (25)
Configuration\PostConfigureDashboardOptions.cs (6)
41options.Frontend.EndpointUrls = frontendUrls; 49options.Frontend.AuthMode = FrontendAuthMode.Unsecured; 54options.Frontend.AuthMode ??= FrontendAuthMode.BrowserToken; 57if (options.Frontend.AuthMode == FrontendAuthMode.BrowserToken && string.IsNullOrEmpty(options.Frontend.BrowserToken)) 64options.Frontend.BrowserToken = token;
Configuration\ValidateDashboardOptions.cs (5)
29if (!options.Frontend.TryParseOptions(out var frontendParseErrorMessage)) 34switch (options.Frontend.AuthMode) 39if (!options.Frontend.OpenIdConnect.TryParseOptions(out var messages)) 45if (string.IsNullOrEmpty(options.Frontend.BrowserToken)) 58if (options.Frontend.MaxConsoleLogCount <= 0)
DashboardEndpointsBuilder.cs (2)
19if (dashboardOptions.Frontend.AuthMode == FrontendAuthMode.BrowserToken) 37else if (dashboardOptions.Frontend.AuthMode == FrontendAuthMode.OpenIdConnect)
DashboardWebApplication.cs (9)
180var browserHttpsPort = dashboardOptions.Frontend.GetEndpointAddresses().FirstOrDefault(IsHttpsOrNull)?.Port; 332if (options.Frontend.AuthMode == FrontendAuthMode.BrowserToken) 338LoggingHelpers.WriteDashboardUrl(_logger, frontendEndpointInfo.GetResolvedAddress(replaceIPAnyWithLocalhost: true), options.Frontend.BrowserToken, isContainer); 472var frontendAddresses = dashboardOptions.Frontend.GetEndpointAddresses(); 698switch (dashboardOptions.Frontend.AuthMode) 774switch (dashboardOptions.Frontend.AuthMode) 780.RequireOpenIdClaims(options: dashboardOptions.Frontend.OpenIdConnect) 798throw new NotSupportedException($"Unexpected {nameof(FrontendAuthMode)} enum member: {dashboardOptions.Frontend.AuthMode}"); 806return dashboardOptions.Frontend.AuthMode switch
Model\ValidateTokenMiddleware.cs (3)
31if (_options.CurrentValue.Frontend.AuthMode != FrontendAuthMode.BrowserToken) 37else if (context.Request.Query.TryGetValue("t", out var value) && _options.CurrentValue.Frontend.AuthMode == FrontendAuthMode.BrowserToken) 83if (string.IsNullOrEmpty(incomingBrowserToken) || dashboardOptions.CurrentValue.Frontend.GetBrowserTokenBytes() is not { } expectedBrowserTokenBytes)
Aspire.Dashboard.Tests (12)
DashboardOptionsTests.cs (8)
45options.Frontend.EndpointUrls = ""; 57options.Frontend.EndpointUrls = "invalid"; 69options.Frontend.EndpointUrls = "http://localhost:5000;invalid"; 83options.Frontend.MaxConsoleLogCount = limit; 256options.Frontend.AuthMode = FrontendAuthMode.OpenIdConnect; 257options.Frontend.OpenIdConnect.NameClaimType = ""; 269options.Frontend.AuthMode = FrontendAuthMode.OpenIdConnect; 270options.Frontend.OpenIdConnect.UsernameClaimType = "";
Integration\StartupTests.cs (3)
437Assert.Equal(FrontendAuthMode.BrowserToken, app.DashboardOptionsMonitor.CurrentValue.Frontend.AuthMode); 438Assert.Equal(16, Convert.FromHexString(app.DashboardOptionsMonitor.CurrentValue.Frontend.BrowserToken!).Length); 457Assert.Equal(FrontendAuthMode.Unsecured, app.DashboardOptionsMonitor.CurrentValue.Frontend.AuthMode);
Middleware\ValidateTokenMiddlewareTests.cs (1)
87Assert.True(o.Frontend.TryParseOptions(out _));