Merge pull request #2593 from weaveworks/elide-url-passwords

Elide token-only credentials in cli arguments
This commit is contained in:
Roland Schilter
2017-06-13 18:21:11 +02:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ var (
}
colonFinder = regexp.MustCompile(`[^\\](:)`)
unescapeBackslashes = regexp.MustCompile(`\\(.)`)
elideURLCredentials = regexp.MustCompile(`//.+:.+@`)
elideURLCredentials = regexp.MustCompile(`//.+@`)
)
type prefixFormatter struct {

View File

@@ -36,6 +36,7 @@ func TestLogCensoredArgs(t *testing.T) {
"-probe.kubernetes.token=secret",
"http://secret:secret@frontend.dev.weave.works:80",
"https://secret:secret@cloud.weave.works:443",
"https://secret@cloud.weave.works",
}
flag.CommandLine.Parse(args)