terraform/command/views/json/testdata/diagnostic
Martin Atkins 8f233cde4c cli: Diagnostics can include collections with sensitive elements
We previously had a shallow IsMarked call in compactValueStr's caller but
then a more-conservative deep ContainsMarked call inside compactValueStr
with a different resulting message. As well as causing an inconsistency
in messages, this was also a bit confusing because it made it seem like
a non-sensitive collection containing a sensitive element value was wholly
sensitive, making the debug information in the diagnostic messages not
trustworthy for debugging certain varieties of problem.

I originally considered just removing the redundant check in
compactValueStr here, but ultimately I decided to keep it as a sort of
defense in depth in case a future refactoring disconnects these two
checks. This should also serve as a prompt to someone making later changes
to compactValueStr to think about the implications of sensitive values
in there, which otherwise wouldn't be mentioned at all.

Disclosing information about a collection containing sensitive values is
safe here because compactValueStr only discloses information about the
value's type and element keys, and neither of those can be sensitive in
isolation. (Constructing a map with sensitive keys reduces to a sensitive
overall map.)
2021-04-19 11:58:49 -07:00
..
error-with-empty-highlight-range-at-end-of-source-code.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-multi-line-snippet.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-source-code-subject-and-expression-referring-to-a-collection-containing-a-sensitive-value.json cli: Diagnostics can include collections with sensitive elements 2021-04-19 11:58:49 -07:00
error-with-source-code-subject-and-expression-referring-to-sensitive-value.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-source-code-subject-and-known-expression.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-source-code-subject-and-unknown-expression-of-unknown-type.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-source-code-subject-and-unknown-string-expression.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-source-code-subject-but-no-context.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-source-code-subject-with-multiple-expression-values.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-source-code-subject.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
error-with-source-code-unavailable.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00
sourceless-warning.json cli: Add comprehensive JSON diagnostic structure 2021-03-12 13:12:37 -05:00