fix(gateway): harden browser websocket auth chain
This commit is contained in:
@@ -316,6 +316,11 @@ export async function startGatewayServer(
|
||||
const authRateLimiter: AuthRateLimiter | undefined = rateLimitConfig
|
||||
? createAuthRateLimiter(rateLimitConfig)
|
||||
: undefined;
|
||||
// Always keep a browser-origin fallback limiter for WS auth attempts.
|
||||
const browserAuthRateLimiter: AuthRateLimiter = createAuthRateLimiter({
|
||||
...rateLimitConfig,
|
||||
exemptLoopback: false,
|
||||
});
|
||||
|
||||
let controlUiRootState: ControlUiRootState | undefined;
|
||||
if (controlUiRootOverride) {
|
||||
@@ -574,6 +579,7 @@ export async function startGatewayServer(
|
||||
canvasHostServerPort,
|
||||
resolvedAuth,
|
||||
rateLimiter: authRateLimiter,
|
||||
browserRateLimiter: browserAuthRateLimiter,
|
||||
gatewayMethods,
|
||||
events: GATEWAY_EVENTS,
|
||||
logGateway: log,
|
||||
@@ -777,6 +783,7 @@ export async function startGatewayServer(
|
||||
}
|
||||
skillsChangeUnsub();
|
||||
authRateLimiter?.dispose();
|
||||
browserAuthRateLimiter.dispose();
|
||||
channelHealthMonitor?.stop();
|
||||
await close(opts);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user