SOPS cannot handle multi-line .env files
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
The parser that SOPS uses seems to have a different interpretation of what constitutes a dotenv file from what how bash views is. This relates in particular to encrypting/decrypt dotenvs that have multiline environement variables.
However, SOPS is not able to handle encrypting this file. Calling sops -e --pgp xxxxxxxx my-vars.env will produce the following error:
Error unmarshalling file: invalid dotenv input line: some values
The parser is trying to interpret the second line of BAR (which is "some values") as another key-value pair, which does not work.
This is a pretty major inconsistency.
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
Reproduce the issue with a dotenv file containing a multiline BAR value, then run sops -e --pgp xxxxxxxx my-vars.env and inspect the dotenv parser reached by that command. Done means SOPS can encrypt and decrypt dotenv files with multiline environment variables without reporting an invalid dotenv input line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, devops, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100