mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 22:10:43 +00:00
test(gateway): assert cli_container_local precedence over loopback fallback (#69397)
This commit is contained in:
committed by
Peter Steinberger
parent
8ef356d5c3
commit
fb1a5a2c26
@@ -548,4 +548,25 @@ describe("handshake auth helpers", () => {
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("prefers cli_container_local over shared_secret_loopback_local for CLI clients", () => {
|
||||
const connectParams = {
|
||||
client: {
|
||||
id: GATEWAY_CLIENT_IDS.CLI,
|
||||
mode: GATEWAY_CLIENT_MODES.CLI,
|
||||
},
|
||||
} as ConnectParams;
|
||||
expect(
|
||||
resolvePairingLocality({
|
||||
connectParams,
|
||||
isLocalClient: false,
|
||||
requestHost: "127.0.0.1:18789",
|
||||
remoteAddress: "127.0.0.1",
|
||||
hasProxyHeaders: false,
|
||||
hasBrowserOriginHeader: false,
|
||||
sharedAuthOk: true,
|
||||
authMethod: "token",
|
||||
}),
|
||||
).toBe("cli_container_local");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user