Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyObfuscator ¶
type BodyObfuscator struct {
// contains filtered or unexported fields
}
BodyObfuscator can be used to obfuscate properties in JSON bodies.
func DefaultBodyObfuscator ¶
func DefaultBodyObfuscator() BodyObfuscator
DefaultBodyObfuscator returns a default body obfuscator. This will be equivalent to calling NewBodyObfuscator with an empty rule map.
func NewBodyObfuscator ¶
func NewBodyObfuscator(customRules map[string]Rule) BodyObfuscator
NewBodyObfuscator returns a body obfuscator. This will contain some pre-defined obfuscation rules, as well as any provided custom rules.
func (BodyObfuscator) ObfuscateBody ¶
func (o BodyObfuscator) ObfuscateBody(body string) (string, error)
ObfuscateBody obfuscates the given body as necessary
type Capable ¶
type Capable interface { // SetBodyObfuscator sets the body obfuscator to use. SetBodyObfuscator(bodyObfuscator BodyObfuscator) // SetHeaderObfuscator sets the header obfuscator to use. SetHeaderObfuscator(headerObfuscator HeaderObfuscator) }
Capable indicates support for obfuscating bodies and headers.
type HeaderObfuscator ¶
type HeaderObfuscator struct {
// contains filtered or unexported fields
}
HeaderObfuscator can be used to obfuscate headers.
func DefaultHeaderObfuscator ¶
func DefaultHeaderObfuscator() HeaderObfuscator
DefaultHeaderObfuscator returns a default header obfuscator. This will be equivalent to calling NewHeaderObfuscator with an empty rule map.
func NewHeaderObfuscator ¶
func NewHeaderObfuscator(customRules map[string]Rule) HeaderObfuscator
NewHeaderObfuscator returns a header obfuscator. This will contain some pre-defined obfuscation rules, as well as any provided custom rules.
func (HeaderObfuscator) ObfuscateHeader ¶
func (o HeaderObfuscator) ObfuscateHeader(name, value string) string
ObfuscateHeader obfuscates the value for the given header as necessary.
type Rule ¶
Rule defines how a single value is obfuscated. This can be as simple as returning a fixed mask, or as complex as necessary.
func FixedLength ¶
FixedLength returns an obfuscation rule that will replace values with a fixed length string containing only *.
func KeepingEndCount ¶
KeepingEndCount returns an obfuscation rule that will keep a fixed number of characters at the end, then replaces all other characters with *.
func KeepingStartCount ¶
KeepingStartCount returns an obfuscation rule that will keep a fixed number of characters at the start, then replaces all other characters with *.