Documentation
¶
Overview ¶
Package redact masks credentials in text that leaves the process. It is a stdlib-only leaf so that config, which may import nothing internal, masks what it renders for a page with the same rule shell uses for an error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command masks the credentials a URL in command carries, for any copy of a command that leaves the process as text: an error, a log line, a run event, a page. A source: is routinely rendered into a command as https://user:token@host, and errors are persisted and shown in the browser. The command that is EXECUTED is never redacted.
Types ¶
type Scrubber ¶ added in v0.3.0
type Scrubber struct {
// contains filtered or unexported fields
}
Scrubber holds back a tail that is the start of a value, so a value split across two writes is still whole when it is masked.
type Secrets ¶ added in v0.3.0
type Secrets struct {
// contains filtered or unexported fields
}
Secrets is one run's resolved values, growing as the run resolves more; a nil *Secrets scrubs nothing.
func SecretsFrom ¶ added in v0.3.0
SecretsFrom is the run's values, nil when the run resolves none.
func (*Secrets) Add ¶ added in v0.3.0
Add keeps each line of a multi-line value as its own entry because a PEM key is usually printed a line at a time.
func (*Secrets) Empty ¶ added in v0.3.0
Empty is whether there is nothing to mask, so a caller can skip copying through a scrubber.
func (*Secrets) Error ¶ added in v0.3.0
Error masks err's text and keeps its chain, so errors.Is and errors.As still classify it; nil and an error with nothing to mask pass through.