pub struct JwtManager { /* private fields */ }Implementations§
Source§impl JwtManager
impl JwtManager
pub fn new( config: JwtConfig, private_key: &str, public_key: &str, ) -> Result<Self>
pub async fn create_token(&self, claims: &Claims) -> Result<String>
pub async fn verify_token(&self, token: &str) -> Result<Claims>
pub async fn rotate_keys( &self, new_private_key: &str, new_public_key: &str, ) -> Result<()>
pub async fn get_jwks(&self) -> Result<JwkSet>
pub fn create_claims( &self, user_id: Uuid, email: String, roles: Vec<String>, permissions: Vec<String>, session_id: Uuid, scopes: Vec<String>, device_id: Option<String>, ) -> Claims
Auto Trait Implementations§
impl Freeze for JwtManager
impl !RefUnwindSafe for JwtManager
impl Send for JwtManager
impl Sync for JwtManager
impl Unpin 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