secrets

package
v0.57.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

README

Secret values for tests were generated using ecies cli.

Here is the example invocation:

echo "hello world" | \
./ecies encrypt --keystore=$(find testdata/keystore -type f) --passphrase="helloworld" -o hex

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptSecrets

func DecryptSecrets(ctx *hcl.EvalContext, body hcl.Body) (hcl.Body, hcl.Diagnostics)

DecryptSecrets decrypts secrets in the given HCL body. Example:

ethereum {
  key "default" {
    address = "0x123...abc"
	   keystore_path = "/path/to/keystore"
	   passphrase_file = "/path/to/passwords"
  }
}

secrets {
  foo = {
	  "0x123...abc" = "0x234..bcd"
	  "0x1a3...abc" = "0x2a4..bcd"
	  "0x1b3...abc" = "0x2b4..bcd"
  }
}

decrypted = secrets.foo

In this example decrypted will be equal to the decrypted value of "0x234...bcd"

NOTE: To use in test scripts, there is an env variable XXX_SECRETS_SKIP_DECRYPT which allow to skip decryption and just check that secret is set set. If XXX_SECRETS_SKIP_DECRYPT is set to true, then actual decryption step will be skipped and secret value will be replaced with just "<encrypted>".

NOTE: if there is no secret value for configured ethereum public key, then secrets.foo will return a hcl.Diagnostics that value is not set.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL