pub struct JwtService { /* private fields */ }Expand description
Service JWT : signature et vérification des tokens (enregistrable en DI).
Implementations§
Source§impl JwtService
impl JwtService
pub fn new(config: &SecurityConfig) -> Result<Self, SecurityError>
Sourcepub fn register_provider(
container: &Container,
config: SecurityConfig,
) -> Result<(), SecurityError>
pub fn register_provider( container: &Container, config: SecurityConfig, ) -> Result<(), SecurityError>
Enregistre le service comme singleton (pattern #[service] / module).
Sourcepub fn register_dev_provider(container: &Container)
pub fn register_dev_provider(container: &Container)
Enregistrement pratique pour le développement (SecurityConfig::dev()).
pub fn sign_subject( &self, sub: impl Into<String>, roles: Vec<String>, ) -> Result<String, SecurityError>
pub fn sign(&self, claims: &RuestClaims) -> Result<String, SecurityError>
pub fn verify(&self, token: &str) -> Result<RuestClaims, SecurityError>
Trait Implementations§
Source§impl Clone for JwtService
impl Clone for JwtService
Source§fn clone(&self) -> JwtService
fn clone(&self) -> JwtService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 JwtService
impl RefUnwindSafe for JwtService
impl Send for JwtService
impl Sync for JwtService
impl Unpin for JwtService
impl UnsafeUnpin for JwtService
impl UnwindSafe for JwtService
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