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§
- Application
Verified Tenant Binding - An application-verified tenant binding with an explicit validity window.
- Audit
Entry - Durable audit payload for a decision.
- Binding
Provenance - Bounded application-supplied provenance for a tenant or resolver binding.
- Clause
Label - Owned gatekeep identifier.
- Context
- Request-scoped data passed to adapter boundaries.
- Decision
- Structured policy decision with obligations and a typed trace.
- Decision
Audit Id - Owned gatekeep identifier.
- Decision
Audit Occurrence - The stable identity and authoritative occurrence time for one decision.
- 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.
- Evidence
Digest - Fixed-size digest carried as evidence without retaining raw claims or tokens.
- FactId
- Owned gatekeep identifier.
- Fact
Resolution - One atomic result from a fact resolver.
- Fact
Resolution Evidence - Bounded evidence for the complete resolved fact set used by one decision.
- Fact
Resolution Metadata - Resolver metadata supplied by an application for one fact-set observation.
- 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.
- System
Clock - Clock implementation that reads the system UTC wall clock.
- Tenant
Binding Evidence - Bounded evidence for an application-verified tenant binding.
- Tenant
Id - Tenant routing identity shared with Dovecote’s 255-byte
CloudEventsvalue. - Trace
- Durable, non-generic decision trace.
- Trusted
Service Binding - A separately named binding for an explicitly trusted internal service.
Enums§
- Audit
Entry Error - Validation failure for a current durable audit entry.
- Binding
Authority - Authority metadata supplied by the application that verified a binding.
- Condition
- Boolean predicate over known or deferred facts.
- Context
Error - Error returned when a request context cannot establish a safe tenant boundary.
- Decision
Audit Occurrence Error - Validation failure for a decision occurrence crossing the SQL audit boundary.
- 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.
- Fact
Resolution Error - Invalid or stale freshness information in a resolver envelope.
- Fact
Resolution Evidence Error - Failure while creating bounded fact-set evidence.
- 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.
- Tenant
Binding - The binding authority carried by a
crate::Context. - Tenant
Binding Error - Errors returned when constructing or validating a tenant binding.
- Trace
Clause - Serialized decisive clause.
- Trace
Error - Error produced while serializing trace or reason values.
Constants§
- MAX_
TENANT_ ID_ BYTES - Maximum UTF-8 byte length shared with Dovecote tenant routing values.
- POLICY_
HASH_ FORMAT_ VERSION - Durable encoding version used by
Policy::hash.
Traits§
- Audit
Sink - Append-only audit boundary.
- Clock
- Application-owned source of UTC instants used at adapter boundaries.
- 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.