Skip to content

Commit 4e67dbd

Browse files
authored
Clarify OpenClaw gateway auth terminology (#460)
- Send shared secrets as `token` in gateway connect params - Update OpenClaw settings copy to say shared secret/token - Align tests with the new auth naming
1 parent 627224b commit 4e67dbd

7 files changed

Lines changed: 40 additions & 8 deletions

File tree

apps/server/src/openclawGatewayTest.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ describe("runOpenclawGatewayTest", () => {
140140
expect(connectParams?.client?.mode).toBe("backend");
141141
expect(connectParams?.client?.displayName).toBe("OK Code gateway test");
142142
expect(connectParams?.client?.deviceFamily).toBe("server");
143-
expect(connectParams?.auth?.password).toBe("topsecret");
144-
expect(connectParams?.auth?.token).toBeUndefined();
143+
expect(connectParams?.auth?.token).toBe("topsecret");
144+
expect(connectParams?.auth?.password).toBeUndefined();
145145
expect(connectParams?.auth?.deviceToken).toBeUndefined();
146146
expect(connectParams?.device?.id).toMatch(/^[a-f0-9]{64}$/);
147147
expect(connectParams?.device?.id).not.toMatch(/^device_/);

apps/server/src/provider/Layers/OpenClawGatewayClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ function buildConnectParams(input: {
436436
const auth =
437437
input.auth.kind === "password"
438438
? {
439-
password: input.auth.value,
439+
token: input.auth.value,
440440
}
441441
: input.auth.kind === "deviceToken"
442442
? {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { describe, expect, it } from "vitest";
2+
3+
import { getDefaultSmeAuthMethod, getSmeAuthMethodOptions } from "./smeConversationConfig";
4+
5+
describe("smeConversationConfig", () => {
6+
it("keeps OpenClaw auth copy aligned with shared secret/token terminology", () => {
7+
const options = getSmeAuthMethodOptions("openclaw");
8+
9+
expect(getDefaultSmeAuthMethod("openclaw")).toBe("password");
10+
expect(options).toEqual([
11+
{ value: "password", label: "Gateway Shared Secret / Token" },
12+
{ value: "none", label: "Device Token Only" },
13+
{ value: "auto", label: "Auto (prefer shared secret/token)" },
14+
]);
15+
});
16+
});

apps/web/src/components/sme/smeConversationConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ export function getSmeAuthMethodOptions(
4444
];
4545
case "openclaw":
4646
return [
47-
{ value: "password", label: "Gateway Shared Secret" },
47+
{ value: "password", label: "Gateway Shared Secret / Token" },
4848
{ value: "none", label: "Device Token Only" },
49-
{ value: "auto", label: "Auto (prefer shared secret)" },
49+
{ value: "auto", label: "Auto (prefer shared secret/token)" },
5050
];
5151
case "gemini":
5252
return [
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { describe, expect, it } from "vitest";
2+
3+
import { PROVIDER_AUTH_GUIDES } from "./settingsProviderMetadata";
4+
5+
describe("PROVIDER_AUTH_GUIDES", () => {
6+
it("describes OpenClaw auth as a shared secret/token flow", () => {
7+
const guide = PROVIDER_AUTH_GUIDES.openclaw;
8+
9+
expect(guide.authCmd).toBe("Use gateway shared secret/token");
10+
expect(guide.note).toContain("shared secret/token");
11+
expect(guide.note).toContain("remote gateways");
12+
});
13+
});

apps/web/src/lib/settingsProviderMetadata.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export const PROVIDER_AUTH_GUIDES: Record<ProviderKind, ProviderAuthGuide> = {
101101
note: "GitHub Copilot must be installed and signed in before it appears in the thread picker.",
102102
},
103103
openclaw: {
104+
authCmd: "Use gateway shared secret/token",
104105
verifyCmd: "Test Connection",
105-
note: "OpenClaw uses the gateway URL and shared secret below rather than a local CLI login. Shared-secret auth usually works without device pairing and is the recommended default for Tailscale and remote gateways.",
106+
note: "OpenClaw uses the gateway URL and shared secret/token below rather than a local CLI login. Shared-secret auth usually works without device pairing and is the recommended default for Tailscale and remote gateways.",
106107
},
107108
};

apps/web/src/routes/_chat.settings.index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function AuthenticationStatusCard({
335335
<div className="rounded-lg border border-border/60 bg-card/60 px-3 py-2">
336336
<div className="font-medium text-foreground">Authenticate</div>
337337
<code className="mt-1 block break-all text-[11px]">
338-
{guide.authCmd ?? "Use gateway password"}
338+
{guide.authCmd ?? "Use gateway shared secret/token"}
339339
</code>
340340
</div>
341341
<div className="rounded-lg border border-border/60 bg-card/60 px-3 py-2">
@@ -1565,7 +1565,9 @@ function SettingsRouteView() {
15651565
</span>
15661566
</label>
15671567
<label htmlFor="openclaw-password" className="block">
1568-
<span className="block text-xs font-medium text-foreground">Password</span>
1568+
<span className="block text-xs font-medium text-foreground">
1569+
Shared Secret / Token
1570+
</span>
15691571
<Input
15701572
id="openclaw-password"
15711573
className="mt-1"

0 commit comments

Comments
 (0)