Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultSensitiveKeys = map[string]struct{}{
"token": {},
"passkey": {},
"password": {},
"auth": {},
"cookie": {},
"csrf": {},
"email": {},
"username": {},
"user": {},
"key": {},
"info_hash": {},
"anticsrftoken": {},
"torrent_pass": {},
"popcron": {},
}
DefaultSensitiveKeys is the JSON-key set used when a redaction call receives nil keys. Key matching ignores case and common separators and treats a key as sensitive when its normalized form contains a normalized entry.
Functions ¶
func RedactPrivateInfo ¶
RedactPrivateInfo recursively redacts JSON-like maps, slices, and strings without mutating input maps or slices. Nil keys use DefaultSensitiveKeys.
func RedactValue ¶
RedactValue redacts valid embedded JSON plus known secret-bearing URL, path, query, key/value, cookie, authorization, and long-hex patterns. Nil keys use DefaultSensitiveKeys for embedded JSON; textual patterns use the package's fixed secret vocabulary.
Types ¶
type Block ¶
Block identifies a candidate JSON object's or array's half-open byte range within the source string.
func ExtractJSONBlocks ¶
ExtractJSONBlocks returns balanced top-level object and array candidates in source order. Brackets inside quoted strings are ignored, and unterminated candidates are omitted.