Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedactJSON ¶
RedactJSON replaces JSON values whose paths exactly match sensitivePaths keys with the JSON string ****. Arrays reuse the parent's path segment so structs under an array resolve the same dotted paths encoding/json emits (no index in the path).
On unmarshal marshal failure returns nil so callers omit the logged body entirely.
func SensitiveFields ¶
SensitiveFields collects dot-separated JSON field paths declared with sensitive:"true" on structs reachable from root type typ. Root may be a pointer (e.g. *MyRequest); non-struct roots return nil.
Embedding without a JSON key name preserves the same path prefix so promoted fields align with encoding/json flattened output.
Types ¶
This section is empty.