From bf1d322fe222184d87db9f087602f35f03d6ec62 Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Sat, 27 Jul 2024 05:18:40 +0300
Subject: [PATCH] chore: Use a specific date-time instead of the current one in
schema examples that use it
This is to avoid disclosing server uptime
Signed-off-by: Awiteb
---
crates/oxidetalis/src/schemas/user.rs | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/crates/oxidetalis/src/schemas/user.rs b/crates/oxidetalis/src/schemas/user.rs
index 237c201..0dad035 100644
--- a/crates/oxidetalis/src/schemas/user.rs
+++ b/crates/oxidetalis/src/schemas/user.rs
@@ -18,7 +18,7 @@
use std::str::FromStr;
-use chrono::{DateTime, Utc};
+use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, Utc};
use oxidetalis_core::types::PublicKey;
use oxidetalis_entities::prelude::*;
use salvo::oapi::ToSchema;
@@ -46,7 +46,11 @@ impl Default for WhiteListedUser {
fn default() -> Self {
WhiteListedUser::new(
PublicKey::from_str("bYhbrm61ov8GLZfskUYbsCLJTfaacMsuTBYgBABEH9dy").expect("is valid"),
- Utc::now(),
+ chrono::NaiveDateTime::new(
+ NaiveDate::from_ymd_opt(2015, 5, 16).expect("Is valid date"),
+ NaiveTime::from_hms_opt(12, 17, 20).expect("Is valid time"),
+ )
+ .and_utc(),
)
}
}
@@ -64,7 +68,11 @@ impl Default for BlackListedUser {
fn default() -> Self {
BlackListedUser::new(
PublicKey::from_str("bYhbrm61ov8GLZfskUYbsCLJTfaacMsuTBYgBABEH9dy").expect("is valid"),
- Utc::now(),
+ NaiveDateTime::new(
+ NaiveDate::from_ymd_opt(2015, 5, 16).expect("Is valid date"),
+ NaiveTime::from_hms_opt(12, 17, 20).expect("Is valid time"),
+ )
+ .and_utc(),
)
}
}