From c7cade5232390ce1cff27e18098dcd0add076be7 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 8 Jan 2026 08:24:39 +0100 Subject: [PATCH] style: tidy gateway auth imports --- src/cli/gateway-cli.ts | 6 +++--- src/gateway/auth.ts | 5 ++++- src/gateway/server.ts | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/cli/gateway-cli.ts b/src/cli/gateway-cli.ts index 3604f1cf5..28f99cbcb 100644 --- a/src/cli/gateway-cli.ts +++ b/src/cli/gateway-cli.ts @@ -3,6 +3,7 @@ import fs from "node:fs"; import type { Command } from "commander"; import { CONFIG_PATH_CLAWDBOT, + type GatewayAuthMode, loadConfig, readConfigFileSnapshot, resolveGatewayPort, @@ -13,8 +14,8 @@ import { GATEWAY_WINDOWS_TASK_NAME, } from "../daemon/constants.js"; import { resolveGatewayService } from "../daemon/service.js"; -import { callGateway } from "../gateway/call.js"; import { resolveGatewayAuth } from "../gateway/auth.js"; +import { callGateway } from "../gateway/call.js"; import { startGatewayServer } from "../gateway/server.js"; import { type GatewayWsLogStyle, @@ -358,7 +359,7 @@ export function registerGatewayCli(program: Command) { process.env.CLAWDBOT_GATEWAY_TOKEN = String(opts.token); } const authModeRaw = opts.auth ? String(opts.auth) : undefined; - const authMode = + const authMode: GatewayAuthMode | null = authModeRaw === "token" || authModeRaw === "password" ? authModeRaw : null; @@ -584,5 +585,4 @@ export function registerGatewayCli(program: Command) { } }), ); - } diff --git a/src/gateway/auth.ts b/src/gateway/auth.ts index 2c8ba01e7..1aecd1348 100644 --- a/src/gateway/auth.ts +++ b/src/gateway/auth.ts @@ -1,6 +1,9 @@ import { timingSafeEqual } from "node:crypto"; import type { IncomingMessage } from "node:http"; -import type { GatewayAuthConfig, GatewayTailscaleMode } from "../config/config.js"; +import type { + GatewayAuthConfig, + GatewayTailscaleMode, +} from "../config/config.js"; export type ResolvedGatewayAuthMode = "none" | "token" | "password"; export type ResolvedGatewayAuth = { diff --git a/src/gateway/server.ts b/src/gateway/server.ts index 2609e2ca2..d2ea0ce0b 100644 --- a/src/gateway/server.ts +++ b/src/gateway/server.ts @@ -102,8 +102,8 @@ import type { WizardSession } from "../wizard/session.js"; import { assertGatewayAuthConfigured, authorizeGatewayConnect, - resolveGatewayAuth, type ResolvedGatewayAuth, + resolveGatewayAuth, } from "./auth.js"; import { type GatewayReloadPlan,