test+docs(dashboard): assert hub policy under disable-login; correct warning/doc wording
This commit is contained in:
@@ -73,7 +73,8 @@ public static class DashboardServiceCollectionExtensions
|
||||
DashboardAuthenticationDefaults.AuthenticationScheme,
|
||||
_ => { });
|
||||
|
||||
// Loud, once-at-startup warning (emitted when GatewayOptions is first resolved).
|
||||
// Loud warning, emitted on first resolution of GatewayOptions (i.e. on the first
|
||||
// request/options access, not guaranteed at process start). Dev-only safety notice.
|
||||
services.AddOptions<GatewayOptions>().PostConfigure<ILoggerFactory>((gatewayOptions, loggerFactory) =>
|
||||
loggerFactory
|
||||
.CreateLogger("ZB.MOM.WW.MxGateway.Server.Dashboard.DisableLogin")
|
||||
|
||||
@@ -53,5 +53,7 @@ public sealed class DashboardDisableLoginTests
|
||||
user, resource: null, DashboardAuthenticationDefaults.AdminPolicy)).Succeeded);
|
||||
Assert.True((await authorization.AuthorizeAsync(
|
||||
user, resource: null, DashboardAuthenticationDefaults.ViewerPolicy)).Succeeded);
|
||||
Assert.True((await authorization.AuthorizeAsync(
|
||||
user, resource: null, DashboardAuthenticationDefaults.HubClientsPolicy)).Succeeded);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user