Expand description
Free-form secret redaction for log lines, telemetry events, and diagnostic surfaces.
See docs/development/specs/2026-04-23-rtb-redact-v0.1.md for the
full design and the seven-pass rule set.
use rtb_redact::string;
let scrubbed = string("connect to postgres://app:hunter2@db/mydb");
assert!(scrubbed.contains("[redacted]"));
assert!(!scrubbed.contains("hunter2"));Statics§
- SENSITIVE_
HEADERS - Header names whose values must be redacted at DEBUG / TRACE log
levels. Case-insensitive match via
is_sensitive_header.phf::Setkeeps lookup O(1) as the list grows.
Functions§
- is_
sensitive_ header - Case-insensitive membership check against
SENSITIVE_HEADERS. - redact_
header_ value - Unconditionally redact a header value. Callers invoke this for
any header name matching
is_sensitive_header. - string
- Redact secrets in
input, returning a borrowedCowwhen no redactions apply and an ownedStringotherwise. - string_
into - Same as
string, but writes into a caller-suppliedString. Useful for hot loops that want to reuse a buffer.