opentofu/internal/encryption
Christian Mesh 0abfd52e3e Terrible hacks to get some sort of wasm working
cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" .
GOOS=js GOARCH=wasm go build -ldflags="-X 'main.experimentsAllowed=yes'" -o main.wasm ./cmd/tofu/

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2026-04-30 14:57:01 -04:00
..
compliancetest Allow key_provider blocks to reference with raw references other key_provider blocks in JSON format (#3794) 2026-03-17 16:06:09 +02:00
config Improve encryption internals and fix a few bugs therein (#2551) 2025-03-06 12:51:09 -05:00
enctest tofu: EvalContext expression evaluation takes context.Context (#2937) 2025-06-19 10:46:31 +01:00
keyprovider go.mod: Bump google deps (#3984) 2026-04-02 14:40:43 -04:00
method Key provider decoding moved from gohcl to hcl/v2 (#3654) 2026-01-15 17:51:16 +02:00
registry Key provider decoding moved from gohcl to hcl/v2 (#3654) 2026-01-15 17:51:16 +02:00
base.go tofu: EvalContext expression evaluation takes context.Context (#2937) 2025-06-19 10:46:31 +01:00
default_registry.go Terrible hacks to get some sort of wasm working 2026-04-30 14:57:01 -04:00
dual_custody_test.go Allow key_provider blocks to reference with raw references other key_provider blocks in JSON format (#3794) 2026-03-17 16:06:09 +02:00
encryption.go tofu: EvalContext expression evaluation takes context.Context (#2937) 2025-06-19 10:46:31 +01:00
example_test.go tofu: EvalContext expression evaluation takes context.Context (#2937) 2025-06-19 10:46:31 +01:00
keyprovider.go Allow key_provider blocks to reference with raw references other key_provider blocks in JSON format (#3794) 2026-03-17 16:06:09 +02:00
keyprovider_meta_change_test.go tofu: EvalContext expression evaluation takes context.Context (#2937) 2025-06-19 10:46:31 +01:00
methods.go Key provider decoding moved from gohcl to hcl/v2 (#3654) 2026-01-15 17:51:16 +02:00
plan.go tofu: EvalContext expression evaluation takes context.Context (#2937) 2025-06-19 10:46:31 +01:00
README.md Documentation updates for 1.7.0-alpha1 (state encryption) (#1396) 2024-03-14 15:05:05 +01:00
state.go tofu: EvalContext expression evaluation takes context.Context (#2937) 2025-06-19 10:46:31 +01:00
targets.go fix: Improve validation for encryption method identifiers (#3048) 2025-07-21 14:38:02 +01:00
targets_test.go Support const variables in static eval (#3946) 2026-04-02 07:39:54 -04:00

OpenTofu State and Plan encryption

Warning

This file is not an end-user documentation, it is intended for developers. Please follow the user documentation on the OpenTofu website unless you want to work on the encryption code.

This folder contains the code for state and plan encryption. For a quick example on how to use this package, please take a look at the example_test.go file.

Structure

The current folder contains the top level API. It requires a registry for holding the available key providers and encryption methods, which is located in the registry folder. The key providers are located in the keyprovider folder, while the encryption methods are located in the method folder. You can also find the configuration struct and its related functions in the config folder.

Further reading

For a detailed design document on state encryption, please read this document.