mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-21 06:02:13 +00:00
test(auth): align device scope expectations (#53151)
This commit is contained in:
@@ -294,7 +294,11 @@ describe("device pairing tokens", () => {
|
||||
const paired = await getPairedDevice("device-1", baseDir);
|
||||
expect(paired?.scopes).toEqual(["operator.admin"]);
|
||||
expect(paired?.approvedScopes).toEqual(["operator.admin"]);
|
||||
expect(paired?.tokens?.operator?.scopes).toEqual(["operator.admin"]);
|
||||
expect(paired?.tokens?.operator?.scopes).toEqual([
|
||||
"operator.admin",
|
||||
"operator.read",
|
||||
"operator.write",
|
||||
]);
|
||||
});
|
||||
|
||||
test("rejects scope escalation when rotating a token and leaves state unchanged", async () => {
|
||||
|
||||
@@ -186,7 +186,7 @@ describe("device-auth-store", () => {
|
||||
expect(entry).toEqual({
|
||||
token: "new-token",
|
||||
role: "operator",
|
||||
scopes: ["operator.write"],
|
||||
scopes: ["operator.read", "operator.write"],
|
||||
updatedAtMs: 2222,
|
||||
});
|
||||
expect(readStore()).toEqual({
|
||||
|
||||
Reference in New Issue
Block a user