Documentation
¶
Overview ¶
Package redact strips credentials from broker URLs before they reach a log line, an error message, a terminal or a network advertisement.
url.URL.Redacted is not enough for that: it masks a password but leaves a user name in place, and nats.go reads a user name with no password as an authentication token, so nats://t0ken@host comes out of it unchanged.
It imports only the standard library, so the server, the worker and every command can use it.
Index ¶
Constants ¶
const Placeholder = "REDACTED-URL"
Placeholder stands in for a URL that cannot be parsed, which could hold anything.
Variables ¶
This section is empty.
Functions ¶
func List ¶
List applies URL to each URL of a comma-separated list, the form nats.Connect takes several servers in.
func URL ¶
URL returns raw with its user information, a user and password or a bare token, replaced by REDACTED. A URL that does not parse, or that holds an @ outside its user information, is replaced whole by Placeholder. An empty raw stays empty.
Types ¶
This section is empty.