pub struct ScopeBasedAuthorizer { /* private fields */ }Available on non-WebAssembly only.
Expand description
Simple scope-based tool authorizer.
Implementations§
Source§impl ScopeBasedAuthorizer
impl ScopeBasedAuthorizer
Sourcepub fn require_scopes<S, I>(
self,
tool_name: impl Into<String>,
scopes: I,
) -> Self
pub fn require_scopes<S, I>( self, tool_name: impl Into<String>, scopes: I, ) -> Self
Add required scopes for a tool.
Sourcepub fn default_scopes(self, scopes: Vec<String>) -> Self
pub fn default_scopes(self, scopes: Vec<String>) -> Self
Set default required scopes for all tools.
Trait Implementations§
Source§impl Clone for ScopeBasedAuthorizer
impl Clone for ScopeBasedAuthorizer
Source§fn clone(&self) -> ScopeBasedAuthorizer
fn clone(&self) -> ScopeBasedAuthorizer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScopeBasedAuthorizer
impl Debug for ScopeBasedAuthorizer
Source§impl Default for ScopeBasedAuthorizer
impl Default for ScopeBasedAuthorizer
Source§impl ToolAuthorizer for ScopeBasedAuthorizer
impl ToolAuthorizer for ScopeBasedAuthorizer
Source§fn can_access_tool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
auth: &'life1 AuthContext,
tool_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn can_access_tool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
auth: &'life1 AuthContext,
tool_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Check if the authenticated context can access a specific tool.
Auto Trait Implementations§
impl Freeze for ScopeBasedAuthorizer
impl RefUnwindSafe for ScopeBasedAuthorizer
impl Send for ScopeBasedAuthorizer
impl Sync for ScopeBasedAuthorizer
impl Unpin for ScopeBasedAuthorizer
impl UnwindSafe for ScopeBasedAuthorizer
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