remora/crates/remora-target/tests/redaction.rs

19 lines
561 B
Rust
Raw Permalink Normal View History

use remora_target::TargetStoreConfig;
#[test]
fn target_store_config_debug_redacts_secret() {
let config = TargetStoreConfig::new_exclusive(
"garage",
"http://garage:3900",
"remora-lane-001",
"garage",
"synthetic-access-key",
"synthetic-secret-key-must-not-leak",
"",
)
.expect("config");
let debug = format!("{config:?}");
assert!(!debug.contains("synthetic-secret-key-must-not-leak"));
assert!(debug.contains("REDACTED"));
assert!(debug.contains("synthetic-access-key"));
}