refactor(dashboard): consistent effective-user in disable-login warning; doc the config read

This commit is contained in:
Joseph Doherty
2026-06-16 09:23:13 -04:00
parent 3690e4c2ca
commit a0b21ca225
@@ -22,7 +22,8 @@ public static class DashboardServiceCollectionExtensions
/// <param name="services">Service collection to register services.</param>
/// <param name="configuration">
/// Application configuration, used to bind the shared LDAP provider's options
/// from the <c>MxGateway:Ldap</c> section.
/// from the <c>MxGateway:Ldap</c> section. Also read to select the dashboard
/// authentication scheme via the <c>MxGateway:Dashboard:DisableLogin</c> dev flag.
/// </param>
public static IServiceCollection AddGatewayDashboard(
this IServiceCollection services,
@@ -80,7 +81,9 @@ public static class DashboardServiceCollectionExtensions
"DASHBOARD LOGIN DISABLED (MxGateway:Dashboard:DisableLogin=true) — every request is "
+ "authenticated as '{User}' with full permissions ({Roles}). Dev/test only; never "
+ "enable in production.",
gatewayOptions.Dashboard.AutoLoginUser ?? DashboardAutoLoginAuthenticationHandler.DefaultUser,
string.IsNullOrWhiteSpace(gatewayOptions.Dashboard.AutoLoginUser)
? DashboardAutoLoginAuthenticationHandler.DefaultUser
: gatewayOptions.Dashboard.AutoLoginUser!.Trim(),
$"{DashboardRoles.Admin}, {DashboardRoles.Viewer}"));
}
else