Documentation
¶
Overview ¶
Package redact provides log redaction functionality to prevent secret leakage in CI logs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultMode = func() Mode { if isCI() { return ModeBasic } return ModeOff }()
DefaultMode is the default redaction mode when running in CI. It's "basic" when CI is detected, "off" otherwise.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Mode Mode // Redaction mode: off, basic, aggressive
CustomKeys string // Comma-separated list of custom key patterns (e.g., "MY_API_KEY,SECRET_TOKEN")
Replacement string // Replacement string (default: "***REDACTED***")
}
Config holds configuration for a Redactor.
type Redactor ¶
type Redactor struct {
// contains filtered or unexported fields
}
Redactor handles log redaction.
func RedactFromEnv ¶
func RedactFromEnv() *Redactor
RedactFromEnv creates a Redactor from environment variables. Uses HOLON_LOG_REDACT for mode and HOLON_LOG_REDACT_KEYS for custom keys.
func (*Redactor) RedactFile ¶
RedactFile reads a file, redacts sensitive content, and writes it back.
Click to show internal directories.
Click to hide internal directories.