pub struct AuthorizationService<S>{ /* private fields */ }Expand description
Authorization Service
Handles permission checking based on IAM policies.
Implementations§
Source§impl<S> AuthorizationService<S>
impl<S> AuthorizationService<S>
Authorize an action on a resource
This is the main authorization method. It checks if the caller (from the context) is allowed to perform the specified action on the target resource.
§Arguments
context- The authenticated context (contains caller info)action- The action to perform (e.g., “iam:GetUser”)resource_arn- The target resource ARN
§Returns
true if the action is allowed, false otherwise
§Errors
Returns an error if there’s a problem accessing the store or evaluating policies.
Sourcepub async fn check_or_deny(
&self,
context: &WamiContext,
action: &str,
resource_arn: &WamiArn,
) -> Result<()>
pub async fn check_or_deny( &self, context: &WamiContext, action: &str, resource_arn: &WamiArn, ) -> Result<()>
Check if access is denied (returns an error if not authorized)
Convenience wrapper over AuthorizationService::authorize for callers
that only need to proceed or stop. The refusal names what decided, so a
caller gets a usable message without handling Decision itself.
Trait Implementations§
Source§impl<S> Authorizer for AuthorizationService<S>
impl<S> Authorizer for AuthorizationService<S>
Source§fn check_or_deny<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 WamiContext,
action: &'life2 str,
resource_arn: &'life3 WamiArn,
) -> 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 check_or_deny<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 WamiContext,
action: &'life2 str,
resource_arn: &'life3 WamiArn,
) -> 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,
Auto Trait Implementations§
impl<S> !RefUnwindSafe for AuthorizationService<S>
impl<S> !UnwindSafe for AuthorizationService<S>
impl<S> Freeze for AuthorizationService<S>
impl<S> Send for AuthorizationService<S>
impl<S> Sync for AuthorizationService<S>
impl<S> Unpin for AuthorizationService<S>
impl<S> UnsafeUnpin for AuthorizationService<S>
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
Mutably borrows from an owned value. Read more