Documentation
¶
Overview ¶
Package redaction provides an efficient configurable string redactor.
It is intended for internal use by buildkite-agent only.
Index ¶
Constants ¶
const RedactLengthMin = 6
RedactLengthMin is the shortest string length that will be considered a potential secret by the environment redactor. e.g. if the redactor is configured to filter out environment variables matching *_TOKEN, and API_TOKEN is set to "none", this minimum length will prevent the word "none" from being redacted from useful log output.
Variables ¶
This section is empty.
Functions ¶
func GetKeyValuesToRedact ¶
func GetKeyValuesToRedact(logger shell.Logger, patterns []string, environment map[string]string) map[string]string
Given a redaction config string and an environment map, return the list of values to be redacted. Lifted out of Bootstrap.setupRedactors to facilitate testing
Types ¶
type Redactor ¶
type Redactor struct {
// contains filtered or unexported fields
}
func NewRedactor ¶
Construct a new Redactor, and pre-compile the Boyer-Moore skip table
func (*Redactor) Flush ¶
Flush should be called after the final Write. This will Write() anything retained in case of a partial match and reset the output buffer.
type RedactorMux ¶
type RedactorMux []*Redactor
func (RedactorMux) Reset ¶
func (mux RedactorMux) Reset(needles []string)
Reset resets all redactors with new needles (secrets)