Skip to content
New issue

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

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

Already on GitHub? # to your account

Suggestion: flag for knox acl to output JSON #75

Open
markjm opened this issue May 4, 2022 · 1 comment
Open

Suggestion: flag for knox acl to output JSON #75

markjm opened this issue May 4, 2022 · 1 comment

Comments

@markjm
Copy link

markjm commented May 4, 2022

Hi all - small suggestion for the knox acl command. Sometimes I will create a new secret starting from the same "configuration" as the other. To do so, I can pipe knox get old | knox create new, but then need to do some manual changes to the output of knox acl old. This is because the acl command iterated through an array and json-ifys each entry, instead of json-ifying it all together.

Actual:

{"type":"User","id":"markjm","access":"Admin"}
{"type":"UserGroup","id":"markjm-group","access":"Admin"}

Expected (with new JSON flag)

[
{"type":"User","id":"markjm","access":"Admin"},
{"type":"UserGroup","id":"markjm-group","access":"Admin"}
]

Please also let me know if there is another command I am missing that would fulfill my request. Happy to implement these changes if agreed upon. Thanks!

@csstaub
Copy link
Contributor

csstaub commented May 19, 2023

As a workaround, you can use jq to turn the stream of JSON objects into a list:

knox acl KEY-ID | jq -s .

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants