claw-crypto-interface 0.3.0

Types and traits for the claw-crypto crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::jwt::{JwtClaims, JwtClaimsOptions, JwtResult};
use mockall::automock;
use serde::{de::DeserializeOwned, Serialize};

#[automock]
pub trait JwtService<C>
where
    C: Serialize + DeserializeOwned,
{
    fn encode(&self, claims: &C, options: &JwtClaimsOptions) -> JwtResult<String>;

    fn decode(&self, token: &str) -> JwtResult<JwtClaims<C>>;
}