mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 14:31:42 +00:00
test(gateway): fix trusted-proxy control-ui auth test origin config
This commit is contained in:
@@ -216,6 +216,9 @@ async function configureTrustedProxyControlUiAuth() {
|
|||||||
await writeConfigFile({
|
await writeConfigFile({
|
||||||
gateway: {
|
gateway: {
|
||||||
trustedProxies: ["127.0.0.1"],
|
trustedProxies: ["127.0.0.1"],
|
||||||
|
controlUi: {
|
||||||
|
allowedOrigins: ["https://localhost"],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// oxlint-disable-next-line typescript/no-explicit-any
|
// oxlint-disable-next-line typescript/no-explicit-any
|
||||||
} as any);
|
} as any);
|
||||||
@@ -1023,12 +1026,18 @@ describe("gateway server auth/connect", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("does not bypass pairing for control ui device identity when insecure auth is enabled", async () => {
|
test("does not bypass pairing for control ui device identity when insecure auth is enabled", async () => {
|
||||||
testState.gatewayControlUi = { allowInsecureAuth: true };
|
testState.gatewayControlUi = {
|
||||||
|
allowInsecureAuth: true,
|
||||||
|
allowedOrigins: ["https://localhost"],
|
||||||
|
};
|
||||||
testState.gatewayAuth = { mode: "token", token: "secret" };
|
testState.gatewayAuth = { mode: "token", token: "secret" };
|
||||||
const { writeConfigFile } = await import("../config/config.js");
|
const { writeConfigFile } = await import("../config/config.js");
|
||||||
await writeConfigFile({
|
await writeConfigFile({
|
||||||
gateway: {
|
gateway: {
|
||||||
trustedProxies: ["127.0.0.1"],
|
trustedProxies: ["127.0.0.1"],
|
||||||
|
controlUi: {
|
||||||
|
allowedOrigins: ["https://localhost"],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// oxlint-disable-next-line typescript/no-explicit-any
|
// oxlint-disable-next-line typescript/no-explicit-any
|
||||||
} as any);
|
} as any);
|
||||||
|
|||||||
Reference in New Issue
Block a user