Repository navigation
Add exec-env, exec-file, and decrypt --extract verbs - #11
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add exec-env, exec-file, and decrypt --extract verbs
Summary
Adds three CLI verbs that close the runtime and scripting gaps against the SOPS
binary. No library or on-disk format changes. The SOPS format is untouched.
Changes
COMMAND through /bin/sh with those pairs appended to the current environment.
Supports dotenv, YAML, and JSON with a flat scalar map. YAML and JSON output is
sorted by key. Dotenv preserves file order.
directory, substitutes the first "{}" in COMMAND with the quoted path (appends
when absent), runs it, and removes the directory on exit. The --filename flag
overrides the temp file name.
decrypt and prints the selected node. Scalars print raw. Maps and slices
re-encode in the file format. Incompatible with --in-place.
Exit codes
Both exec verbs propagate the child process exit code. A new exitError type
carries the code up to main, which exits with it and suppresses the usage banner.
The exec commands set SilenceUsage and SilenceErrors so main is the single error
renderer.
Testing
non-scalar and unsupported-format error paths), "{}" substitution, temp-file
naming, exit-code propagation, extract path parsing, and extract traversal
across YAML and JSON.
environment, exec-file substitutes the decrypted path, decrypt --extract
returns scalars, array elements, and re-encoded subtrees, and a missing key
exits non-zero.
Docs
cmd/README.md documents all three verbs with flags, examples, and security
models.