redact

package
v0.0.0-...-6b8ee43 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package redact scrubs credential-bearing tokens from strings before they are logged. It owns the canonical bcrypt-shape regex (config.IsBcryptHash delegates here) so the pattern has a single home, and it is a leaf package (no ze imports) so any tier may use it.

Index

Constants

View Source
const Placeholder = "<redacted>"

Placeholder replaces a redacted credential token in a log-safe string.

Variables

This section is empty.

Functions

func Command

func Command(cmd string) string

Command returns a copy of a command line safe to log: every bcrypt-shaped token is replaced with Placeholder, and the value token immediately following a password-family key is replaced with Placeholder even when it is a non-bcrypt plaintext secret. A command with no credential token is returned unchanged (whitespace preserved). Redaction runs on the full command; callers truncate the result AFTER, so a secret straddling a truncation boundary can never half-leak.

func IsBcryptHash

func IsBcryptHash(s string) bool

IsBcryptHash reports whether s is a syntactically valid bcrypt hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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