Repository navigation
feat(policy): parse and validate policy.toml - #88
Merged
Merged
Conversation
`init` writes a `policy.toml` to the `policy` target, but nothing read it: who orders each target, and what landing on it requires, were only words in the design. `Policy` gives the file its schema: `[nodes]` with each node's public key, `[groups]` of users and nodes, a `[targets.<name>]` table with the node that is the target's authority and the statements landing on it requires, and ordered `[[paths]]` rules. A target without a table has the authority of `policy` and requires nothing. The policy in force is the one at the head of `policy`. Parsing checks every name the policy refers to: an authority must be a node with a key, a group must be defined, and unknown keys are errors, so a typo never drops a requirement. Path rules are parsed and checked, but not enforced yet. `NodePublicKey` and `Verdict` parse as they display, for the file's values, and the policy `init` writes now sketches groups and requirements in comments.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
19 tasks
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.
initwrites apolicy.tomlto thepolicytarget, but nothing reads it: who orders each target, and what landing on it requires, are only words in the design. This gives the file its schema, so the landing queue can check it.The schema:
[nodes]: each node's ed25519 public key.[groups]: users and nodes, for requirements and path rules.[targets.<name>]: the node that is the target's authority, and the statements landing on it requires. A target without a table has the authority ofpolicyand requires nothing.[[paths]]: ordered rules of what each grantee may do under a path. They're parsed and checked, but not enforced yet.The policy in force is the one at the head of
policy. Parsing checks every name the policy refers to: an authority must be a node with a key, a group must be defined, and unknown keys are errors, so a typo never drops a requirement.NodePublicKeyandVerdictnow parse as they display, and the policyinitwrites sketches groups and requirements in comments.Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)