redaction

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSensitiveKeys = map[string]struct{}{
	"token":         {},
	"passkey":       {},
	"password":      {},
	"auth":          {},
	"cookie":        {},
	"csrf":          {},
	"email":         {},
	"username":      {},
	"user":          {},
	"key":           {},
	"info_hash":     {},
	"anticsrftoken": {},
	"torrent_pass":  {},
	"popcron":       {},
}

Functions

func RedactPrivateInfo

func RedactPrivateInfo(data any, sensitiveKeys map[string]struct{}) any

RedactPrivateInfo recursively redacts sensitive values in JSON-like data.

func RedactValue

func RedactValue(value string, sensitiveKeys map[string]struct{}) string

RedactValue redacts sensitive content in a string.

Types

type Block

type Block struct {
	Start int
	End   int
}

func ExtractJSONBlocks

func ExtractJSONBlocks(text string) []Block

ExtractJSONBlocks returns candidate JSON substrings based on bracket counting.

Jump to

Keyboard shortcuts

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