Repository navigation
Grant a private resource to an environment - #69
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
networks0.4.0 added theenvironmentprincipal — 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:
parsePrincipalTyperejectedenvironmentwith "must be agent, user, app, or group".principalTypeStringpanicked 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.