From 6dc121eb6a8fd9c3ee75d77cdc521bd73aeaf2bf Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sat, 20 Jun 2026 20:44:17 +0800 Subject: [PATCH] chore(deadcode): move gateway auth helper out of prod path --- config/knip.config.ts | 1 - src/gateway/server.auth.browser-hardening.test.ts | 2 +- src/gateway/server.auth.compat-baseline.test.ts | 2 +- src/gateway/server.auth.control-ui.suite.ts | 2 +- src/gateway/server.auth.control-ui.test.ts | 2 +- src/gateway/server.auth.default-token.suite.ts | 2 +- src/gateway/server.auth.default-token.test.ts | 2 +- src/gateway/server.auth.modes.suite.ts | 2 +- src/gateway/server.auth.modes.test.ts | 2 +- .../{server.auth.shared.ts => server.auth.test-helpers.ts} | 0 10 files changed, 8 insertions(+), 9 deletions(-) rename src/gateway/{server.auth.shared.ts => server.auth.test-helpers.ts} (100%) diff --git a/config/knip.config.ts b/config/knip.config.ts index 1b5430eb192..73fcd89c018 100644 --- a/config/knip.config.ts +++ b/config/knip.config.ts @@ -129,7 +129,6 @@ const config = { "test/helpers/live-image-probe.ts", "src/secrets/credential-matrix.ts", "src/gateway/live-tool-probe-utils.ts", - "src/gateway/server.auth.shared.ts", "src/shared/text/assistant-visible-text.ts", bundledPluginFile("telegram", "src/bot/reply-threading.ts"), bundledPluginFile("telegram", "src/draft-chunking.ts"), diff --git a/src/gateway/server.auth.browser-hardening.test.ts b/src/gateway/server.auth.browser-hardening.test.ts index e26d773554d..c8bf31dcc6e 100644 --- a/src/gateway/server.auth.browser-hardening.test.ts +++ b/src/gateway/server.auth.browser-hardening.test.ts @@ -13,7 +13,7 @@ import { } from "../infra/device-identity.js"; import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js"; import { buildDeviceAuthPayload } from "./device-auth.js"; -import { CONTROL_UI_CLIENT, TEST_OPERATOR_CLIENT } from "./server.auth.shared.js"; +import { CONTROL_UI_CLIENT, TEST_OPERATOR_CLIENT } from "./server.auth.test-helpers.js"; import { connectReq, connectOk, diff --git a/src/gateway/server.auth.compat-baseline.test.ts b/src/gateway/server.auth.compat-baseline.test.ts index 41a4e625056..456d89c4bfa 100644 --- a/src/gateway/server.auth.compat-baseline.test.ts +++ b/src/gateway/server.auth.compat-baseline.test.ts @@ -19,7 +19,7 @@ import { startGatewayServer, testState, installGatewayTestHooks, -} from "./server.auth.shared.js"; +} from "./server.auth.test-helpers.js"; installGatewayTestHooks({ scope: "suite" }); diff --git a/src/gateway/server.auth.control-ui.suite.ts b/src/gateway/server.auth.control-ui.suite.ts index 5aef5c8ec52..d0d7f1f9491 100644 --- a/src/gateway/server.auth.control-ui.suite.ts +++ b/src/gateway/server.auth.control-ui.suite.ts @@ -31,7 +31,7 @@ import { waitForWsClose, withGatewayServer, writeTrustedProxyControlUiConfig, -} from "./server.auth.shared.js"; +} from "./server.auth.test-helpers.js"; const operatorIdentityPathByPrefix = new Map(); diff --git a/src/gateway/server.auth.control-ui.test.ts b/src/gateway/server.auth.control-ui.test.ts index 3a24930873d..ce1f3f3e9cd 100644 --- a/src/gateway/server.auth.control-ui.test.ts +++ b/src/gateway/server.auth.control-ui.test.ts @@ -3,7 +3,7 @@ */ import { describe } from "vitest"; import { registerControlUiAndPairingSuite } from "./server.auth.control-ui.suite.js"; -import { installGatewayTestHooks } from "./server.auth.shared.js"; +import { installGatewayTestHooks } from "./server.auth.test-helpers.js"; installGatewayTestHooks({ scope: "suite" }); diff --git a/src/gateway/server.auth.default-token.suite.ts b/src/gateway/server.auth.default-token.suite.ts index 9f90bf81d2e..d1bc46c6c72 100644 --- a/src/gateway/server.auth.default-token.suite.ts +++ b/src/gateway/server.auth.default-token.suite.ts @@ -25,7 +25,7 @@ import { waitForWsClose, withGatewayServer, withRuntimeVersionEnv, -} from "./server.auth.shared.js"; +} from "./server.auth.test-helpers.js"; export function registerDefaultAuthTokenSuite(): void { describe("default auth (token)", () => { diff --git a/src/gateway/server.auth.default-token.test.ts b/src/gateway/server.auth.default-token.test.ts index 0a19646a6b5..c10af26f808 100644 --- a/src/gateway/server.auth.default-token.test.ts +++ b/src/gateway/server.auth.default-token.test.ts @@ -3,7 +3,7 @@ */ import { describe } from "vitest"; import { registerDefaultAuthTokenSuite } from "./server.auth.default-token.suite.js"; -import { installGatewayTestHooks } from "./server.auth.shared.js"; +import { installGatewayTestHooks } from "./server.auth.test-helpers.js"; installGatewayTestHooks({ scope: "suite" }); diff --git a/src/gateway/server.auth.modes.suite.ts b/src/gateway/server.auth.modes.suite.ts index 2cd0fbf1dc5..f46d0ef3e00 100644 --- a/src/gateway/server.auth.modes.suite.ts +++ b/src/gateway/server.auth.modes.suite.ts @@ -14,7 +14,7 @@ import { startGatewayServer, testState, testTailscaleWhois, -} from "./server.auth.shared.js"; +} from "./server.auth.test-helpers.js"; export function registerAuthModesSuite(): void { describe("password auth", () => { diff --git a/src/gateway/server.auth.modes.test.ts b/src/gateway/server.auth.modes.test.ts index 3f62acd9f2a..6c4aa3ad904 100644 --- a/src/gateway/server.auth.modes.test.ts +++ b/src/gateway/server.auth.modes.test.ts @@ -3,7 +3,7 @@ */ import { describe } from "vitest"; import { registerAuthModesSuite } from "./server.auth.modes.suite.js"; -import { installGatewayTestHooks } from "./server.auth.shared.js"; +import { installGatewayTestHooks } from "./server.auth.test-helpers.js"; installGatewayTestHooks({ scope: "suite" }); diff --git a/src/gateway/server.auth.shared.ts b/src/gateway/server.auth.test-helpers.ts similarity index 100% rename from src/gateway/server.auth.shared.ts rename to src/gateway/server.auth.test-helpers.ts