extended_data.primitives.redaction¶
Tier 1 redaction helpers for diagnostics and JSON-like data.
Module Contents¶
Functions¶
Return a redacted placeholder while preserving matching quotes. |
|
Return a redacted key/value field while preserving JSON shape. |
|
Yield scalar known-sensitive values from nested caller context. |
|
Return common variants where any slash positions are URL encoded. |
|
Redact explicitly provided values and URL-encoded variants. |
|
Redact common secret fields in terminal-oriented text. |
|
Recursively redact common secret fields in JSON-like data. |
Data¶
API¶
- extended_data.primitives.redaction.SENSITIVE_KEY_PATTERN = 'api[_-]?key|access[_-]?token|refresh[_-]?token|id[_-]?token|token|secret|password|passwd|pwd|authori...'¶
- extended_data.primitives.redaction.SENSITIVE_KEY_RE = 'compile(...)'¶
- extended_data.primitives.redaction.JSON_SECRET_RE = 'compile(...)'¶
- extended_data.primitives.redaction.KEY_VALUE_SECRET_RE = 'compile(...)'¶
- extended_data.primitives.redaction.CLI_SECRET_RE = 'compile(...)'¶
- extended_data.primitives.redaction.BEARER_SECRET_RE = 'compile(...)'¶
- extended_data.primitives.redaction.REDACTED = '[REDACTED]'¶
- extended_data.primitives.redaction._redacted_value(value: str) str¶
Return a redacted placeholder while preserving matching quotes.
- extended_data.primitives.redaction._redacted_field(match: re.Match[str]) str¶
Return a redacted key/value field while preserving JSON shape.
- extended_data.primitives.redaction._iter_known_values(values: collections.abc.Iterable[Any]) collections.abc.Iterable[Any]¶
Yield scalar known-sensitive values from nested caller context.
- extended_data.primitives.redaction._slash_encoding_variants(value: str) set[str]¶
Return common variants where any slash positions are URL encoded.
- extended_data.primitives.redaction._redact_known_values(text: str, values: collections.abc.Iterable[Any] | None) str¶
Redact explicitly provided values and URL-encoded variants.