redact

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package redact masks key-like tokens in any text that may flow into a JSON envelope or error message. It is the single canonical sanitizer.

The goal is NOT bulletproof secret scrubbing — it is defense-in-depth on surfaces that should never contain a key. Callers should still avoid building error strings out of raw response bodies; this is the last line of defense.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaskKeyLike

func MaskKeyLike(b []byte) []byte

MaskKeyLike replaces every key-like substring in b with a canonical placeholder. b is consumed read-only; a fresh slice is returned. nil/empty input returns the input unchanged.

func MaskKeyLikeString

func MaskKeyLikeString(s string) string

MaskKeyLikeString is the string analogue of MaskKeyLike — convenience for callers that already hold a string (e.g. error messages).

Types

This section is empty.

Jump to

Keyboard shortcuts

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