pub struct GrantPolicy {
pub policy_id: String,
pub workspace_root: String,
pub effect_ceiling: Vec<EffectKind>,
pub path_ceiling: Vec<PathPattern>,
pub command_ceiling: Vec<CommandPattern>,
pub network_ceiling: Vec<NetworkPattern>,
pub approval_ceiling: ApprovalPolicy,
pub authority_epoch: u64,
pub persistent: bool,
pub integrity_binding: String,
}Expand description
Durable authorization intent. A resume re-mints a fresh live capability from this policy and current workspace facts; the capability itself is deliberately not serializable.
Fields§
§policy_id: String§workspace_root: String§effect_ceiling: Vec<EffectKind>§path_ceiling: Vec<PathPattern>§command_ceiling: Vec<CommandPattern>§network_ceiling: Vec<NetworkPattern>§approval_ceiling: ApprovalPolicy§persistent: bool§integrity_binding: StringContent binding recorded in the session ledger. Persistent policies require a separate cryptographic signature before cross-session use.
Implementations§
Source§impl GrantPolicy
impl GrantPolicy
Sourcepub fn mint(&self, requested: Capability) -> Result<Capability>
pub fn mint(&self, requested: Capability) -> Result<Capability>
Mint a live capability as the intersection of a requested template with this policy’s ceilings (PSP-9 resolved decision 6). Fails closed: an empty effect intersection is an error, never an unlimited grant.
The approval ceiling governs durable delivery. A Worker-role request
confined to the reversible candidate overlay may keep Auto inside an
Ask ceiling, because nothing it does becomes durable without the
separate promotion approval; every other role is clamped to the
stricter policy.
Sourcepub fn canonical_bytes(&self) -> Vec<u8> ⓘ
pub fn canonical_bytes(&self) -> Vec<u8> ⓘ
The deterministic byte encoding the grant signature commits to.
serde output is not canonical (field order, float and escape formatting may change across versions), so the signature covers this fixed, length-prefixed encoding instead. Every field participates; list fields are count-prefixed so no concatenation can alias two policies.
Trait Implementations§
Source§impl Clone for GrantPolicy
impl Clone for GrantPolicy
Source§fn clone(&self) -> GrantPolicy
fn clone(&self) -> GrantPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GrantPolicy
impl Debug for GrantPolicy
Source§impl<'de> Deserialize<'de> for GrantPolicy
impl<'de> Deserialize<'de> for GrantPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for GrantPolicy
impl PartialEq for GrantPolicy
Source§fn eq(&self, other: &GrantPolicy) -> bool
fn eq(&self, other: &GrantPolicy) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for GrantPolicy
impl Serialize for GrantPolicy
impl StructuralPartialEq for GrantPolicy
Auto Trait Implementations§
impl Freeze for GrantPolicy
impl RefUnwindSafe for GrantPolicy
impl Send for GrantPolicy
impl Sync for GrantPolicy
impl Unpin for GrantPolicy
impl UnsafeUnpin for GrantPolicy
impl UnwindSafe for GrantPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.