Trait authzen_core::DecisionMaker
source · pub trait DecisionMaker<Subject, Action, Object, Input, Context, TransactionId>where
Event<Subject, Action, Object, Input, Context>: Send + Sync,
Action: ?Sized,
Object: ?Sized,{
type Ok: Debug + Send;
type Error: Debug + Send;
// Required method
fn can_act<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: Subject,
input: &'life1 Input,
context: Context,
transaction_id: Option<TransactionId>
) -> Pin<Box<dyn Future<Output = Result<Self::Ok, Self::Error>> + Send + 'async_trait>>
where Subject: 'async_trait,
Action: 'async_trait,
Object: 'async_trait,
Input: 'async_trait,
Context: 'async_trait,
TransactionId: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Represents a policy decision point (could be astracted over an in-process memory, a remote api,
etc.) which is capable of making authorization decisions using the provided Event.
Required Associated Types§
Required Methods§
fn can_act<'life0, 'life1, 'async_trait>( &'life0 self, subject: Subject, input: &'life1 Input, context: Context, transaction_id: Option<TransactionId> ) -> Pin<Box<dyn Future<Output = Result<Self::Ok, Self::Error>> + Send + 'async_trait>>where Subject: 'async_trait, Action: 'async_trait, Object: 'async_trait, Input: 'async_trait, Context: 'async_trait, TransactionId: 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Implementations on Foreign Types§
source§impl<'impl0, Subject, Action, Object, Input, Context, TransactionId, T> DecisionMaker<Subject, Action, Object, Input, Context, TransactionId> for &'impl0 Twhere
Event<Subject, Action, Object, Input, Context>: Send + Sync,
Subject: Send + Serialize,
Action: ?Sized + ActionType + Sync,
Object: ?Sized + ObjectType + Sync,
Input: Serialize + Sync,
Context: Send + Serialize,
TransactionId: Send,
T: ?Sized + DecisionMaker<Subject, Action, Object, Input, Context, TransactionId> + Send + Sync,
impl<'impl0, Subject, Action, Object, Input, Context, TransactionId, T> DecisionMaker<Subject, Action, Object, Input, Context, TransactionId> for &'impl0 Twhere Event<Subject, Action, Object, Input, Context>: Send + Sync, Subject: Send + Serialize, Action: ?Sized + ActionType + Sync, Object: ?Sized + ObjectType + Sync, Input: Serialize + Sync, Context: Send + Serialize, TransactionId: Send, T: ?Sized + DecisionMaker<Subject, Action, Object, Input, Context, TransactionId> + Send + Sync,
type Ok = <T as DecisionMaker<Subject, Action, Object, Input, Context, TransactionId>>::Ok
type Error = <T as DecisionMaker<Subject, Action, Object, Input, Context, TransactionId>>::Error
fn can_act<'life0, 'life1, 'async_trait>( &'life0 self, subject: Subject, input: &'life1 Input, context: Context, transaction_id: Option<TransactionId> ) -> Pin<Box<dyn Future<Output = Result<Self::Ok, Self::Error>> + Send + 'async_trait>>where Subject: 'async_trait, Action: 'async_trait, Object: 'async_trait, Input: 'async_trait, Context: 'async_trait, TransactionId: 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
source§impl<Subject, Action, Object, Input, Context, TransactionId> DecisionMaker<Subject, Action, Object, Input, Context, TransactionId> for OPAClientwhere
Event<Subject, Action, Object, Input, Context>: Send + Sync,
Subject: Debug + Send + Serialize + Sync,
Action: ?Sized + ActionType + Send + Sync,
Object: ?Sized + ObjectType + Send + Sync,
Input: Debug + Serialize + Send + Sync,
Context: Debug + Send + Serialize + Sync,
TransactionId: Debug + Send + Serialize + Sync,
Available on crate feature opa-decision-maker only.
impl<Subject, Action, Object, Input, Context, TransactionId> DecisionMaker<Subject, Action, Object, Input, Context, TransactionId> for OPAClientwhere Event<Subject, Action, Object, Input, Context>: Send + Sync, Subject: Debug + Send + Serialize + Sync, Action: ?Sized + ActionType + Send + Sync, Object: ?Sized + ObjectType + Send + Sync, Input: Debug + Serialize + Send + Sync, Context: Debug + Send + Serialize + Sync, TransactionId: Debug + Send + Serialize + Sync,
Available on crate feature
opa-decision-maker only.