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

jose fmt: Please implement shotcuts for operations on deep hashes. #80

Open
cbiedl opened this issue May 24, 2020 · 0 comments
Open

jose fmt: Please implement shotcuts for operations on deep hashes. #80

cbiedl opened this issue May 24, 2020 · 0 comments

Comments

@cbiedl
Copy link

cbiedl commented May 24, 2020

Hello,
fetching a value from a nested hash requires a lot of --get:

echo '{"level1":{"level2":{"level3":{"key":"value"}}}}' | \
    jose fmt --json=- --object  --get level1 --get level2 --get level3 --get key --unquote=-

It was nice if the keys could be concatenated so this can be written in a shorter form like:

echo '{"level1":{"level2":{"level3":{"key":"value"}}}}' | \
    jose fmt --json=- --object  --get level1.level2.level3.key --unquote=-

Bonus: Make the separator (currently: dot) configurable.

Related, it was nice if -U/--unwind could understand an optional repetition value, so (taken from clevis-encrypt-tang):

jwe="$(jose fmt -j "$jwe" -g protected -g clevis -g tang -q "$url" -s url -UUUUo-)"

could be written as

jwe="$(jose fmt -j "$jwe" -g protected -g clevis -g tang -q "$url" -s url -U4 -o-)"

PS: To make sure: This is not at all about short/long parameter names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants