From 7e8a2460846f1c1ffa4c1e222e5f64cd4521f908 Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:20:01 +0100 Subject: [PATCH] AppToken add creation date --- crates/store/src/auth/toml_user_store.rs | 1 + crates/store/src/auth/user.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/crates/store/src/auth/toml_user_store.rs b/crates/store/src/auth/toml_user_store.rs index a790865..fc0516f 100644 --- a/crates/store/src/auth/toml_user_store.rs +++ b/crates/store/src/auth/toml_user_store.rs @@ -111,6 +111,7 @@ impl AuthenticationProvider for TomlPrincipalStore { principal.app_tokens.push(AppToken { name, token: token_hash, + created_at: Some(chrono::Utc::now()), }); self.save(principals.deref())?; Ok(()) diff --git a/crates/store/src/auth/user.rs b/crates/store/src/auth/user.rs index cde05f2..d53bcb6 100644 --- a/crates/store/src/auth/user.rs +++ b/crates/store/src/auth/user.rs @@ -3,6 +3,7 @@ use actix_web::{ http::{header, StatusCode}, FromRequest, HttpMessage, HttpResponse, ResponseError, }; +use chrono::{DateTime, Utc}; use derive_more::Display; use rustical_xml::ValueSerialize; use serde::{Deserialize, Serialize}; @@ -38,6 +39,7 @@ impl ValueSerialize for PrincipalType { pub struct AppToken { pub name: String, pub token: String, + pub created_at: Option>, } #[derive(Debug, Clone, Deserialize, Serialize)]