Skip to main content

Gate

Trait Gate 

Source
pub trait Gate:
    Send
    + Sync
    + Debug {
    // Required method
    fn check(&self, req: &GateRequest) -> Result<GateDecision, GateError>;

    // Provided method
    fn impl_name(&self) -> &'static str { ... }
}
Expand description

Authorization gate consulted before each verb dispatch.

Implementations live downstream:

  • AllowAllGate (this crate) — permissive default
  • RegoGate (Apache-2.0 sibling crate khive-gate-rego) — regorus-backed Rego eval
  • LionGate<G> (khive-cloud, BUSL) — wraps any Gate with lion-core capability witnesses for verifiable enforcement.

Required Methods§

Source

fn check(&self, req: &GateRequest) -> Result<GateDecision, GateError>

Evaluates the authorization policy for req and returns a decision.

Provided Methods§

Source

fn impl_name(&self) -> &'static str

Short name of this backend — surfaced in audit events so downstream tooling can tell RegoGate results apart from LionGate<RegoGate> results without parsing the type.

Defaults to std::any::type_name::<Self>().

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§