Skip to main content

Module redaction

Module redaction 

Source
Expand description

Credential redaction compatible with the DataExcept wire contract.

The helpers in this module preserve operational context such as URL scheme, host, port, and optionally path while removing credentials from userinfo, sensitive query parameters, sensitive fragment parameters, and free-form text containing URLs.

Constants§

MIN_REMOVABLE_SECRET_LENGTH
Minimum secret length for safe substring replacement in free-form text.
PLACEHOLDER
Visible marker used in place of credentials.

Functions§

fingerprint
Returns a short, one-way SHA-256 fingerprint.
redact_if_url
Redacts a value only when it contains a URL scheme delimiter.
redact_secret
Replaces an optional secret with a placeholder and fingerprint.
redact_url
Strips credentials from a URL while preserving useful routing information.
redact_urls_in_text
Redacts every URL found in free-form text.
remove_secret
Removes a known secret from free-form text.