mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-29 02:41:07 +00:00
Hardening: refresh stale device pairing requests and pending metadata (#50695)
* Docs: clarify device pairing supersede behavior * Device pairing: supersede pending requests on auth changes
This commit is contained in:
@@ -287,6 +287,30 @@ describe("devices cli local fallback", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("devices cli list", () => {
|
||||
it("renders pending scopes when present", async () => {
|
||||
callGateway.mockResolvedValueOnce({
|
||||
pending: [
|
||||
{
|
||||
requestId: "req-1",
|
||||
deviceId: "device-1",
|
||||
displayName: "Device One",
|
||||
role: "operator",
|
||||
scopes: ["operator.admin", "operator.read"],
|
||||
ts: 1,
|
||||
},
|
||||
],
|
||||
paired: [],
|
||||
});
|
||||
|
||||
await runDevicesCommand(["list"]);
|
||||
|
||||
const output = runtime.log.mock.calls.map((entry) => String(entry[0] ?? "")).join("\n");
|
||||
expect(output).toContain("Scopes");
|
||||
expect(output).toContain("operator.admin, operator.read");
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
callGateway.mockClear();
|
||||
buildGatewayConnectionDetails.mockClear();
|
||||
|
||||
Reference in New Issue
Block a user