pub struct JwtApi<'a, A> { /* private fields */ }Expand description
Signs, verifies and rotates without HTTP.
Implementations§
Source§impl<A: AuthInstance> JwtApi<'_, A>
impl<A: AuthInstance> JwtApi<'_, A>
Sourcepub fn headers(self, headers: &HeaderMap) -> Self
pub fn headers(self, headers: &HeaderMap) -> Self
Acts for the session in these request headers (for token).
Sourcepub async fn token(&self) -> Result<String, AuthError>
pub async fn token(&self) -> Result<String, AuthError>
The session’s token, as /token answers it. Needs headers with
a session; UNAUTHORIZED without one.
Sourcepub async fn sign(
&self,
claims: Map<String, Value>,
) -> Result<String, AuthError>
pub async fn sign( &self, claims: Map<String, Value>, ) -> Result<String, AuthError>
Signs any claims with the current key. exp, iss and aud are added unless set.
Trait Implementations§
Auto Trait Implementations§
impl<'a, A> Forget for JwtApi<'a, A>
impl<'a, A> Freeze for JwtApi<'a, A>
impl<'a, A> Move for JwtApi<'a, A>
impl<'a, A> RefUnwindSafe for JwtApi<'a, A>where
&'a A: RefUnwindSafe,
impl<'a, A> Send for JwtApi<'a, A>
impl<'a, A> Sync for JwtApi<'a, A>
impl<'a, A> Unpin for JwtApi<'a, A>
impl<'a, A> UnsafeUnpin for JwtApi<'a, A>where
&'a A: UnsafeUnpin,
impl<'a, A> UnwindSafe for JwtApi<'a, A>where
&'a A: 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