Skip to main content

redact_token_fields

Function redact_token_fields 

Source
pub fn redact_token_fields(s: &str) -> String
Expand description

Strip token-shaped substrings from any string destined for an error message.

Prevents OAuth token values from leaking into CliError messages when unexpected fields appear in malformed responses. Scans for JSON key-value pairs where the key is a known token field name and replaces the value with [REDACTED].