Skip to main content

OriginAdmission

Trait OriginAdmission 

Source
pub trait OriginAdmission: Send + Sync {
    // Required method
    fn admit_origin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        origin: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Stage 1: origin admission decision (RFC 6454 origin → permitted?).

Implemented in the hyprstream crate over PolicyService (federation:register), the same unified federation trust gate used by CIMD client registration and FederationKeyResolver. Abstracted as a trait so the lower hyprstream-rpc crate (which has no PolicyService client) can run the gate, and so the decision is independently testable.

Fail-closed contract: implementations MUST return Ok(()) only when the origin is affirmatively permitted, and Err(_) on denial or on any inability to reach the policy decision (RPC outage) — never default-allow.

Required Methods§

Source

fn admit_origin<'life0, 'life1, 'async_trait>( &'life0 self, origin: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Permit the given RFC 6454 origin, or return why it is rejected.

Implementors§