redact

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 4 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 removes likely secrets from strings and JSON-shaped values before they are written to disk or sent over the wire. Redaction MUST run before every write, including error logs.

Index

Constants

View Source
const Placeholder = "[REDACTED]"

Placeholder is what every matched secret is replaced with.

Variables

This section is empty.

Functions

func Bytes

func Bytes(b []byte) []byte

Bytes is a convenience wrapper around String for []byte data.

func IsSensitivePath

func IsSensitivePath(p string) bool

IsSensitivePath reports whether p matches any of the credential-bearing path patterns.

func String

func String(s string) string

String redacts secrets in s.

func Value

func Value(v any) any

Value walks an arbitrary JSON-decoded value (map[string]any, []any, string, numbers, etc.) and redacts any string leaves. Map keys whose lowercased names look secret-bearing are redacted entirely.

Types

This section is empty.

Jump to

Keyboard shortcuts

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