Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void PostConfigure(string? name, DashboardOptions options)
{
options.ResourceServiceClient.Url = resourceServiceUrl;
}
if (_configuration.GetBool(DashboardConfigNames.DashboardInsecureAllowAnonymousName.ConfigKey) ?? false)
if (_configuration.GetBool(DashboardConfigNames.DashboardUnsecuredAllowAnonymousName.ConfigKey) ?? false)
{
options.Frontend.AuthMode = FrontendAuthMode.Unsecured;
options.Otlp.AuthMode = OtlpAuthMode.Unsecured;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Aspire.Hosting;
using Microsoft.Extensions.Options;

namespace Aspire.Dashboard.Configuration;
Expand Down Expand Up @@ -39,7 +40,7 @@ public ValidateOptionsResult Validate(string? name, DashboardOptions options)
case OtlpAuthMode.ClientCertificate:
break;
case null:
errorMessages.Add($"OTLP endpoint authentication is not configured. Either specify DOTNET_DASHBOARD_INSECURE_ALLOW_ANONYMOUS with a value of true, or specify Dashboard:Otlp:AuthMode. Possible values: {string.Join(", ", typeof(OtlpAuthMode).GetEnumNames())}");
errorMessages.Add($"OTLP endpoint authentication is not configured. Either specify {DashboardConfigNames.DashboardUnsecuredAllowAnonymousName.ConfigKey} with a value of true, or specify {DashboardConfigNames.DashboardOtlpAuthModeName.ConfigKey}. Possible values: {string.Join(", ", typeof(OtlpAuthMode).GetEnumNames())}");
break;
default:
errorMessages.Add($"Unexpected OTLP authentication mode: {options.Otlp.AuthMode}");
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/DashboardConfigNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal static class DashboardConfigNames
{
public static readonly ConfigName DashboardFrontendUrlName = new("ASPNETCORE_URLS");
public static readonly ConfigName DashboardOtlpUrlName = new("DOTNET_DASHBOARD_OTLP_ENDPOINT_URL");
public static readonly ConfigName DashboardInsecureAllowAnonymousName = new("DOTNET_DASHBOARD_INSECURE_ALLOW_ANONYMOUS");
public static readonly ConfigName DashboardUnsecuredAllowAnonymousName = new("DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS");
public static readonly ConfigName DashboardConfigFilePathName = new("DOTNET_DASHBOARD_CONFIG_FILE_PATH");
public static readonly ConfigName ResourceServiceUrlName = new("DOTNET_RESOURCE_SERVICE_ENDPOINT_URL");

Expand Down
2 changes: 1 addition & 1 deletion tests/Aspire.Dashboard.Tests/Integration/StartupTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public async Task Configuration_AllowAnonymous_NoError()
additionalConfiguration: data =>
{
data.Remove(DashboardConfigNames.DashboardOtlpAuthModeName.ConfigKey);
data[DashboardConfigNames.DashboardInsecureAllowAnonymousName.ConfigKey] = bool.TrueString;
data[DashboardConfigNames.DashboardUnsecuredAllowAnonymousName.ConfigKey] = bool.TrueString;
});

// Act
Expand Down