Skip to main content

AccessDecider

Trait AccessDecider 

Source
pub trait AccessDecider: Send + Sync {
    // Required methods
    fn check(
        &self,
        ctx: &SecurityContext,
        object: ObjectRef<'_>,
        action: Action,
    ) -> bool;
    fn audit_denial(
        &self,
        ctx: &SecurityContext,
        object: ObjectRef<'_>,
        object_label: Option<SecurityLabel>,
        action: Action,
        reason: ReferenceMonitorDenyReason,
    );
}
Expand description

Authorizes one operation against a subject’s cached [SecurityContext] and exact walked object reference.

Resolution belongs to the concrete implementation in hyprstream, which owns the production content-truth label resolver and tamper-evident audit sink. Passing the object reference—not an optional caller-supplied label—keeps label resolution and auditing inside the authoritative PEP.

Required Methods§

Source

fn check( &self, ctx: &SecurityContext, object: ObjectRef<'_>, action: Action, ) -> bool

Source

fn audit_denial( &self, ctx: &SecurityContext, object: ObjectRef<'_>, object_label: Option<SecurityLabel>, action: Action, reason: ReferenceMonitorDenyReason, )

Record a denial made by the reference monitor before the local policy decision is reached.

Production implementations must write through the same tamper-evident audit sink used by Self::check. This method is required rather than defaulted so adding an early-return gate cannot silently create an unaudited denial path.

Implementors§