Add case to compactValueStr not to expose sensitive vals in diagnostics

This commit is contained in:
Pam Selle 2020-09-04 13:18:30 -04:00
parent 3e8b125e53
commit 61c78fd3b9
1 changed files with 4 additions and 0 deletions

View File

@ -302,6 +302,10 @@ func compactValueStr(val cty.Value) string {
// helpful but concise messages in diagnostics. It is not comprehensive // helpful but concise messages in diagnostics. It is not comprehensive
// nor intended to be used for other purposes. // nor intended to be used for other purposes.
if val.ContainsMarked() {
return "(sensitive value)"
}
ty := val.Type() ty := val.Type()
switch { switch {
case val.IsNull(): case val.IsNull():