redact

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MASKED = "[MASKED]"

Functions

func ProtectPhrase

func ProtectPhrase(phrase string)

ProtectPhrase will cause the provided phrase to be redacted (also base64 encoded values)

func Redact

func Redact(input string) string

Redact redacts all protected phrases in the input string (replace with ***)

Types

type FileProxyWriter

type FileProxyWriter struct {
	// contains filtered or unexported fields
}

func NewProtectedWriter

func NewProtectedWriter(file *os.File, writer io.Writer, mutex *sync.Mutex, redactor *Redactor) *FileProxyWriter

NewProtectedWriter proxies all output to stdout/stderr to omit/remove any kind of credentials from all logs

func (*FileProxyWriter) Write

func (w *FileProxyWriter) Write(p []byte) (int, error)

type Redactor

type Redactor struct {
	// contains filtered or unexported fields
}

func NewRedactor

func NewRedactor(phrases []string) *Redactor

func (*Redactor) ProtectPhrase

func (r *Redactor) ProtectPhrase(phrase string)

func (*Redactor) ProtectedPhraseCount

func (r *Redactor) ProtectedPhraseCount() int

func (*Redactor) Redact

func (r *Redactor) Redact(input string) string

func (*Redactor) Reset

func (r *Redactor) Reset()

func (*Redactor) SetMaskValue

func (r *Redactor) SetMaskValue(maskValue string)

Jump to

Keyboard shortcuts

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