mirror of https://github.com/openclaw/openclaw.git
test(gateway): assert none mode is authoritative with token
This commit is contained in:
parent
0275281e8d
commit
be1b73182c
|
|
@ -130,6 +130,25 @@ describe("gateway auth", () => {
|
|||
expect(res.method).toBe("none");
|
||||
});
|
||||
|
||||
it("keeps none mode authoritative even when token is present", async () => {
|
||||
const auth = resolveGatewayAuth({
|
||||
authConfig: { mode: "none", token: "configured-token" },
|
||||
env: {} as NodeJS.ProcessEnv,
|
||||
});
|
||||
expect(auth).toMatchObject({
|
||||
mode: "none",
|
||||
modeSource: "config",
|
||||
token: "configured-token",
|
||||
});
|
||||
|
||||
const res = await authorizeGatewayConnect({
|
||||
auth,
|
||||
connectAuth: null,
|
||||
});
|
||||
expect(res.ok).toBe(true);
|
||||
expect(res.method).toBe("none");
|
||||
});
|
||||
|
||||
it("reports missing and mismatched password reasons", async () => {
|
||||
const missing = await authorizeGatewayConnect({
|
||||
auth: { mode: "password", password: "secret", allowTailscale: false },
|
||||
|
|
|
|||
Loading…
Reference in New Issue