Documentation
¶
Overview ¶
Package secretmask masks known secret values in text before it is written to a log, audit row or stored build output.
Index ¶
Constants ¶
const ( // Marker replaces a known secret. Marker = "[redacted]" // MinLength skips short values: masking "true" or "1234" would shred ordinary text. MinLength = 8 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LineCarry ¶
type LineCarry struct {
// contains filtered or unexported fields
}
LineCarry masks a sequence of log lines while catching a secret that spans a line break. It holds back raw trailing lines covering the last n-1 bytes, n being the longest multi-line secret (nothing is held without one), so the caller must Flush after a short idle interval and at stream end.
func NewLineCarry ¶
func NewLineCarry() *LineCarry
NewLineCarry masks with the process-wide registry.
func NewLineCarryFor ¶
NewLineCarryFor masks with reg.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds secret values and rewrites text that contains them.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer masks a byte stream. It holds back the last maxLen-1 bytes of each write so a secret split across two writes is still seen whole.
func NewWriterFor ¶
NewWriterFor masks with reg.