From fc083a854780b46b69c8e55cc8c4a73ea25f632b Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Wed, 19 Oct 2022 09:28:59 +0200 Subject: [PATCH] Remove url, uri, host, broker, id from redaction (#4869) --- cmd/helper.go | 4 ++-- cmd/root_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/helper.go b/cmd/helper.go index 863475ab8..39dfda3b9 100644 --- a/cmd/helper.go +++ b/cmd/helper.go @@ -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, "|"))). diff --git a/cmd/root_test.go b/cmd/root_test.go index adf28764e..b17dafe7e 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -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 `