Redact names ending in token or _secret, code_verifier, authorization and cookies #6
Loading…
Reference in a new issue
No description provided.
Delete branch "redact-oauth-keys"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes a masking gap in
Redactacross C, Go, Rust, C# and JS: AHT-204.Added (two shapes, after the existing NAME=value one, in all five implementations):
tokenor_secret(refresh_token,access_token,id_token,session_token,bearer_token,accessToken,X-Auth-Token,other_secret...),code_verifierandauthorization, askey=value,key: value, JSON"key": "value", single-quoted dict fields (Python, JS), and URL/form parameters. An Authorization scheme (Bearer,token,Basic) is kept before the mask. A value of digits alone ("page_token": 2,next_token=0) stays, and the value stops at, ; }so JSON numbers are judged correctly.Cookie/Set-Cookievalues: every cookie in the value, to the end of the line or the closing quote.Unchanged: every existing shape and case.
tokens=3,max_tokens,input_tokens,token_type,token_count,tokenizer,cookie_jar,cookies,client_secret_expires_atand prose about tokens are kept (cases intestdata/redact.json).Not exempted:
null/true/falseafter a token name are masked as***(RE2 has no lookahead to exempt them; only digit-only values stay). Names ending insecretwith no separator (sharedSecret), other than the existingsecretandclientSecret, are not matched, per the_secretrule.The C matchers
m_keyandm_cookieemulate the Go patterns' leftmost-first match;ci-checkpassed all 8 jobs (Go, Rust, C, C#, JS).🤖 Generated with Claude Code