style: tidy gateway auth imports

This commit is contained in:
Peter Steinberger
2026-01-08 08:24:39 +01:00
parent a676e16fbb
commit c7cade5232
3 changed files with 8 additions and 5 deletions

View File

@@ -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) {
}
}),
);
}

View File

@@ -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 = {

View File

@@ -102,8 +102,8 @@ import type { WizardSession } from "../wizard/session.js";
import {
assertGatewayAuthConfigured,
authorizeGatewayConnect,
resolveGatewayAuth,
type ResolvedGatewayAuth,
resolveGatewayAuth,
} from "./auth.js";
import {
type GatewayReloadPlan,