Documentation
¶
Overview ¶
Package redact removes credentials from URLs before they are placed in errors or logs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func URL ¶
URL returns a string representation of u that is safe to log:
- any userinfo component is dropped entirely;
- any query parameter whose name matches isSensitiveQueryKey has its value replaced with the literal "***";
- the fragment is dropped because it may contain credentials;
- the path, scheme, host, port, and non-sensitive query values are preserved so operators can still identify the endpoint.
The original *url.URL is not mutated.
func URLError ¶
URLError returns a copy of the *url.Error in err's chain with its URL and any nested *url.Error values redacted. The copies keep Op and the underlying causes, so errors.Is and errors.As still reach them. Pass errors returned directly by net/http or net/url: wrapping around the outer *url.Error is not preserved. Errors without a *url.Error are returned unchanged.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.