Merge pull request #1150 from prometheus/kerckhoff-principle

config: Don't hide username, it's not secret.
This commit is contained in:
Fabian Reinartz 2015-10-08 16:50:34 +02:00
commit 9cba38c6da
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ var (
patJobName = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_-]*$`)
patFileSDName = regexp.MustCompile(`^[^*]*(\*[^/]*)?\.(json|yml|yaml|JSON|YML|YAML)$`)
patRulePath = regexp.MustCompile(`^[^*]*(\*[^/]*)?$`)
patAuthLine = regexp.MustCompile(`((?:username|password|bearer_token|secret_key):\s+)(".+"|'.+'|[^\s]+)`)
patAuthLine = regexp.MustCompile(`((?:password|bearer_token|secret_key):\s+)(".+"|'.+'|[^\s]+)`)
)
// Load parses the YAML input s into a Config.

View File

@ -282,7 +282,7 @@ func TestLoadConfig(t *testing.T) {
// String method must not reveal authentication credentials.
s := c.String()
if strings.Contains(s, "admin_name") || strings.Contains(s, "admin_password") {
if strings.Contains(s, "admin_password") {
t.Fatalf("config's String method reveals authentication credentials.")
}
}