fix: remove unsupported gateway auth off option

This commit is contained in:
Peter Steinberger
2026-01-26 17:44:13 +00:00
parent e6bdffe568
commit b9098f3401
12 changed files with 21 additions and 50 deletions

View File

@@ -3,26 +3,18 @@ import { describe, expect, it } from "vitest";
import { buildGatewayAuthConfig } from "./configure.js";
describe("buildGatewayAuthConfig", () => {
it("clears token/password when auth is off", () => {
const result = buildGatewayAuthConfig({
existing: { mode: "token", token: "abc", password: "secret" },
mode: "off",
});
expect(result).toBeUndefined();
});
it("preserves allowTailscale when auth is off", () => {
it("preserves allowTailscale when switching to token", () => {
const result = buildGatewayAuthConfig({
existing: {
mode: "token",
token: "abc",
mode: "password",
password: "secret",
allowTailscale: true,
},
mode: "off",
mode: "token",
token: "abc",
});
expect(result).toEqual({ allowTailscale: true });
expect(result).toEqual({ mode: "token", token: "abc", allowTailscale: true });
});
it("drops password when switching to token", () => {