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
cmd: list supported algorithms #123
Conversation
0a7fdad
to
914861d
Compare
cmd/jwt/main.go
Outdated
"strings" | ||
|
||
"github.com/golang-jwt/jwt/v4" | ||
) | ||
|
||
var ( | ||
// Options | ||
flagAlg = flag.String("alg", "", "signing algorithm identifier") | ||
flagAlg = flag.String("alg", "", fmt.Sprintf("signing algorithm identifier %v", algs())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your thoughts if we made this a bit easier to read:
- flagAlg = flag.String("alg", "", fmt.Sprintf("signing algorithm identifier %v", algs()))
+ flagAlg = flag.String("alg", "", fmt.Sprintf("signing algorithm identifiers:\n%v", strings.Join(algs(), ",")))
Printing out:
-alg string
signing algorithm identifiers:
ES256,ES384,ES512,EdDSA,HS256,HS384,HS512,PS256,PS384,PS512,RS256,RS384,RS512,none
instead of:
-alg string
signing algorithm identifier [ES256 ES384 ES512 EdDSA HS256 HS384 HS512 PS256 PS384 PS512 RS256 RS384 RS512 none]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to
-alg string
signing algorithm identifier, one of
ES256, ES384, ES512, EdDSA, HS256, HS384, HS512,
PS256, PS384, PS512, RS256, RS384, RS512, none
914861d
to
bac3766
Compare
The help message looks like: ``` -alg string signing algorithm identifier, one of ES256, ES384, ES512, EdDSA, HS256, HS384, HS512, PS256, PS384, PS512, RS256, RS384, RS512, none ``` Also fixes golang-jwt#63 Signed-off-by: Alexander Yastrebov <yastrebov.alex@gmail.com>
bac3766
to
705b5d8
Compare
@mfridman Was there something else (I am not sure what |
A (positive) review automatically gets dismissed by GitHub if you add more changes to the branch. Basically to prevent that somebody approves it and then does not see the later changes. |
The help message looks like:
Also fixes #63
Signed-off-by: Alexander Yastrebov yastrebov.alex@gmail.com