Documentation
¶
Overview ¶
package: access / policy type: checker job: decide whether a system account may exercise a CRUD right on a branch limits: pure policy from config; no ports, no ctx; core loops it for delete (-> config, core)
Access is this deployment's policy: accounts holding CRUD grants over branch globs, declared in config, never in the graph. The checker answers one (principal, right, branch) question; verifiability never consults it.
A for admin is C on $branches, the branch table being a claim, so creating a branch contributes to it while writing into one is the separate C on that branch. A caveat is a grant of opposite polarity, the effective permission their intersection.
Index ¶
Constants ¶
const ( Universe = "$universe" Archive = "$archive" Sequencer = "$sequencer" Branches = "$branches" )
The reserved branches a grant may target. '$' is illegal in an ordinary name, so no glob confers one by accident.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker answers access requests against a fixed set of accounts and grants.
func New ¶
New builds a checker from the configured accounts, each mapping to compact grant specs. It validates every grant offline and fails on the first malformed one.
func (*Checker) Allow ¶
Allow reports whether the principal may exercise right on branch: the account's grants and every caveat must allow it. Unknown or ungranted is denied.
Caveats are successive attenuations, each a predicate the request must still satisfy, so one Grant carries a whole step's rights ("RIGHTS glob") — siblings would read as alternatives, and a second narrowing would fail to narrow.
type Grant ¶
type Grant struct {
// contains filtered or unexported fields
}
Grant confers rights over the branches matching a glob — the unit of both an account grant and a token caveat, the Checker applying the polarity.
func ParseGrant ¶
ParseGrant parses one "RIGHTS glob" spec ("CR foo_*", "R $universe"), rejecting unknown letters, malformed globs, and non-R rights on $universe. Caveats reuse it.
type Principal ¶
Principal is the identity a request acts as: the account the credential resolved to, plus any caveats attenuating its grants (empty = none).