redact

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 EachURL

func EachURL(urls []string) []string

EachURL applies URL to each of urls, returning nil for nil.

func List

func List(list string) string

List applies URL to each URL of a comma-separated list, the form nats.Connect takes several servers in.

func URL

func URL(raw string) string

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.

func URLs

func URLs(urls []string, sep string) string

URLs applies URL to each of urls and joins the results with sep.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL