pub struct AuthState { /* private fields */ }Expand description
Authentication state that holds configured providers
Implementations§
Source§impl AuthState
impl AuthState
Sourcepub fn required(self, required: bool) -> Self
pub fn required(self, required: bool) -> Self
Set whether authentication is required (returns 401 if not authenticated)
Sourcepub fn with_issuer_mapping(
self,
mapping: HashMap<String, AuthProviderType>,
) -> Self
pub fn with_issuer_mapping( self, mapping: HashMap<String, AuthProviderType>, ) -> Self
Set issuer-to-provider mapping for routing based on JWT issuer (iss) claim
Sourcepub fn get_provider(&self, index: usize) -> Option<&dyn Authn>
pub fn get_provider(&self, index: usize) -> Option<&dyn Authn>
Get a provider by index (used for authorization checks)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthState
impl !RefUnwindSafe for AuthState
impl Send for AuthState
impl Sync for AuthState
impl Unpin for AuthState
impl !UnwindSafe for AuthState
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