protosanitizer

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 178

Documentation

Overview

Package protosanitizer supports logging of gRPC messages without accidentally revealing sensitive fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripSecrets

func StripSecrets(msg interface{}) fmt.Stringer

StripSecrets returns a wrapper around the original CSI gRPC message which has a Stringer implementation that serializes the message as one-line JSON, but without including secret information. Instead of the secret value(s), the string "***stripped***" is included in the result.

StripSecrets relies on an extension in CSI 1.0 and thus can only be used for messages based on that or a more recent spec!

StripSecrets itself is fast and therefore it is cheap to pass the result to logging functions which may or may not end up serializing the parameter depending on the current log level.

func StripSecretsCSI03 added in v0.2.0

func StripSecretsCSI03(msg interface{}) fmt.Stringer

StripSecretsCSI03 is like StripSecrets, except that it works for messages based on CSI 0.3 and older. It does not work for CSI 1.0, use StripSecrets for that.

Types

This section is empty.

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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