namespace ZB.MOM.WW.MxGateway.Server.Configuration; public sealed class DashboardOptions { /// Gets whether the dashboard is enabled. public bool Enabled { get; init; } = true; /// Gets whether anonymous localhost access to dashboard is allowed. public bool AllowAnonymousLocalhost { get; init; } = true; /// /// DEV/TEST ONLY. When true, the dashboard bypasses the login form entirely and /// auto-authenticates EVERY request as holding both /// dashboard roles (Administrator + Viewer). No cookie, no LDAP bind. Default false. /// Unlike (which only succeeds the authorization /// requirement without authenticating), this mints a real principal, so the UI behaves /// as a signed-in admin and applies to all clients (not just loopback). Never enable in /// production. See docs/plans/2026-06-16-dashboard-disable-login-design.md. /// public bool DisableLogin { get; init; } /// /// Username minted for the auto-login principal when is true. /// Null/blank falls back to the GLAuth Administrator test user multi-role. /// public string? AutoLoginUser { get; init; } /// /// When true (default), the dashboard auth cookie is restricted to HTTPS /// requests via . /// Set to false for plain-HTTP dev deployments — the cookie then uses /// , /// which still marks it Secure on any HTTPS request but allows it to /// round-trip over HTTP. Browsers silently drop Secure cookies set over /// plain HTTP from non-localhost hosts, so leaving this true breaks /// dashboard login from a remote browser unless the dashboard is served /// over HTTPS. /// public bool RequireHttpsCookie { get; init; } = true; /// /// Dashboard auth cookie name. When null/blank (the default) the canonical /// /// is used. Override it (MxGateway:Dashboard:CookieName) to give a distinct name to a /// gateway that shares a hostname with another gateway instance — browser cookies are scoped /// by host+path but NOT by port, so two instances on the same host would otherwise clobber /// each other's dashboard session under a shared cookie name. Changing this signs out /// existing dashboard sessions on next deploy. /// public string? CookieName { get; init; } /// Gets the dashboard snapshot update interval in milliseconds. public int SnapshotIntervalMilliseconds { get; init; } = 1_000; /// Gets the maximum number of recent faults to display. public int RecentFaultLimit { get; init; } = 100; /// Gets the maximum number of recent sessions to display. public int RecentSessionLimit { get; init; } = 200; /// Gets whether to show full tag values in the dashboard. public bool ShowTagValues { get; init; } /// /// LDAP group → dashboard role mapping. Values must be one of /// or . /// Users with no matching group are rejected at login. /// public Dictionary GroupToRole { get; init; } = new(StringComparer.OrdinalIgnoreCase); }