Add option to export a portion of secrets #65
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.
This pull request adds a flag to ejson2env that enables exporting only a portion of the secrets as environment variables.
The partial export functionality is described in the ejson readme but I didn't find an obvious way to achieve it with the current state of the ejson2env CLI except for post-processing the CLI output which to me seems quite brittle.
If this change is merged, a consumer of ejson2env can request a subset of secrets to be exported as such:
A concrete use-case which I have for the partial export functionality is that I have one shared secrets file which I use to inject values into Github Action workflows. However, some steps of the workflow require only access to some of the subsets of the secret values. Per the principle of least privilege, I want to only expose the secret values which each step requires, as opposed to exposing all the secret values to all the steps.