masker

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// MaskedOut the text that is returned if text is masked out
	// we don't use the length of the actual secret value to avoid giving folks a hint what the value is
	MaskedOut = "****"
)

Variables

View Source
var (
	// ShowMaskedPasswords lets you enable in test programs
	ShowMaskedPasswords = false
)

Functions

This section is empty.

Types

type Client

type Client struct {
	ReplaceWords map[string]string
	LogFn        func(string)
}

Client replaces words in a log from a set of secrets

func NewMasker

func NewMasker(kubeClient kubernetes.Interface, namespaces ...string) (*Client, error)

NewMasker creates a new Client loading secrets from the given namespace

func (*Client) GetReplacedWords

func (m *Client) GetReplacedWords() []string

GetReplacedWords returns all the words that will be replaced

func (*Client) LoadSecret

func (m *Client) LoadSecret(secret *corev1.Secret) error

LoadSecret loads the secret data into the log masker

func (*Client) LoadSecrets

func (m *Client) LoadSecrets(kubeClient kubernetes.Interface, ns string) error

LoadSecrets loads the secrets into the log masker

func (*Client) Mask

func (m *Client) Mask(text string) string

Mask returns the text with all of the secrets masked out

func (*Client) MaskData

func (m *Client) MaskData(logData []byte) []byte

MaskData masks the given data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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