Skip to main content

claw_crypto_interface/jwt/
jwt_service.rs

1use crate::jwt::{JwtClaims, JwtClaimsOptions, JwtResult};
2use mockall::automock;
3use serde::{de::DeserializeOwned, Serialize};
4
5#[automock]
6pub trait JwtService<C>
7where
8    C: Serialize + DeserializeOwned,
9{
10    fn encode(&self, claims: &C, options: &JwtClaimsOptions) -> JwtResult<String>;
11
12    fn decode(&self, token: &str) -> JwtResult<JwtClaims<C>>;
13}