pub struct AuthTokenTracker { /* private fields */ }
Expand description
Utility for managing auth tokens.
Implementations§
Source§impl AuthTokenTracker
impl AuthTokenTracker
Sourcepub fn register_token(&self, token: Arc<str>)
pub fn register_token(&self, token: Arc<str>)
Register a token as valid.
Sourcepub fn check_is_token_valid(
&self,
config: &Config,
token: Option<Arc<str>>,
) -> bool
pub fn check_is_token_valid( &self, config: &Config, token: Option<Arc<str>>, ) -> bool
Check that a token is valid. If so, mark it as recently used so it doesn’t time out. The “token” parameter should be direct from the http header i.e. with the “Barer” include, like “Bearer base64”. This should be called with None as the token if no Authenticate header was specified.
Trait Implementations§
Source§impl Clone for AuthTokenTracker
impl Clone for AuthTokenTracker
Source§fn clone(&self) -> AuthTokenTracker
fn clone(&self) -> AuthTokenTracker
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 Default for AuthTokenTracker
impl Default for AuthTokenTracker
Source§fn default() -> AuthTokenTracker
fn default() -> AuthTokenTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuthTokenTracker
impl RefUnwindSafe for AuthTokenTracker
impl Send for AuthTokenTracker
impl Sync for AuthTokenTracker
impl Unpin for AuthTokenTracker
impl UnwindSafe for AuthTokenTracker
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