auth: serialize exp and iat claims as NumericDate to comply with RFC7519 (#1289)

Add `jti` claim to the JWT to avoid hashing collisions
This commit is contained in:
psentee
2025-09-15 17:24:59 +02:00
committed by GitHub
parent 85ce481e32
commit 4590463cdf
5 changed files with 78 additions and 24 deletions
+4
View File
@@ -4,6 +4,7 @@ use chrono::prelude::*;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
use std::fmt;
use uuid::Uuid;
pub mod access_control;
pub mod opaque;
@@ -208,8 +209,11 @@ pub mod types {
#[derive(Clone, Serialize, Deserialize)]
pub struct JWTClaims {
#[serde(with = "chrono::serde::ts_seconds")]
pub exp: DateTime<Utc>,
#[serde(with = "chrono::serde::ts_seconds")]
pub iat: DateTime<Utc>,
pub jti: Uuid,
pub user: String,
pub groups: HashSet<String>,
}