-
Notifications
You must be signed in to change notification settings - Fork 360
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
fix: Misleading HTTP status code for oauth2_client_credentials authenticator #504
Conversation
8eec8fd
to
273b7d8
Compare
@aeneasr I've managed to return proper HTTP Error response based on the oauth2 clientcredentials response. I'm in the midst of writing test for this fix, will want to get some feedback pertaining the implementation. |
d15ea24
to
aab5168
Compare
return errors.Wrapf(helper.ErrUpstreamServiceNotFound, err.Error()) | ||
} else if rErr.Response.StatusCode == http.StatusUnauthorized { | ||
return errors.Wrapf(helper.ErrUnauthorized, err.Error()) | ||
} |
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.
A default case is missing. If that case were to happen, this would let the request pass even if an error occurred. I recommend using switch with a defaults!
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.
Hey @aeneasr, yeap have made unauthorized as the default case.
eb5d765
to
b123da1
Compare
f058099
to
2b4c1ed
Compare
Hey @aeneasr can help review this please. Thanks. |
Sorry for the slow response, this looks good! Thank you :) |
Related issue
Closes #496
Proposed changes
Checklist
vulnerability. If this pull request addresses a security. vulnerability, I
confirm that I got green light (please contact
[email protected]) from the maintainers to push
the changes.
works.
Further comments