Documentation
¶
Overview ¶
Package redact removes secrets from log attributes via a key denylist, value-pattern detection, and an explicit Secret marker type.
Index ¶
Constants ¶
const DefaultReplacement = "***"
DefaultReplacement is the string substituted for redacted values.
Variables ¶
This section is empty.
Functions ¶
func DefaultAllowKeys ¶
func DefaultAllowKeys() []string
DefaultAllowKeys returns the built-in trusted correlation key names whose values bypass pattern/entropy scanning. The denylist still wins.
Types ¶
type Option ¶
type Option func(*Redactor)
Option configures a Redactor.
func WithDenyKeys ¶
WithDenyKeys replaces the default deny set with the given keys. If combined with WithExtraDenyKeys, list WithDenyKeys first; it replaces the entire set.
func WithExtraAllowKeys ¶
WithExtraAllowKeys adds keys to the allow set, bypassing value-pattern scanning. The denylist still takes precedence: a key in both deny and allow is redacted.
func WithExtraDenyKeys ¶
WithExtraDenyKeys adds keys to the existing deny set. Apply after WithDenyKeys, which would otherwise discard these additions.
func WithReplacement ¶
WithReplacement sets the substitute string for redacted values.
Source Files
¶
- redactor.go
- secret.go