terraform/lang
Martin Atkins 14336ae6f8 lang/funcs: Conversion functions can handle sensitive values
In order to avoid updating every one of our existing functions with
explicit support for sensitive values, there's a default rule in the
functions system which makes the result of a function sensitive if any
of its arguments contain sensitive values.

We were applying that default to the various type conversion functions,
like tomap and tolist, which meant that converting a complex-typed value
with a sensitive value anywhere inside it would result in a
wholly-sensitive result.

That's unnecessarily conservative because the cty conversion layer (which
these functions are wrapping) already knows how to handle sensitivity
in a more precise way. Therefore we can opt in to handling marked values
(which Terraform uses for sensitivity) here and the only special thing
we need to do is handle errors related to sensitive values differently,
so we won't print their values out literally in case of an error (and so
that the attempt to print them out literally won't panic trying to
extract the marked values).
2021-04-19 12:10:50 -07:00
..
blocktoattr add benchmark used for DecoderSpec 2020-10-14 09:19:26 -04:00
funcs lang/funcs: Conversion functions can handle sensitive values 2021-04-19 12:10:50 -07:00
testdata/functions-test lang/funcs: Update fileset() function to include path as separate first argument, automatically trim the path argument from results, and ensure results are always canonical with forward slash path separators 2019-08-30 20:19:44 -04:00
data.go remove GetModuleInstanceOutput 2020-04-14 14:49:10 -04:00
data_test.go eval Data needs to operate on whole modules 2020-04-12 10:50:31 -04:00
doc.go lang: new package for the runtime parts of the config language 2018-10-16 18:44:26 -07:00
eval.go Fix diags non-assignment bugs 2020-11-20 13:37:23 -05:00
eval_test.go allow path and terraform in self-block eval 2020-11-02 14:00:58 -05:00
functions.go lang/funcs: "one" function 2021-04-12 15:32:03 -07:00
functions_test.go lang/funcs: "one" function 2021-04-12 15:32:03 -07:00
references.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
scope.go lang: allow functions to be subject to experiments 2020-11-13 17:25:16 -08:00