Skip to content

Commit a53715e

Browse files
authored
test(auth): align device scope expectations (openclaw#53151)
1 parent c1131ba commit a53715e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/infra/device-pairing.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,11 @@ describe("device pairing tokens", () => {
294294
const paired = await getPairedDevice("device-1", baseDir);
295295
expect(paired?.scopes).toEqual(["operator.admin"]);
296296
expect(paired?.approvedScopes).toEqual(["operator.admin"]);
297-
expect(paired?.tokens?.operator?.scopes).toEqual(["operator.admin"]);
297+
expect(paired?.tokens?.operator?.scopes).toEqual([
298+
"operator.admin",
299+
"operator.read",
300+
"operator.write",
301+
]);
298302
});
299303

300304
test("rejects scope escalation when rotating a token and leaves state unchanged", async () => {

src/shared/device-auth-store.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ describe("device-auth-store", () => {
186186
expect(entry).toEqual({
187187
token: "new-token",
188188
role: "operator",
189-
scopes: ["operator.write"],
189+
scopes: ["operator.read", "operator.write"],
190190
updatedAtMs: 2222,
191191
});
192192
expect(readStore()).toEqual({

0 commit comments

Comments
 (0)