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 ¶
func HoldsCredential ¶ added in v1.18.0
HoldsCredential reports whether the parameter or header named key holds a credential, whole or, as a database URL does, in part. A message about such a value, such as why its template could not be evaluated, must not show what was written there.
func HoldsURL ¶ added in v1.24.0
HoldsURL reports whether the parameter named key holds a URL whose password is a credential, as dsn and url do.
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 and parameters found anywhere in data, and the password in a database URL, 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.