Documentation
¶
Overview ¶
Package redact provides best-effort stripping of sensitive values from JSON config payloads served by unauthenticated diagnostic endpoints. The canonical defense is to keep inline secrets out of config entirely (use *_file paths instead); this layer is defense-in-depth.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SecretHeaders = map[string]bool{ "authorization": true, "proxy-authorization": true, "cookie": true, "set-cookie": true, "x-api-key": true, "api-key": true, "x-goog-api-key": true, }
SecretHeaders are the request and response headers that carry credentials. They never reach a script, and they are removed from a request before the session archive captures it: a credential has no business in a log, on the timeline or on disk. Keys are lower-case.
Functions ¶
func CredentialName ¶
CredentialName reports whether name, split at "-" and "_" with case ignored, has one of credentialWords. It covers every name in SecretHeaders.
func JSON ¶
func JSON(raw json.RawMessage) json.RawMessage
JSON redacts values whose keys match sensitive patterns in a json.RawMessage. Non-object inputs are returned unchanged.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package content finds secrets in content: the text of request and response bodies, SSE streams, and the text fields of session events (#1921).
|
Package content finds secrets in content: the text of request and response bodies, SSE streams, and the text fields of session events (#1921). |