pub struct StaticBearerValidator { /* private fields */ }Expand description
Simple bearer token validator that checks against a static set of tokens.
For production, implement Validate with:
- JWT verification using a signing key
- OAuth2 token introspection
- OIDC ID token validation
Implementations§
Source§impl StaticBearerValidator
impl StaticBearerValidator
Sourcepub fn new(tokens: impl IntoIterator<Item = String>) -> Self
pub fn new(tokens: impl IntoIterator<Item = String>) -> Self
Create a new validator with a list of valid tokens
Trait Implementations§
Source§impl Clone for StaticBearerValidator
impl Clone for StaticBearerValidator
Source§fn clone(&self) -> StaticBearerValidator
fn clone(&self) -> StaticBearerValidator
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 StaticBearerValidator
impl Debug for StaticBearerValidator
Source§impl Validate for StaticBearerValidator
impl Validate for StaticBearerValidator
Source§async fn validate(&self, token: &str) -> AuthResult
async fn validate(&self, token: &str) -> AuthResult
Validate a credential and return the authentication result.
Auto Trait Implementations§
impl Freeze for StaticBearerValidator
impl RefUnwindSafe for StaticBearerValidator
impl Send for StaticBearerValidator
impl Sync for StaticBearerValidator
impl Unpin for StaticBearerValidator
impl UnwindSafe for StaticBearerValidator
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