redact

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 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 masks credential-shaped values in text. Its matching follows Python's re semantics, so every caller redacts exactly what the earlier Python tooling did.

Index

Constants

View Source
const (
	Space = `\x{09}-\x{0d}\x{1c}-\x{20}\x{85}\x{a0}\x{1680}\x{2000}-\x{200a}\x{2028}\x{2029}\x{202f}\x{205f}\x{3000}`
	Word  = `\pL\pN_`
)

Python's \s and \w are Unicode-aware; RE2's are ASCII. These classes are Python's sets, so a pattern matches exactly where the Python one did.

View Source
const Redacted = "[REDACTED-SECRET]"

Redacted replaces every credential-shaped value.

Variables

This section is empty.

Functions

func FoldI

func FoldI(s string) string

FoldI makes (?i) match i as Python does, which also folds İ and ı.

func Redact

func Redact(text string) string

Redact masks credential-shaped values: provider tokens, private keys, password-like assignments and passwords in URLs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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