Extension is not respected when extracting a subtree
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
The documentation talks about how the extension is used to determine the input format; however, this does not seem to be true for the output format, at least for the 'extract subtree' feature. The following command:
sops -d --output .secrets/synapse-inlined-secrets.yaml --extract '["synapse"]["inlined_secrets"]' secrets.json
... will result in JSON being output into .secrets/synapse-inlined-secrets.yaml, instead of YAML - specifically, the tab indentation makes it invalid as YAML. It feels like this should probably be outputting YAML automatically?
(Note that the subtree in this case is an object of values rather than a single value; this is necessary for the target configuration format.)
Version: sops 3.7.3
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 by reproducing the reported sops -d --output ... --extract command from the issue, then trace the --extract output-format handling. Done means an object subtree written to a .yaml output is emitted as valid YAML rather than JSON with tab indentation.
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
- 45/100