Remove url, uri, host, broker, id from redaction (#4869)
This commit is contained in:
parent
c4a5e35294
commit
fc083a8547
2 changed files with 4 additions and 4 deletions
|
|
@ -50,11 +50,11 @@ func unwrap(err error) (res []string) {
|
|||
// redact redacts a configuration string
|
||||
func redact(src string) string {
|
||||
secrets := []string{
|
||||
"url", "uri", "host", "broker", "mac", // infrastructure
|
||||
"mac", // infrastructure
|
||||
"sponsortoken", "plant", // global settings
|
||||
"user", "password", "pin", // users
|
||||
"token", "access", "refresh", // tokens
|
||||
"ain", "id", "secret", "serial", "deviceid", "machineid", // devices
|
||||
"ain", "secret", "serial", "deviceid", "machineid", // devices
|
||||
"vin"} // vehicles
|
||||
return regexp.
|
||||
MustCompile(fmt.Sprintf(`\b(%s)\b.*?:.*`, strings.Join(secrets, "|"))).
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ func TestRedact(t *testing.T) {
|
|||
token:
|
||||
access: geheim
|
||||
refresh: geheim
|
||||
host: geheim
|
||||
url: geheim
|
||||
pin: geheim
|
||||
mac: geheim
|
||||
secret: geheim # comment
|
||||
secret : geheim
|
||||
`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue