Skip to content

Commit

Permalink
fix: CLI now returns 1 when signature verification fails in JSON mode
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Henri Symoneaux <[email protected]>
  • Loading branch information
phsym committed Nov 18, 2024
1 parent 8ae2bbc commit fd78395
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/okms/keys/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ SIGNATURE can also be passed from a file or stdin using '-' or '@'. Stdin can ho
} else {

Check failure on line 87 in cmd/okms/keys/sign.go

View workflow job for this annotation

GitHub Actions / lint

elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
if valid {
fmt.Println("Signature is valid")
} else {
exit.OnErr(errors.New("Signature invalid"))
}
}
if !valid {
exit.OnErr(errors.New("Signature invalid"))
}
} else {
resp := exit.OnErr2(common.Client().GetServiceKey(cmd.Context(), keyId, utils.PtrTo(types.Jwk)))
if len(*resp.Keys) == 0 {
Expand Down

0 comments on commit fd78395

Please sign in to comment.