Shared PII redaction utilities used by error reporting adapters.
Shared PII redaction utilities used by error reporting adapters.
(apply-redaction context config)Apply PII redaction to a context map that may contain :tags and :extra.
Always applies default PII redaction, even when :redact is omitted.
Apply PII redaction to a context map that may contain :tags and :extra. Always applies default PII redaction, even when :redact is omitted.
(build-redact-state config)Build effective redaction configuration from adapter config.
Config structure (all optional):
{:redact {:keys [:password :authorization ...] :additional-keys [:custom-field] :mask-email? true}}
Build effective redaction configuration from adapter config.
Config structure (all optional):
{:redact {:keys [:password :authorization ...]
:additional-keys [:custom-field]
:mask-email? true}}Default set of keys whose values should be redacted before sending to external systems.
Keys are stored as lower-case strings for case-insensitive matching.
Default set of keys whose values should be redacted before sending to external systems. Keys are stored as lower-case strings for case-insensitive matching.
(email-string? s)Best-effort detection of email-like strings.
Args: s: String to check
Returns: Boolean indicating if string looks like an email
Best-effort detection of email-like strings. Args: s: String to check Returns: Boolean indicating if string looks like an email
(mask-email s)Mask an email address, preserving only the first character of the local part.
For non-email strings, returns [REDACTED].
Mask an email address, preserving only the first character of the local part. For non-email strings, returns [REDACTED].
(normalize-key-name k)Normalize a map key to a lower-case string for matching.
Normalize a map key to a lower-case string for matching.
(redact-pii data state)Recursively redact PII from arbitrarily nested data structures.
Redacts based on key names using the provided redaction state.
Recursively redact PII from arbitrarily nested data structures. Redacts based on key names using the provided redaction state.
(redact-pii-value k v {:keys [keys mask-email?] :as _state})Redact a single value based on its key and redaction state.
Email is treated specially:
Redact a single value based on its key and redaction state. Email is treated specially: - when :mask-email? is true and the value looks like an email, the local part is masked - when :mask-email? is false, email values are left as-is, even if :email is in the default key set
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |