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:
Josh Avant
2026-03-19 18:26:06 -05:00
committed by GitHub
parent 9486f6e379
commit 8e132aed6e
19 changed files with 452 additions and 41 deletions

View File

@@ -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();