pub struct CommonAccessToken { /* private fields */ }Expand description
Common Access Token
Implementations§
Source§impl CommonAccessToken
impl CommonAccessToken
Sourcepub fn mac(
&mut self,
key: &[u8],
kid: &str,
_alg: &str,
no_cwt_tag: bool,
) -> Result<(), Error>
pub fn mac( &mut self, key: &[u8], kid: &str, _alg: &str, no_cwt_tag: bool, ) -> Result<(), Error>
Create a MAC for the token
Sourcepub fn parse(
&mut self,
token: &[u8],
key: &[u8],
kid: &str,
expect_cwt_tag: bool,
) -> Result<(), Error>
pub fn parse( &mut self, token: &[u8], key: &[u8], kid: &str, expect_cwt_tag: bool, ) -> Result<(), Error>
Parse a token
Sourcepub fn is_acceptable(&self, opts: &CatValidationOptions) -> Result<bool, Error>
pub fn is_acceptable(&self, opts: &CatValidationOptions) -> Result<bool, Error>
Check if the token is acceptable according to the validation options
Sourcepub fn get_claims(&self) -> HashMap<String, Value>
pub fn get_claims(&self) -> HashMap<String, Value>
Get the claims as a JSON-like map
Trait Implementations§
Source§impl Clone for CommonAccessToken
impl Clone for CommonAccessToken
Source§fn clone(&self) -> CommonAccessToken
fn clone(&self) -> CommonAccessToken
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for CommonAccessToken
impl RefUnwindSafe for CommonAccessToken
impl Send for CommonAccessToken
impl Sync for CommonAccessToken
impl Unpin for CommonAccessToken
impl UnwindSafe for CommonAccessToken
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