mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 07:58:35 +00:00
refactor(cli): dedupe gateway run mode parsing
This commit is contained in:
@@ -118,6 +118,17 @@ describe("gateway run option collisions", () => {
|
||||
});
|
||||
}
|
||||
|
||||
function expectAuthOverrideMode(mode: string) {
|
||||
expect(startGatewayServer).toHaveBeenCalledWith(
|
||||
18789,
|
||||
expect.objectContaining({
|
||||
auth: expect.objectContaining({
|
||||
mode,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
it("forwards parent-captured options to `gateway run` subcommand", async () => {
|
||||
await runGatewayCli([
|
||||
"gateway",
|
||||
@@ -156,27 +167,13 @@ describe("gateway run option collisions", () => {
|
||||
it("accepts --auth none override", async () => {
|
||||
await runGatewayCli(["gateway", "run", "--auth", "none", "--allow-unconfigured"]);
|
||||
|
||||
expect(startGatewayServer).toHaveBeenCalledWith(
|
||||
18789,
|
||||
expect.objectContaining({
|
||||
auth: expect.objectContaining({
|
||||
mode: "none",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
expectAuthOverrideMode("none");
|
||||
});
|
||||
|
||||
it("accepts --auth trusted-proxy override", async () => {
|
||||
await runGatewayCli(["gateway", "run", "--auth", "trusted-proxy", "--allow-unconfigured"]);
|
||||
|
||||
expect(startGatewayServer).toHaveBeenCalledWith(
|
||||
18789,
|
||||
expect.objectContaining({
|
||||
auth: expect.objectContaining({
|
||||
mode: "trusted-proxy",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
expectAuthOverrideMode("trusted-proxy");
|
||||
});
|
||||
|
||||
it("prints all supported modes on invalid --auth value", async () => {
|
||||
|
||||
Reference in New Issue
Block a user