Error dumping file: cannot use complex value in dotenv file
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
Short version: I'm unable to use sops exec-env where a value in the JSON file is a list. I didn't see any indication in the documentation that this is a known limitation.
SOPS version
$ sops --version
sops 3.7.3 (latest)
Plaintext JSON
{
"list_of_numbers": [42, 42, 42, 42, 42, 42, 13, 7],
"pi": 3.1416,
"py": "thon",
"pie": "apple",
"poe": ["edgar", "allan"]
}
I created a .sops.yaml so that the file is encrypted using my preferred KMS
SOPS doesn't complain or warn me while encrypting the file
$ sops -e test_data.json > test_data.sops.json ; echo $?
0
exec-file works
$ sops exec-file test_data.sops.json './sops_test_exec.py {}'
{'pi': 3.1416,
'pie': 'apple',
'poe': ['edgar', 'allan'],
'py': 'thon',
'list_of_numbers': [42, 42, 42, 42, 42, 42, 13, 7]}
exec-env does not work
$ sops exec-env test_data.sops.json './sops_test_exec.py {}'
Error dumping file: cannot use complex value in dotenv file: [%!s(float64=42) %!s(float64=42) %!s(float64=42) %!s(float64=42) %!s(float64=42) %!s(float64=42) %!s(float64=13) %!s(float64=7)]
sops_test_exec.py and sops_test_env.py are just trivial demo programs that load the decrypted secret values from the {} file or from the environment.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sops exec-env and exec-file commands, comparing their handling of the provided test_data.sops.json example. Use sops_test_exec.py and sops_test_env.py to reproduce the difference; done should mean either list values work through exec-env or the limitation is explicitly documented and covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100