use crate::*;
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct JwtConfig {
pub(super) secret: String,
pub(super) expiration_seconds: u64,
pub(super) issuer: String,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct JwtExtraJwtClaims {
pub(super) sub: String,
pub(super) iss: String,
pub(super) exp: usize,
pub(super) iat: usize,
pub(super) nbf: usize,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct JwtToken {
pub(super) token: String,
pub(super) token_type: String,
pub(super) expires_in: u64,
}
#[derive(Clone, Debug)]
pub struct JwtService {
pub(super) config: JwtConfig,
pub(super) encoding_key: EncodingKey,
pub(super) decoding_key: DecodingKey,
pub(super) validation: Validation,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CustomExtraJwtClaims<T: Default> {
#[serde(flatten)]
pub(super) custom: T,
pub(super) sub: String,
pub(super) iss: String,
pub(super) exp: usize,
pub(super) iat: usize,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct ExtraJwtClaims {
pub(super) sub: String,
pub(super) iss: String,
pub(super) exp: usize,
pub(super) iat: usize,
#[serde(flatten)]
pub(super) extra: HashMap<String, Value>,
}