opentofu/configs
Martin Atkins 954d38e870 lang: New file-hashing functions
In prior versions, we recommended using hash functions in conjunction with
the file function as an idiom for detecting changes to upstream blobs
without fetching and comparing the whole blob.

That approach relied on us being able to return raw binary data from
file(...). Since Terraform strings pass through intermediate
representations that are not binary-safe (e.g. the JSON state), there was
a risk of string corruption in prior versions which we have avoided for
0.12 by requiring that file(...) be used only with UTF-8 text files.

The specific case of returning a string and immediately passing it into
another function was not actually subject to that corruption risk, since
the HIL interpreter would just pass the string through verbatim, but this
is still now forbidden as a result of the stricter handling of file(...).

To avoid breaking these use-cases, here we introduce variants of the hash
functions a with "file" prefix that take a filename for a disk file to
hash rather than hashing the given string directly. The configuration
upgrade tool also now includes a rule to detect the documented idiom and
rewrite it into a single function call for one of these new functions.

This does cause a bit of function sprawl, but that seems preferable to
introducing more complex rules for when file(...) can and cannot read
binary files, making the behavior of these various functions easier to
understand in isolation.
2019-01-25 10:18:44 -08:00
..
configload command: "terraform init" can partially initialize for 0.12upgrade 2019-01-14 11:33:21 -08:00
configschema configs/configschema: Block.StaticValidateTraversal method 2018-11-26 08:25:03 -08:00
configupgrade lang: New file-hashing functions 2019-01-25 10:18:44 -08:00
test-fixtures configs: New test cases for invalid interpolations in block labels 2018-12-19 15:54:33 -08:00
backend.go move "configschema" from "config" to "configs" 2018-10-16 18:50:29 -07:00
compat_shim.go configs: Handle object constructor keys when shimming traversals 2018-10-16 18:49:20 -07:00
config_build_test.go configs/configload: package for loading configurations 2018-02-15 15:56:38 -08:00
config_build.go configs: use addrs.Module for module path, rather than []string 2018-10-16 18:46:46 -07:00
config_test.go various: helpers for collecting necessary provider types 2018-10-16 18:50:29 -07:00
config.go various: helpers for collecting necessary provider types 2018-10-16 18:50:29 -07:00
depends_on.go configs: quoted keywords/references are warnings, not errors 2018-02-15 15:56:39 -08:00
doc.go configs: Additional guidance in doc.go 2018-02-15 15:56:39 -08:00
module_call_test.go configs: Reserve various names for future use 2018-11-26 08:25:03 -08:00
module_call.go configs: Reserve various names for future use 2018-11-26 08:25:03 -08:00
module_merge_body.go configs: Export MergeBodies and new SynthBody function 2018-10-16 18:24:47 -07:00
module_merge_test.go configs: allow full type constraints for variables 2018-03-08 16:23:35 -08:00
module_merge.go configs: Re-unify the ManagedResource and DataResource types 2018-10-16 18:44:26 -07:00
module.go configs: Allow looking up resources by resource addresses. 2018-10-16 18:46:46 -07:00
named_values.go configs: Reserve various names for future use 2018-11-26 08:25:03 -08:00
parser_config_dir_test.go configs: record the source directory for modules 2018-10-16 18:46:46 -07:00
parser_config_dir.go configload: Configuration snapshots 2018-10-16 18:50:29 -07:00
parser_config_test.go Fix tests after upgrading hcl 2018-11-26 23:38:37 +00:00
parser_config.go configs: allow full type constraints for variables 2018-03-08 16:23:35 -08:00
parser_test.go configs: Reserve various names for future use 2018-11-26 08:25:03 -08:00
parser_values_test.go configs: update values file invalid syntax test for new HCL behavior 2018-03-08 11:17:39 -08:00
parser_values.go configs: Parser.LoadValuesFile 2018-02-15 15:56:37 -08:00
parser.go command: 0.12upgrade command 2018-10-16 18:50:29 -07:00
provider_test.go configs: Reserve various names for future use 2018-11-26 08:25:03 -08:00
provider.go configs: Reserve various names for future use 2018-11-26 08:25:03 -08:00
provisioner.go configs: Reserve various names for future use 2018-11-26 08:25:03 -08:00
provisioneronfailure_string.go configs: stub out main configuration structs 2018-02-15 15:56:37 -08:00
provisionerwhen_string.go configs: stub out main configuration structs 2018-02-15 15:56:37 -08:00
resource.go configs: Reserve various names for future use 2018-11-26 08:25:03 -08:00
synth_body_test.go configs: Export MergeBodies and new SynthBody function 2018-10-16 18:24:47 -07:00
synth_body.go configs: Export MergeBodies and new SynthBody function 2018-10-16 18:24:47 -07:00
util.go configs: allow overrides files to omit args that primary files can't 2018-02-15 15:56:38 -08:00
variable_type_hint.go configs: stub out main configuration structs 2018-02-15 15:56:37 -08:00
variabletypehint_string.go configs: stub out main configuration structs 2018-02-15 15:56:37 -08:00
version_constraint.go configs: Parser.LoadConfigFile 2018-02-15 15:56:37 -08:00