pub trait LifecyclePolicy: Send + Sync {
// Required method
fn authorize(
&self,
caller: &Subject,
id: &str,
verb: LifecycleVerb,
) -> Result<(), String>;
}Expand description
Fail-closed authorization seam for destructive ctl lifecycle verbs
(#1272, epic #1267 T3).
ExecMount’s write path previously ignored _caller entirely when
invoking stop/kill/destroy. This trait is the mediation point: when a
policy is installed on the mount (ExecMount::new_with_lifecycle), every
destructive verb must pass authorize before the backend is touched.
Fail-closed contract: returning Err ⇒ the verb is refused
(MountError::PermissionDenied); there is no permissive default inside a
policy. The mount’s status-quo (no policy installed) is represented by
lifecycle: None, NOT by a permissive policy — mirroring the
hyprstream_vfs::NamespacePep activation posture (the separately-gated
B-lane flips construction sites to armed).
The clearance-provenance dependency (#698) is the same as the VFS PEP’s: a
production policy resolves the caller’s SecurityContext from verified
credential material and applies MAC can_access against the instance’s
label. Until #698 wires that, the policy is a structural seam.
Required Methods§
Authorize verb on instance id by caller. Ok(()) permits;
Err(detail) denies with a human-readable reason.