From 11355bbf4b4569a2562d2a251c310aa9a233421c Mon Sep 17 00:00:00 2001 From: Roland Schilter Date: Tue, 13 Jun 2017 13:14:09 +0200 Subject: [PATCH] Elide token-only credentials in cli arguments Follow-up of #2568 --- prog/main.go | 2 +- prog/main_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/prog/main.go b/prog/main.go index 45857d83f..c1578ad83 100644 --- a/prog/main.go +++ b/prog/main.go @@ -41,7 +41,7 @@ var ( } colonFinder = regexp.MustCompile(`[^\\](:)`) unescapeBackslashes = regexp.MustCompile(`\\(.)`) - elideURLCredentials = regexp.MustCompile(`//.+:.+@`) + elideURLCredentials = regexp.MustCompile(`//.+@`) ) type prefixFormatter struct { diff --git a/prog/main_test.go b/prog/main_test.go index ca238c507..3e1728b9c 100644 --- a/prog/main_test.go +++ b/prog/main_test.go @@ -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)