Skip to content

Commit f472fb3

Browse files
committed
test(webapp): pin read:queues on both of the agent's scope allowlists
The cap and the environment JWT scopes are separate lists that have diverged before, and a queue's own row is a queues read that read:query does not cover.
1 parent 5f3d869 commit f472fb3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

apps/webapp/test/dashboardAgentToolScopes.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ describe("what the agent's delegated token may read", () => {
8080
}
8181
});
8282

83+
it("carries read:queues on both sides, since read:query only buys the metrics", () => {
84+
// A queue's own row — paused, depth, limit — is a `queues` read; its metrics are a
85+
// `query` read. Drop the scope and the live lookup 403s, which the model reads as a
86+
// queue that was never created.
87+
expect(DASHBOARD_AGENT_ENV_JWT_SCOPES).toContain("read:queues");
88+
expect(DASHBOARD_AGENT_UAT_CAP).toContain("read:queues");
89+
expect(buildJwtAbility(["read:query"]).can("read", { type: "queues" })).toBe(false);
90+
});
91+
8392
it("stays read-only on both sides", () => {
8493
for (const scope of [...DASHBOARD_AGENT_UAT_CAP, ...DASHBOARD_AGENT_ENV_JWT_SCOPES]) {
8594
expect(scope.startsWith("read:"), scope).toBe(true);

0 commit comments

Comments
 (0)