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