Documentation
¶
Overview ¶
Package redact provides the process-wide canonical secret redactor.
Index ¶
Constants ¶
const Marker = "[REDACTED]"
Marker is the canonical replacement for secret material in public text.
Variables ¶
This section is empty.
Functions ¶
func ClaimTokens ¶
ClaimTokens removes raw task-claim bearer tokens without applying other redaction rules.
func ContainsRawClaimToken ¶
ContainsRawClaimToken reports whether value contains a concrete task-claim bearer token.
func Enabled ¶
func Enabled() bool
Enabled reports the process-snapshotted additive heuristic setting.
func IsSensitiveKey ¶
IsSensitiveKey reports whether a field name belongs to the shared secret taxonomy.
func RegisterDynamicSecret ¶
func RegisterDynamicSecret(value string) func()
RegisterDynamicSecret includes runtime-resolved material in subsequent redaction calls. The returned cleanup is idempotent and removes one registration reference.
func SnapshotEnabled ¶
func SnapshotEnabled(enabled bool)
SnapshotEnabled freezes the process-wide additive heuristic setting. Later calls cannot change it; configuration changes therefore require a restart.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine applies exact protections and optional conservative heuristics.
func (*Engine) RedactJSON ¶
func (e *Engine) RedactJSON(raw json.RawMessage, fields []string) json.RawMessage
RedactJSON applies exact protection throughout a JSON document and additive heuristics only within the named free-text fields.
func (*Engine) RedactLogAttrs ¶
RedactLogAttrs applies field-aware redaction while preserving correlation, numeric, boolean, duration, time, and other structured envelope values.
func (*Engine) RedactString ¶
RedactString removes secret material from free text.