Expand description
Code-first authorization primitives for deterministic Rust policy evaluation.
Human guides and reference material are in the docs/ directory of the
repository. API reference: https://docs.rs/gatekeep.
Modules§
Structs§
- Audit
Entry - Durable audit payload for a decision.
- Clause
Label - Owned gatekeep identifier.
- Context
- Request-scoped data passed to adapter boundaries.
- Decision
- Structured policy decision with obligations and a typed trace.
- Decision
Summary - Monomorphic observer payload for a decision.
- Decision
Trace - Typed trace produced by pure evaluation.
- Denial
Reason - Stable denial reason emitted by the core.
- FactId
- Owned gatekeep identifier.
- Identity
Reason Catalog - Reason catalog that renders the stable reason code.
- Known
Facts - Fact bundle accepted by full evaluation.
- Locale
- Language or locale tag used by human-facing reason text.
- Lowered
- Backend filter and grade projection produced by query lowering.
- Noop
Audit Sink - Audit sink that discards entries.
- Noop
Policy Observer - Observer that discards decision summaries.
- Obligation
Id - Owned gatekeep identifier.
- Param
Key - Owned gatekeep identifier.
- Partial
Facts - Fact bundle accepted by partial evaluation.
- Policy
Anchor - Stable policy identity recorded with summaries and audit entries.
- Policy
Hash - Owned gatekeep identifier.
- Policy
Id - Owned gatekeep identifier.
- Reason
Code - Owned gatekeep identifier.
- Request
Id - Owned gatekeep identifier.
- Static
Clause Label - Static gatekeep identifier.
- Static
Fact Id - Static gatekeep identifier.
- Static
Obligation Id - Static gatekeep identifier.
- Static
Param Key - Static gatekeep identifier.
- Static
Reason Code - Static gatekeep identifier.
- Static
Request Id - Static gatekeep identifier.
- Static
Subject Slot - Static gatekeep identifier.
- Static
Tenant Id - Static gatekeep identifier.
- Subject
Ref - Application-owned subject reference.
- Subject
Slot - Owned gatekeep identifier.
- Tenant
Id - Owned gatekeep identifier.
- Trace
- Durable, non-generic decision trace.
Enums§
- Condition
- Boolean predicate over known or deferred facts.
- Decisive
Clause - Typed decisive clause.
- Deny
Shape - Disclosure shape for a denied grant.
- Effect
- Permit or deny effect produced by evaluation.
- Effect
Kind - Permit/deny effect without the generic outcome value.
- Gatekeep
Error - Validation errors returned by typed gatekeep records.
- Lower
Error - Error returned by query-lowering adapters.
- Policy
- Reified authorization policy.
- Presence
- Presence state of a named fact.
- Reason
Value - Structured denial-reason parameter value.
- Residual
- Result of partial evaluation with possibly unknown facts.
- Residual
Policy - Residual policy produced by partial evaluation.
- Residual
Policy Branch - Child branch considered by
ResidualPolicy::try_fold_pruned. - Residual
Policy Node - Fold node exposed by
ResidualPolicy::try_fold. - Resolve
Error - Error returned by fact resolution orchestration.
- Trace
Clause - Serialized decisive clause.
- Trace
Error - Error produced while serializing trace or reason values.
Traits§
- Audit
Sink - Append-only audit boundary.
- Fact
- Marker trait for compile-time known facts.
- Fact
Resolver - Async boundary that resolves policy facts from application-owned storage.
- Lattice
- Outcome ordering used when policies combine permissions.
- Obligation
Spec - Marker trait for compile-time known obligations.
- Policy
Observer - Side-channel observer for decision summaries.
- Query
Lowering - Lowers a residual policy into a backend filter and grade projection.
- Reason
Catalog - Presentation adapter for localized denial reasons.
Functions§
- complete_
residual - Completes a partial-evaluation result against known facts.
- evaluate
- Evaluates a policy against known facts.
- evaluate_
residual - Evaluates a residual policy against known facts.
- partial_
evaluate - Partially evaluates a policy against present, absent, and unknown facts.
- required_
facts - Returns every fact that may be consulted by a policy.
- required_
residual_ facts - Returns every fact that may be consulted by a residual policy.
Type Aliases§
- Gatekeep
Result - Result type used by gatekeep constructors and validators.
- Trace
Value - Opaque serialized value used only for trace and audit output.