mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-04 11:15:39 +00:00
security: redact IAM and target debug secrets (#3306)
This commit is contained in:
@@ -44,6 +44,16 @@ pub(crate) use crate::runtime::tls::fingerprint::TargetTlsGeneration;
|
||||
pub(crate) use crate::runtime::tls::fingerprint::TargetTlsState;
|
||||
pub(crate) use crate::runtime::tls::fingerprint::build_target_tls_fingerprint;
|
||||
|
||||
pub(crate) const REDACTED_SECRET: &str = "***redacted***";
|
||||
|
||||
pub(crate) fn redacted_secret(value: &str) -> &'static str {
|
||||
if value.is_empty() { "" } else { REDACTED_SECRET }
|
||||
}
|
||||
|
||||
pub(crate) fn redacted_optional_secret(value: Option<&str>) -> &'static str {
|
||||
value.filter(|secret| !secret.is_empty()).map_or("", |_| REDACTED_SECRET)
|
||||
}
|
||||
|
||||
/// A read-only snapshot of delivery counters for a target.
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||
pub struct TargetDeliverySnapshot {
|
||||
|
||||
Reference in New Issue
Block a user