fix(dashboard): make dashboard auth cookie name configurable
The dashboard auth cookie name was hardcoded to the constant DashboardAuthenticationDefaults.CookieName (MxGatewayDashboard). Browser cookies are scoped by host+path but NOT by port, so two gateway instances sharing a hostname would clobber each other's dashboard session under the shared name. Add DashboardOptions.CookieName (MxGateway:Dashboard:CookieName); null/blank keeps the canonical default. Applied in the existing dashboard cookie PostConfigure (runs after the inline AddCookie default, so it wins). Behaviour is unchanged when unset. Adds a Tests case for the override.
This commit is contained in:
@@ -21,6 +21,17 @@ public sealed class DashboardOptions
|
||||
/// </summary>
|
||||
public bool RequireHttpsCookie { get; init; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Dashboard auth cookie name. When null/blank (the default) the canonical
|
||||
/// <see cref="ZB.MOM.WW.MxGateway.Server.Dashboard.DashboardAuthenticationDefaults.CookieName"/>
|
||||
/// is used. Override it (<c>MxGateway:Dashboard:CookieName</c>) 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.
|
||||
/// </summary>
|
||||
public string? CookieName { get; init; }
|
||||
|
||||
/// <summary>Gets the dashboard snapshot update interval in milliseconds.</summary>
|
||||
public int SnapshotIntervalMilliseconds { get; init; } = 1_000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user