refactor(dashboard): consistent effective-user in disable-login warning; doc the config read
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user