namespace ZB.MOM.WW.MxGateway.Server.Dashboard; public static class DashboardAuthenticationDefaults { /// Cookie scheme used to authenticate interactive dashboard requests. public const string AuthenticationScheme = "MxGateway.Dashboard"; /// /// Bearer scheme used to authenticate SignalR hub connections. Hubs cannot /// reuse the browser's HttpOnly cookie when the client SignalR JS resolves /// the cookie scope to loopback, so the dashboard mints a short-lived /// data-protected bearer token on demand. /// public const string HubAuthenticationScheme = "MxGateway.Dashboard.HubToken"; /// /// Policy guarding read-only dashboard pages. Allowed roles: /// or . /// public const string ViewerPolicy = "MxGateway.Dashboard.Viewer"; /// /// Policy guarding write-capable dashboard pages and admin endpoints /// (API-key CRUD, settings edits, hub publishes). Allowed role: /// . /// public const string AdminPolicy = "MxGateway.Dashboard.Admin"; /// /// Policy attached to SignalR hubs — accepts either the cookie scheme /// (in-page connect) or the hub-token bearer scheme (cross-origin or /// WebSocket connect where the cookie can't be forwarded). /// public const string HubClientsPolicy = "MxGateway.Dashboard.HubClients"; public const string LdapGroupClaimType = "mxgateway:ldap_group"; public const string KeyPrefixClaimType = "mxgateway:key_prefix"; /// /// Claim carrying one dashboard event-visibility tag the caller is granted (SEC-25). Stamped /// at cookie login by and at hub-token mint by /// , both resolving the caller's LDAP groups through /// MxGateway:Dashboard:GroupToTag; read by . A /// principal carrying none of these claims is an empty-grant Viewer, which is the fail-closed /// default. Visibility only — it never grants data access. /// public const string DashboardTagClaimType = "zb:dashboardtag"; /// /// Dashboard auth cookie name used when the cookie is not guaranteed to be Secure /// (RequireHttpsCookie=false → ) /// or when an explicit MxGateway:Dashboard:CookieName override is absent but the /// secure default cannot be applied. This plain name carries no browser-enforced guarantees. /// public const string CookieName = "MxGatewayDashboard"; /// /// Dashboard auth cookie name applied when the cookie is guaranteed Secure /// (RequireHttpsCookie=true → ) /// and no explicit MxGateway:Dashboard:CookieName override is set. The __Host- /// prefix instructs browsers to enforce Secure, no Domain, and Path=/; those /// guarantees only hold for a Secure cookie, so this name must never be applied unless /// is in /// effect — a __Host- cookie without Secure is silently dropped by browsers. /// public const string SecureCookieName = "__Host-MxGatewayDashboard"; }