Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcealElements ¶
ConcealElements conceals each element in elems that does not appear in the safe map. A copy of elems containing the changes is returned.
func MapWithPlurals ¶
MapWithPlurls places the toLower value of each string into a map[string]struct{}, along with a copy of the that string as a plural (ex: FoO => foo, foos).
Types ¶
type SafeURL ¶
type SafeURL struct { // the original URL URL string // path elements that do not need to be hidden // keys should be lower-cased SafePathElems map[string]struct{} // query parameters that do not need to be hidden // keys should be lower-cased SafeQueryKeys map[string]struct{} }
SafeURL complies with the clues.Concealer and fmt.Stringer interfaces to produce a safely loggable version of the URL. Path elements that equal a SafePathWords entry will show in plain text. All other path elements will get hashed by clues. Query parameters that match a key in SafeQueryParams will have their values displayed in plain text. All other query parames will get hashed by clues.
func (SafeURL) Conceal ¶
Conceal produces a string of the url with the sensitive info obscured (hashed or replaced).
func (SafeURL) Format ¶
Format ensures the safeURL will output the Conceal() version even when used in a PrintF.