Skip to main content

StaticPolicyEngine

Struct StaticPolicyEngine 

Source
pub struct StaticPolicyEngine { /* private fields */ }

Implementations§

Source§

impl StaticPolicyEngine

Source

pub fn revoke_generation(&self, below: u64)

Revoke all tokens with generation <= below.

Note: tokens issued concurrently during this call may land in the revoked range. This is acceptable for StaticPolicyEngine (test/dev). A production engine should use a lock or AcqRel ordering.

Source

pub fn current_generation(&self) -> u64

Trait Implementations§

Source§

impl Debug for StaticPolicyEngine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StaticPolicyEngine

Source§

fn default() -> StaticPolicyEngine

Returns the “default value” for a type. Read more
Source§

impl PolicyEngine for StaticPolicyEngine

Source§

fn issue_token( &self, pack: &VerticalPackManifest, agent_id: &str, now_epoch_s: u64, ttl_s: u64, ) -> Result<CapabilityToken, PolicyError>

Source§

fn authorize( &self, token: &CapabilityToken, runtime_pack_id: &str, now_epoch_s: u64, required: &BTreeSet<Capability>, ) -> Result<(), PolicyError>

Source§

fn revoke_token(&self, token_id: &str) -> Result<(), PolicyError>

Source§

fn revoke_generation(&self, below: u64)

Source§

fn check_tool_call(&self, _request: &PolicyRequest) -> PolicyDecision

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.