pub trait PermissionedProcessRunnerFactory: Send + Sync {
// Required method
fn runner_for(&self, request: &PermissionRequest) -> Arc<dyn ProcessRunner> ⓘ;
// Provided methods
fn validate_request(
&self,
_request: &PermissionRequest,
) -> Result<(), ProcessRunnerError> { ... }
fn request_capabilities_are_satisfied(
&self,
_request: &PermissionRequest,
) -> Result<bool, ProcessRunnerError> { ... }
fn prepare_approved_request(
&self,
request: &PermissionRequest,
) -> Result<PreparedProcessPermission, ProcessRunnerError> { ... }
}Expand description
Factory for runners created from approved permission requests.
Implementations translate a runtime-approved request into the concrete
process backend/profile for that exact action. Adapters consume read-only
session snapshots; runtime owns retention and capability lifetimes through
SessionPermissionedProcessRunnerFactory. An adapter never records grants
or grants authority beyond the runtime-approved request.
Required Methods§
Sourcefn runner_for(&self, request: &PermissionRequest) -> Arc<dyn ProcessRunner> ⓘ
fn runner_for(&self, request: &PermissionRequest) -> Arc<dyn ProcessRunner> ⓘ
Creates the process runner for one approved permission request, without mutating session state. Runtime handles retention after successful preparation.
Provided Methods§
Sourcefn validate_request(
&self,
_request: &PermissionRequest,
) -> Result<(), ProcessRunnerError>
fn validate_request( &self, _request: &PermissionRequest, ) -> Result<(), ProcessRunnerError>
Validates the request against the backend’s hard capability policy.
Backends that do not have additional policy constraints may keep the default only when they can enforce every capability in the request through their existing runner. A backend that cannot materialize a requested path or network grant must reject it. A validation failure must happen before any reviewer or process side effect is started.
Sourcefn request_capabilities_are_satisfied(
&self,
_request: &PermissionRequest,
) -> Result<bool, ProcessRunnerError>
fn request_capabilities_are_satisfied( &self, _request: &PermissionRequest, ) -> Result<bool, ProcessRunnerError>
Returns whether the backend already enforces every capability in the request for the current process session.
This query covers capability state only; it does not authorize the
requested action. Implementations must return false for capabilities
that are action-scoped, such as network access, or when the backend
cannot prove that the requested access is covered.
Sourcefn prepare_approved_request(
&self,
request: &PermissionRequest,
) -> Result<PreparedProcessPermission, ProcessRunnerError>
fn prepare_approved_request( &self, request: &PermissionRequest, ) -> Result<PreparedProcessPermission, ProcessRunnerError>
Prepares one validated action and its normalized path evidence without changing permission state. Adapters can share a single filesystem view across validation and materialization. The default retains no paths.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".