feat: harden community production foundation through story 1.5

This commit is contained in:
2026-08-14 00:21:59 +03:00
parent c30461cc92
commit f6fc2e5c9b
161 changed files with 16758 additions and 2515 deletions
+42
View File
@@ -0,0 +1,42 @@
use std::fmt;
#[derive(Clone, Eq, PartialEq)]
pub struct SecretString(String);
impl SecretString {
pub(crate) fn new(value: String) -> Self {
Self(value)
}
/// Deliberate composition boundary. Never use in diagnostics or fingerprints.
pub fn expose_secret(&self) -> &str {
&self.0
}
pub fn is_configured(&self) -> bool {
!self.0.is_empty()
}
}
impl fmt::Debug for SecretString {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter
.debug_tuple("SecretString")
.field(&if self.is_configured() {
"configured"
} else {
"unconfigured"
})
.finish()
}
}
impl fmt::Display for SecretString {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str(if self.is_configured() {
"configured"
} else {
"unconfigured"
})
}
}