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 return policy denials as decisions and infrastructure failures as errors. See crates/khive-gate/docs/api/gate-evaluation.md.

Required Methods§

Source

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

Evaluate req, returning an allow/deny decision or a backend GateError.

Provided Methods§

Source

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

Return the audit backend name; 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§