pub struct OptionalAuthProvider<P: AuthProvider> { /* private fields */ }Available on non-WebAssembly only.
Expand description
Optional authentication provider that makes auth optional.
Implementations§
Source§impl<P: AuthProvider> OptionalAuthProvider<P>
impl<P: AuthProvider> OptionalAuthProvider<P>
Trait Implementations§
Source§impl<P: AuthProvider> AuthProvider for OptionalAuthProvider<P>
impl<P: AuthProvider> AuthProvider for OptionalAuthProvider<P>
Source§fn validate_request<'life0, 'life1, 'async_trait>(
&'life0 self,
authorization_header: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthContext>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_request<'life0, 'life1, 'async_trait>(
&'life0 self,
authorization_header: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthContext>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate an incoming request and extract authentication context. Read more
Source§fn auth_scheme(&self) -> &'static str
fn auth_scheme(&self) -> &'static str
Get the authentication scheme this provider uses (e.g., “Bearer”, “Basic”).
Source§fn is_required(&self) -> bool
fn is_required(&self) -> bool
Check if this provider requires authentication for all requests.
Auto Trait Implementations§
impl<P> Freeze for OptionalAuthProvider<P>where
P: Freeze,
impl<P> RefUnwindSafe for OptionalAuthProvider<P>where
P: RefUnwindSafe,
impl<P> Send for OptionalAuthProvider<P>
impl<P> Sync for OptionalAuthProvider<P>
impl<P> Unpin for OptionalAuthProvider<P>where
P: Unpin,
impl<P> UnsafeUnpin for OptionalAuthProvider<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for OptionalAuthProvider<P>where
P: UnwindSafe,
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