Merge pull request #17738 from alewando/conflicts_with_leaking_sensitive_data

Remove attribute value from ConflictsWith validation message (leaks sensitive data)
This commit is contained in:
Paul Tyng 2018-03-30 11:14:56 -04:00 committed by GitHub
commit 3837d0792a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -1270,9 +1270,9 @@ func (m schemaMap) validateConflictingAttributes(
}
for _, conflicting_key := range schema.ConflictsWith {
if value, ok := c.Get(conflicting_key); ok {
if _, ok := c.Get(conflicting_key); ok {
return fmt.Errorf(
"%q: conflicts with %s (%#v)", k, conflicting_key, value)
"%q: conflicts with %s", k, conflicting_key)
}
}

View File

@ -4790,7 +4790,7 @@ func TestSchemaMap_Validate(t *testing.T) {
Err: true,
Errors: []error{
fmt.Errorf("\"blacklist\": conflicts with whitelist (\"white-val\")"),
fmt.Errorf("\"blacklist\": conflicts with whitelist"),
},
},
@ -4834,7 +4834,7 @@ func TestSchemaMap_Validate(t *testing.T) {
Err: true,
Errors: []error{
fmt.Errorf(`"optional_att": conflicts with required_att ("required-val")`),
fmt.Errorf(`"optional_att": conflicts with required_att`),
},
},
@ -4861,8 +4861,8 @@ func TestSchemaMap_Validate(t *testing.T) {
Err: true,
Errors: []error{
fmt.Errorf(`"foo_att": conflicts with bar_att ("bar-val")`),
fmt.Errorf(`"bar_att": conflicts with foo_att ("foo-val")`),
fmt.Errorf(`"foo_att": conflicts with bar_att`),
fmt.Errorf(`"bar_att": conflicts with foo_att`),
},
},