Documentation
¶
Overview ¶
Package mask hides secret values in everything Probe prints or writes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Masker ¶
type Masker struct {
// contains filtered or unexported fields
}
Masker hides secret values in everything Probe prints or writes. It starts with the secrets the workflow declares and learns the values of credential headers as actions are about to send them, so that a token obtained at run time is hidden too. A nil Masker hides only credential headers in the maps passed to Map, and learns nothing.
func New ¶
New builds a Masker for the environment variables named in secrets. Each value is replaced by <secret:NAME>. A name that is not set, or set to an empty string, has nothing to hide and is skipped.
func (*Masker) Learn ¶
Learn registers the values of credential headers found anywhere in data, so that they are hidden from then on. It is called with an action's parameters before the action runs, which is what keeps them out of the action's own log records.
func (*Masker) Map ¶
Map returns a copy of a request or response with secret values hidden in every string, and the values of credential headers replaced outright. The original is left untouched, since tests and outputs still need the real values. A nil map stays nil.