test(core): cover managed output read permissions (#31166)
This commit is contained in:
parent
eb9a683b40
commit
1025540fcc
1 changed files with 15 additions and 0 deletions
|
|
@ -161,6 +161,21 @@ describe("PermissionV2", () => {
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
it.effect("allows managed output reads without granting external directory access", () =>
|
||||||
|
Effect.gen(function* () {
|
||||||
|
yield* setup([
|
||||||
|
{ action: "*", resource: "*", effect: "deny" },
|
||||||
|
{ action: "read", resource: "*", effect: "allow" },
|
||||||
|
])
|
||||||
|
const service = yield* PermissionV2.Service
|
||||||
|
|
||||||
|
expect(yield* service.ask(assertion({ resources: ["tool_123"] }))).toMatchObject({ effect: "allow" })
|
||||||
|
expect(
|
||||||
|
yield* service.ask(assertion({ action: "external_directory", resources: ["/tmp/tool-output/*"] })),
|
||||||
|
).toMatchObject({ effect: "deny" })
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
it.effect("uses build permissions when the Session agent is omitted", () =>
|
it.effect("uses build permissions when the Session agent is omitted", () =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
yield* setup()
|
yield* setup()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue