Documentation
¶
Overview ¶
Package glaz evaluates governance policies through GLAZ's Rego evaluator, the glaz-govern crate, linked into Relay as a static library over the C ABI that GLAZ owns (crates/glaz-ffi in gitlab-org/auth/glaz).
The package is a thin binding in the sense GOVERN-001 requires: it holds no policy data, performs no evaluation of its own, and executes no actions. It crosses the boundary, maps the result, and derives the gating verdict.
Evaluate lives behind the `glaz` build tag, because the omnibus and CNG builds cannot yet fetch the library it links; see engine.go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEnginePanicked = errors.New("glaz: panic at the FFI boundary, engine must be discarded")
ErrEnginePanicked reports a panic caught at the FFI boundary. The engine may be in an unknown state afterwards. Nothing replaces it today: the error reaches the call site and the operation that asked for the decision fails.
Functions ¶
This section is empty.
Types ¶
type Action ¶
Action is something a decision demands of the call site, which carries it out itself. Type is the action kind, "block" being the only one the engine synthesizes today.
Gating says whether the action gates the operation. GLAZ stamps it, so a call site never infers it from Type and an action type this binding has never seen still gates correctly.
type Decision ¶
type Decision struct {
Actions []*Action
Reasons []*Reason
EvaluationErr *EvaluationError
}
Decision is the outcome of one evaluation: what to enforce (Actions), why (Reasons), and, when the engine could not evaluate at all, the failure that prevented it.
type EvaluationError ¶
type EvaluationError struct {
Message string
}
EvaluationError is the engine reporting that it could not evaluate: an invalid policy, an oversized document, an exhausted time budget, a result shape it does not recognize.
It travels in-band on Decision rather than as an error from Evaluate because GOVERN-001 wants a call site to journal it and fail closed, not to retry it. Faults that say nothing about the policy stay Go errors from Evaluate.
func (*EvaluationError) Error ¶
func (e *EvaluationError) Error() string
type Reason ¶
Reason is one explanation for why a policy matched: one entry per violation/deny element the policy produced.
type Verdict ¶
type Verdict string
Verdict is the gating outcome of an evaluation.
GOVERN-001 derives the verdict from the decision rather than carrying it on the wire, so that a verdict and its actions can never disagree. Only VerdictAllow lets an operation proceed; a call site fails closed on anything else.
const ( // VerdictAllow means no policy demanded anything of this operation. VerdictAllow Verdict = "allow" // VerdictDeny means a policy demanded something that gates the operation. VerdictDeny Verdict = "deny" // VerdictUndecidable means the engine could not evaluate, so nothing is // known about the operation and it must not proceed. VerdictUndecidable Verdict = "undecidable" )