Bound read-only shell diagnostics

This commit is contained in:
Mikei386 committed 2026-08-24 15:51:07 +02:00
1 parent 88643de738
commit 6876e495d6
7 files changed
+39 -13

No files matched your search

+13
View File
@@ -94,6 +94,19 @@ describe("read-only shell", () => {
await expect(runReadOnlyCommand("find", ["/tmp", "-delete"], 5)).rejects.toThrow();
await expect(runReadOnlyCommand("ss", ["-K", "dst", "127.0.0.1"], 5)).rejects.toThrow();
});
test("bounds read-only output server-side and reports truncation", async () => {
const result = JSON.parse(
await runReadOnlyCommand("cat", ["/dev/zero"], 1, 1000),
);
expect(result.truncated).toBe(true);
expect(result.stdout.length).toBeLessThanOrEqual(1000);
});
test("rejects excessive read-only output budgets", async () => {
await expect(runReadOnlyCommand("ls", ["/"], 5, 999)).rejects.toThrow();
await expect(runReadOnlyCommand("ls", ["/"], 5, 30001)).rejects.toThrow();
});
});
describe("Community Applications approval", () => {