pub struct JwtManager { /* private fields */ }Expand description
HS256 JWT issuer and verifier with explicit key rotation.
Implementations§
Source§impl JwtManager
impl JwtManager
Sourcepub fn new(active: JwtKey, config: JwtConfig) -> Result<Self, JwtError>
pub fn new(active: JwtKey, config: JwtConfig) -> Result<Self, JwtError>
Create a manager with one active signing and verification key.
§Errors
Returns an error when TTL is zero or configured issuer/audience is empty.
Sourcepub fn with_verification_key(self, key: JwtKey) -> Self
pub fn with_verification_key(self, key: JwtKey) -> Self
Add an old or future verification key without changing the signing key.
Sourcepub const fn access_token_ttl(&self) -> Duration
pub const fn access_token_ttl(&self) -> Duration
Lifetime of newly issued access tokens.
Trait Implementations§
Source§impl Clone for JwtManager
impl Clone for JwtManager
Auto Trait Implementations§
impl Freeze for JwtManager
impl RefUnwindSafe for JwtManager
impl Send for JwtManager
impl Sync for JwtManager
impl Unpin for JwtManager
impl UnsafeUnpin for JwtManager
impl UnwindSafe for JwtManager
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