Last active
September 21, 2023 15:56
-
-
Save matiferrigno/11ecf55b3f064abb210d226e9cfe29de to your computer and use it in GitHub Desktop.
This file contains 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
# ~/.jq/jwt.jq | |
# | |
# Ex. | |
# jq -R 'import "jwt" as jwt; jwt::decode' /tmp/jwt_to_decode | |
# | |
# this is a alternative to: | |
# jq -R 'split(".") | .[0],.[1] | @base64d | fromjson' /tmp/jwt_to_decode | |
# | |
# still possible to use an alias for either command but this appears to be more scalable. | |
def decode: | |
split(".") | |
| .[0],.[1] | |
| @base64d | |
| fromjson | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ahh, muy bueno!!