whyno-core 0.5.0

Permission check pipeline, fix engine, and state types
Documentation
//! MAC builder methods for [`StateBuilder`].

use crate::state::mac::{AppArmorState, SeLinuxState};
use crate::state::Probe;

use super::StateBuilder;

impl StateBuilder {
    /// Sets synthetic `SELinux` state for testing `check_selinux` without a live kernel.
    #[must_use]
    pub fn with_selinux_state(mut self, state: SeLinuxState) -> Self {
        self.mac_state.selinux = Probe::Known(state);
        self
    }

    /// Sets synthetic `AppArmor` state for testing `check_apparmor` without a live kernel.
    #[must_use]
    pub fn with_apparmor_state(mut self, state: AppArmorState) -> Self {
        self.mac_state.apparmor = Probe::Known(state);
        self
    }
}