Documentation
¶
Overview ¶
Package sanitize cleans text before it leaves the console: error messages for a client or the audit log (known secrets in every encoded form, then the product's registered patterns), and any text printed for the human (control and bidi characters escaped, so that client-supplied text cannot drive or spoof the terminal).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var URLUserinfo = regexp.MustCompile(`\b[A-Za-z][A-Za-z0-9+.-]*://([^\s/?#@]+@)`)
URLUserinfo matches the userinfo of a URL ("user:password@" in "amqps://user:password@host"); registered, it drops it. It is not a default: products whose errors carry such URLs register it.
Functions ¶
Types ¶
type Sanitizer ¶
type Sanitizer struct {
// contains filtered or unexported fields
}
Sanitizer scrubs error text. The zero value is not usable: call New.
Click to show internal directories.
Click to hide internal directories.