Trait ockam_abac::PoliciesRepository
source · pub trait PoliciesRepository: Send + Sync + 'static {
// Required methods
fn get_policy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action
) -> Pin<Box<dyn Future<Output = Result<Option<Policy>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn set_policy<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action,
c: &'life3 Policy
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn delete_policy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_policies_by_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
r: &'life1 Resource
) -> Pin<Box<dyn Future<Output = Result<Vec<(Action, Policy)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
This repository stores policies. A policy is an expression which can be evaluated against an environment (a list of attribute names and values) in order to determine if a given action can be performed on a given resource.
Required Methods§
sourcefn get_policy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action
) -> Pin<Box<dyn Future<Output = Result<Option<Policy>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_policy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action
) -> Pin<Box<dyn Future<Output = Result<Option<Policy>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Return the policy associated to a given resource and action
sourcefn set_policy<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action,
c: &'life3 Policy
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_policy<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action,
c: &'life3 Policy
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set a policy for a given resource and action
sourcefn delete_policy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_policy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
r: &'life1 Resource,
a: &'life2 Action
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete the policy associated to a given resource and action
sourcefn get_policies_by_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
r: &'life1 Resource
) -> Pin<Box<dyn Future<Output = Result<Vec<(Action, Policy)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_policies_by_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
r: &'life1 Resource
) -> Pin<Box<dyn Future<Output = Result<Vec<(Action, Policy)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the list of all the policies associated to a given resource