test(gateway): assert cli_container_local precedence over loopback fallback (#69397)

This commit is contained in:
SARAMALI15792
2026-04-20 23:01:45 +05:00
committed by Peter Steinberger
parent 8ef356d5c3
commit fb1a5a2c26

View File

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