Skip to main content

CapabilityManager

Struct CapabilityManager 

Source
pub struct CapabilityManager { /* private fields */ }
Expand description

Trusted grant management, separate from caller authorization at a wire boundary.

The manager owns one kernel and its process-local seal key. It does not expose raw insertion, mutable kernel access, or private bootstrap anchors as grants.

Implementations§

Source§

impl CapabilityManager

Source

pub fn with_key(key: [u8; 32]) -> Result<Self, KernelError>

Construct with caller-supplied random key bytes; an all-zero key is refused.

The caller must obtain these bytes from a cryptographically suitable source. It does not generate the seal key and cannot establish the supplied key’s entropy.

Source

pub fn register_actor( &mut self, plugin_id: PluginId, level: SecurityLevel, ) -> Result<(), KernelError>

Source

pub fn mint( &mut self, plugin_id: PluginId, namespace: &str, rights: Rights, ) -> Result<CapId, KernelError>

Mint a sealed grant with exactly the requested nonempty rights.

A private, unsealed anchor supplies this mint’s namespace and rights. Only the kernel-delegated, sealed child is returned. This is a library operation, not a boot hook or an authorization decision for an untrusted caller.

Source

pub fn bootstrap_root_capability( &mut self, plugin_id: PluginId, namespace: &str, rights: Rights, ) -> Result<CapId, KernelError>

Compatibility name for Self::mint; the returned grant is now sealed.

Its parent is a private anchor, not another publicly usable grant.

Source

pub fn compose( &mut self, parent_cap_id: CapId, target_plugin: PluginId, requested_rights: Rights, ) -> Result<CapId, KernelError>

Delegate from a current held grant; the kernel performs rights intersection.

Management callers are trusted. This does not add a separate Delegate-bit policy or authorize a wire caller to act on another actor’s grant.

Source

pub fn get_cap(&self, cap_id: CapId) -> Option<&Capability>

Read a canonical grant, including a revoked grant; private anchors are hidden.

Source

pub fn verify_seal(&self, cap: &Capability) -> bool

Verify only the signed payload under this manager’s process-local key.

The kernel seal covers holder, target, rights, parent and epoch. It does not cover the capability ID or mutable revocation flag. This predicate alone does not establish table membership, a holder’s authority or liveness.

Source

pub fn is_live(&self, cap_id: CapId) -> bool

Check the stored grant and every ancestor, ending at a known private anchor.

This checks current liveness. Use Self::validate for holder, seal, namespace and right checks together. A later protected write still needs its own synchronization with revocation; this predicate is not a transaction.

Source

pub fn validate( &self, plugin_id: PluginId, cap_id: CapId, namespace: &str, required_right: Right, ) -> Result<(), KernelError>

Source

pub fn revoke(&mut self, cap_id: CapId) -> Result<(), KernelError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.