Documentation
¶
Overview ¶
Package gate — the classifier behind framework/gate.
One exported function, and it performs no effect: it reads a policy, a command path and whatever the caller's verifier returned, and says what the caller should do. The network access, the upgrade and the process exit all stay in the caller's own control flow, where they can be refused, logged or tested.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decide ¶
func Decide(policy *coregate.PolicyValue, path []string, verify func() error) coregate.DecisionValue
Decide classifies one invocation.
The ORDER is the contract, and it is the part worth reading twice.
Exemption is checked FIRST, and verify is not CALLED at all when it holds. That is why this takes a function rather than an error: a caller handed an already-computed result has already paid for it, and an exempt command must not pay. `completion` runs from a shell hook where a network round trip would be hostile, and `license status` must work on exactly the machine whose licence is broken — neither can afford a verification, and neither should have to remember not to run one.
The floor is checked BEFORE the refusal is propagated, because an out-of-date binary must be told to upgrade whether or not its entitlement is also in order: the upgrade is the same action either way, and reporting "your licence is broken" to somebody whose answer is "run upgrade" sends them to the wrong place.
It takes policy, the product's gate policy — a nil one refuses everything, including a verification that would have passed; path, the command path relative to the root with the root itself NOT included, where nil is the bare root invocation; and verify, the caller's entitlement verification, CALLED AT MOST ONCE and only when the invocation is not exempt, with a nil verify refusing because nothing vouched for the invocation.
It returns what the caller should do, and everything the verifier said.
Types ¶
This section is empty.