pub fn observe(
backend: Backend,
plan: &FirewallPlan,
executable: Option<&Path>,
) -> FirewallObservationExpand description
Ask the host’s firewall about the plan. The judgement is pure; this is the asking, and with no backend there is nothing to ask.
use majordomus_cli::mesh::firewall::{observe, plan, Backend, FirewallObservationState};
let o = observe(Backend::None, &plan(None, &[], None), None);
assert_eq!(o.state, FirewallObservationState::NoBackend);
// the application firewall admits an executable, and without one it cannot be judged
let o = observe(Backend::ApplicationFirewall, &plan(None, &[], None), None);
assert_eq!(o.state, FirewallObservationState::Unobservable);