pub struct ProcessSessionPermissions { /* private fields */ }Expand description
Capability state owned by a single runtime session, never a global store.
Ordinary paths, host integrations, outbound network, and reversible local
git mutations are retained only when explicitly approved with
ApprovalScope::Session. Explicitly reviewed paths and protected
metadata remain strictly once-only.
Implementations§
Source§impl ProcessSessionPermissions
impl ProcessSessionPermissions
Sourcepub fn from_snapshot(snapshot: ProcessSessionPermissionSnapshot) -> Self
pub fn from_snapshot(snapshot: ProcessSessionPermissionSnapshot) -> Self
Creates an independent session seeded with an immutable capability snapshot.
Subsequent grants retained in the returned session stay isolated from any parent or sibling sessions that produced the snapshot.
Sourcepub fn from_inherited_view(
view: &ProcessSessionPermissionView,
) -> Result<Self, ProcessRunnerError>
pub fn from_inherited_view( view: &ProcessSessionPermissionView, ) -> Result<Self, ProcessRunnerError>
Creates an independent session seeded from a read-only parent permission view.
§Errors
Fails closed if the parent permission lock was poisoned.
Sourcepub fn view(&self) -> ProcessSessionPermissionView
pub fn view(&self) -> ProcessSessionPermissionView
Supplies a read-only view to an ordinary or permissioned process backend.
Sourcepub fn grants(&self) -> Result<Vec<SessionPermissionGrant>, ProcessRunnerError>
pub fn grants(&self) -> Result<Vec<SessionPermissionGrant>, ProcessRunnerError>
Returns all active session grants with stable revocation identifiers.
§Errors
Fails closed if the session permission lock was poisoned.
Sourcepub fn revoke(&self, id: SessionGrantId) -> Result<bool, ProcessRunnerError>
pub fn revoke(&self, id: SessionGrantId) -> Result<bool, ProcessRunnerError>
Revokes one active session grant by its stable SessionGrantId.
Returns Ok(true) when the grant existed and was removed, or Ok(false)
when no active grant matched id.
§Errors
Fails closed if the session permission lock was poisoned.
Sourcepub fn with_factory<Factory: PermissionedProcessRunnerFactory>(
self,
backend: Factory,
) -> SessionPermissionedProcessRunnerFactory<Factory>
pub fn with_factory<Factory: PermissionedProcessRunnerFactory>( self, backend: Factory, ) -> SessionPermissionedProcessRunnerFactory<Factory>
Wraps an adapter with runtime-owned approval retention. The adapter must consume this session’s read-only view when constructing its runners.
Sourcepub fn clear(&self) -> Result<(), ProcessRunnerError>
pub fn clear(&self) -> Result<(), ProcessRunnerError>
Clears all retained session-scoped grants.
Used when a live session replaces its process sandbox configuration so previously approved capabilities do not silently outlive a tightened baseline.
§Errors
Fails closed if the session permission lock was poisoned.
Sourcepub fn revoke_denied_capabilities(
&self,
network_denied: bool,
denied_host_integrations: &[HostIntegration],
) -> Result<(), ProcessRunnerError>
pub fn revoke_denied_capabilities( &self, network_denied: bool, denied_host_integrations: &[HostIntegration], ) -> Result<(), ProcessRunnerError>
Selectively revokes only session grants invalidated by tightening
individual capability policies (such as setting network = "deny" or
disabling a specific host integration), preserving unrelated path and
domain grants.
§Errors
Fails closed if the session permission lock was poisoned.
Sourcepub fn retain_path_grants(
&self,
grants: Vec<ProcessPathGrant>,
) -> Result<(), ProcessRunnerError>
pub fn retain_path_grants( &self, grants: Vec<ProcessPathGrant>, ) -> Result<(), ProcessRunnerError>
Retains eligible ordinary path grants for the remainder of this session.
Protected metadata and deny rules are filtered out and never retained.
Sourcepub fn retain_domain_grants(
&self,
domains: impl IntoIterator<Item = String>,
) -> Result<(), ProcessRunnerError>
pub fn retain_domain_grants( &self, domains: impl IntoIterator<Item = String>, ) -> Result<(), ProcessRunnerError>
Retains exact external domain grants for web/browser tools for the remainder of this session.