Wrap app tokens and password of User in secret type

This commit is contained in:
Lennart
2025-04-16 16:30:45 +02:00
parent 9bff8c228d
commit ed84fb894f
4 changed files with 21 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
use derive_more::{AsRef, From};
use serde::{Deserialize, Serialize};
/// Wrapper type to prevent secrets from accidentally getting leaked into traces
#[derive(From, Clone, Deserialize, Serialize, AsRef)]
pub struct Secret<T>(pub T);
impl<T> std::fmt::Debug for Secret<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("Secret")
}
}