redact

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 3 Imported by: ? 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 masks secrets before they reach a terminal, a log or a telemetry backend. allbctl output is routinely pasted into issues and shared screens, so anything credential-shaped is hidden by default.

Index

Constants

View Source
const Mask = "********"

Mask is what a hidden value is replaced with.

Variables

This section is empty.

Functions

func AWSAccountIDs added in v0.1.0

func AWSAccountIDs(value string) string

AWSAccountIDs masks every AWS account ID (a run of exactly twelve digits) in value. Profile names generated by AWS SSO embed the account ID, as do ARNs and many SDK error messages.

func EnvValue

func EnvValue(key, value string) string

EnvValue returns value in a form safe to display for the given key: fully masked for secret-looking keys, and with any embedded URL password masked otherwise (e.g. DATABASE_URL=postgres://user:pass@host/db).

func IsSecretKey

func IsSecretKey(key string) bool

IsSecretKey reports whether a key name looks like it holds a credential.

func URLPassword

func URLPassword(value string) string

URLPassword masks the password of a URL that embeds credentials. Values that are not URLs, or carry no password, are returned unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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