-
Notifications
You must be signed in to change notification settings - Fork 62
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
make error responses less verbose #233
Conversation
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.
LGTM. Thanks, @fairclothjm!
@@ -272,7 +273,8 @@ func (b *jwtAuthBackend) pathConfigWrite(ctx context.Context, req *logical.Reque | |||
case config.JWKSURL != "": | |||
keyset, err := jwt.NewJSONWebKeySet(ctx, config.JWKSURL, config.JWKSCAPEM) | |||
if err != nil { | |||
return logical.ErrorResponse(errwrap.Wrapf("error checking jwks_ca_pem: {{err}}", err).Error()), nil | |||
b.Logger().Error("error checking jwks_ca_pem", "error", err) |
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.
I realize it was like this before, but I think this log and error should be like error checking jwks_url
. I guess it could be a problem with the CA too.. So maybe error checking jwks_url or jwks_ca_pem
? 🤔
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.
It looks like NewJSONWebKeySet() returns an error if jwks url is empty or if there is an error with the CA. On line 273 we check that the jwks url is not empty so I think this log is correct.
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.
You're right. Missed that we already check if it's not empty 👍
Thanks! |
* make error responses less verbose * fix uts
* make error responses less verbose * fix uts
* make error responses less verbose * fix uts
No description provided.