this repo has no description
1use serde::{Deserialize, Serialize};
2
3pub mod token;
4pub mod verify;
5
6pub use token::{create_access_token, create_refresh_token, create_service_token};
7pub use verify::{get_did_from_token, verify_token};
8
9#[derive(Debug, Serialize, Deserialize)]
10pub struct Claims {
11 pub iss: String,
12 pub sub: String,
13 pub aud: String,
14 pub exp: usize,
15 pub iat: usize,
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub scope: Option<String>,
18 #[serde(skip_serializing_if = "Option::is_none")]
19 pub lxm: Option<String>,
20 pub jti: String,
21}
22
23#[derive(Debug, Serialize, Deserialize)]
24pub struct Header {
25 pub alg: String,
26 pub typ: String,
27}
28
29#[derive(Debug, Serialize, Deserialize)]
30pub struct UnsafeClaims {
31 pub iss: String,
32 pub sub: Option<String>,
33}
34
35// fancy boy TokenData equivalent for compatibility/structure
36pub struct TokenData<T> {
37 pub claims: T,
38}