Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Allow user to specify output format or output in json by default #236

Closed
mpaduchh opened this issue Jul 13, 2021 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@mpaduchh
Copy link

mpaduchh commented Jul 13, 2021

Is your feature request related to a problem? Please describe.
I would like to be able to retrieve all secrets from path formatted as JSON. This is possible with vault-cli and I think also with http request by specifying -format=json.
Right now I am accessing my secrets by doing this path/to/secrets $.$. What I get is space separated list of key:value pairs. Now, the problem is, my secrets can and contain both spaces and colons, so it is impossible to parse.

Describe the solution you'd like
I would like to be able to specify output format like in vault-cli OR I would like the default format to be something that can be parsed regardless of the data inside. If you have an idea on how to solve this, parse the file to json I will be much obliged.

Describe alternatives you've considered
I tried parsing the output file with jq without success.

@mpaduchh mpaduchh added the enhancement New feature or request label Jul 13, 2021
@slemme1
Copy link
Contributor

slemme1 commented Jul 23, 2021

There seems to be 3 common requests that get blurred together:

  1. Retrieving all secrets in the path without having to specify keys
  2. Formatting all secrets into json
  3. Writing all secrets to a file in json format
    Only 1) has no current solution.
    You can already gather all outputs and get them into json (and write to a file) outside of the vault-action step):
    env:
    ALL_SECRETS_JSON: "${{ toJson(steps.vaultactionId.outputs) }}"

@maxcoulombe
Copy link
Contributor

Hi, I agree with slemme1 that this issue encompasses 3 requests.

For n.2 & n.3, this has been discussed here: #98 . We believe that it is not the job of the vault-action to convert the retrieved secrets into multiple formats and that it is easy enough to convert and save the outputs in a json file in a subsequent step. Feel free to re-open the discussion in #98 if you do not agree with the conclusions and think the documentation enhancements are not enough.

For n.1, being able to retrieve all secrets in a path without using the $.$ work-around, there are quite a few issues an PRs opened to address this request including #238 .

If it's ok, I'll close this one as a duplicate so we can concentrate the discussion around supporting wildcards & regexes in the issues that already have a lot of context and comments. Cheers!

@maxcoulombe maxcoulombe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants