Expand description
Redaction logic for sensitive data in strings, errors, and logs.
This module provides functionality to redact sensitive information from text, including API keys, tokens, passwords, and other secrets. It uses a cached approach for environment variable redaction to avoid repeatedly scanning all environment variables.
§Invariants
- Sensitive environment variable values are cached at first access using a thread-safe
RwLock - The cache is never refreshed during runtime; environment variable changes after first redaction call will not be detected
- All redaction functions are pure (no side effects except cache initialization)
Structs§
- Redacted
Logger - A
log::Logimplementation that wraps another logger and redacts all log messages. - Redacted
String - A wrapper around
Stringthat applies redaction when displayed viaDisplayorDebug.