Documentation ¶
Index ¶
- Variables
- func JMSPropertiesRedaction(properties map[string]string) (map[string]string, error)
- func PathRedaction(path string) (string, error)
- func QueryArgsRedaction(args map[string][]string) (map[string][]string, error)
- func QueryArgsRedactionString(args string) (string, error)
- func RequestHeadersRedaction(headers map[string]string) (map[string]string, error)
- func ResponseHeadersRedaction(headers map[string]string) (map[string]string, error)
- func SetupGlobalRedaction(cfg Config) error
- func URIRedaction(fullURI string) (string, error)
- type Config
- type Filter
- type Path
- type Redactions
- type Sanitize
- type Show
Constants ¶
This section is empty.
Variables ¶
var ( ErrGlobalRedactionCfg = errors.New(1510, "the global redaction config has not been initialized") ErrInvalidRegex = errors.Newf(1511, "could not compile the %s regex value (%v): %v") )
Config errors
Functions ¶
func JMSPropertiesRedaction ¶
JMSPropertiesRedaction - accepts a map of response headers and returns the redacted and sanitize map
func PathRedaction ¶
PathRedaction - returns a string that has only allowed path elements
func QueryArgsRedaction ¶
QueryArgsRedaction - accepts a string for arguments and returns the same string with redacted
func QueryArgsRedactionString ¶
QueryArgsRedactionString - accepts a string for arguments and returns the same string with redacted
func RequestHeadersRedaction ¶
RequestHeadersRedaction - accepts a map of response headers and returns the redacted and sanitize map
func ResponseHeadersRedaction ¶
ResponseHeadersRedaction - accepts a map of response headers and returns the redacted and sanitize map
func SetupGlobalRedaction ¶
SetupGlobalRedaction - set up redactionRegex based on the redactionConfig
func URIRedaction ¶
URIRedaction - takes a uri and returns the redacted version of that URI
Types ¶
type Config ¶
type Config struct { Path Path `config:"path" yaml:"path"` Args Filter `config:"queryArgument" yaml:"queryArgument"` RequestHeaders Filter `config:"requestHeader" yaml:"requestHeader"` ResponseHeaders Filter `config:"responseHeader" yaml:"responseHeader"` MaskingCharacters string `config:"maskingCharacters" yaml:"maskingCharacters"` JMSProperties Filter `config:"jmsProperties" yaml:"jmsProperties"` }
Config - the configuration of all redactions
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig - returns a default reaction config where all things are redacted
func (*Config) SetupRedactions ¶
func (cfg *Config) SetupRedactions() (Redactions, error)
SetupRedactions - set up redactionRegex based on the redactionConfig
type Filter ¶ added in v1.1.58
type Filter struct { Allowed []Show `config:"show" yaml:"show"` Sanitize []Sanitize `config:"sanitize" yaml:"sanitize"` }
filter - the configuration of a filter for each redaction config
type Path ¶ added in v1.1.58
type Path struct {
Allowed []Show `config:"show" yaml:"show"`
}
path - the keyMatches to show, all else are redacted
type Redactions ¶
type Redactions interface { URIRedaction(uri string) (string, error) PathRedaction(path string) string QueryArgsRedaction(queryArgs map[string][]string) (map[string][]string, error) QueryArgsRedactionString(queryArgs string) (string, error) RequestHeadersRedaction(requestHeaders map[string]string) (map[string]string, error) ResponseHeadersRedaction(responseHeaders map[string]string) (map[string]string, error) JMSPropertiesRedaction(jmsProperties map[string]string) (map[string]string, error) }
Redactions - the public methods available for redaction config