redact

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 5 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 is the one redaction policy for everything cchp prints or saves outside an explicit secret destination: debug traces, dry runs, error messages, diagnostics and saved output.

Index

Constants

View Source
const Mask = "[redacted]"

Mask replaces a secret value.

Variables

This section is empty.

Functions

func Header(h http.Header) http.Header

Header returns a copy of h with credential headers masked.

func HeaderMap

func HeaderMap(h http.Header) map[string]string

HeaderMap flattens a header for JSON output with masked credentials.

func IsSecretField

func IsSecretField(name string) bool

IsSecretField reports whether a JSON field name holds a credential.

func JSON

func JSON(data []byte, extra ...string) ([]byte, error)

JSON masks credential fields in a JSON document.

func String

func String(s string) string

String removes CCHP tokens and bearer credentials from free text.

func Value

func Value(v any, extra ...string) any

Value masks credential fields anywhere inside a decoded JSON value. extra names more fields to mask. The input is not modified.

Types

This section is empty.

Jump to

Keyboard shortcuts

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