Skip to content

Grant a private resource to an environment - #69

Merged
vitramir merged 1 commit into
mainfrom
grant-to-environment
Aug 10, 2026
Merged

vitramir merged 1 commit into
mainfrom
grant-to-environment

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

networks 0.4.0 added the environment principal — the only one that reaches a sandbox, since a sandbox workload carries no agent identity and cannot be a group member. The CLI never learned about it.

Two problems, the second worse than the first:

  • parsePrincipalType rejected environment with "must be agent, user, app, or group".
  • principalTypeString panicked on any principal it did not know, so listing a grant that already carried one took the process down.

Both fixed. The unknown-principal case now names the type from its enum rather than panicking — a grant made against a newer server is still a real grant, and crashing during a list is the wrong answer to it.

The CLI refused principal-type environment and, worse, panicked when listing a
grant that already carried one: principalTypeString had no case for it and fell
through to a panic.

An environment is the only principal that reaches a sandbox -- a sandbox
workload carries no agent identity and cannot be a group member -- so refusing
it left no way to do the thing the platform now supports.

The unknown-principal case stops panicking. A grant made against a newer server
is still a real grant, and naming it by its enum beats taking the process down
while someone is listing.
@vitramir
vitramir merged commit 2ecc3a9 into main Aug 10, 2026
1 check passed
@vitramir
vitramir deleted the grant-to-environment branch August 10, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant