mirror of
https://github.com/lldap/lldap.git
synced 2026-07-25 17:58:44 +00:00
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:
@@ -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>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user