-
Notifications
You must be signed in to change notification settings - Fork 50
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
allow nil values for consumer and credential #153
Conversation
Loïc Vermeire seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
a865453
to
ce32c12
Compare
@lvermeire Thank you. Could you sign the CLA with the email that authors the commit please? |
I believe I did? Originally signed the commit with the wrong email, but updated it right after with a force push. |
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.
We need a test case here https://github.com/Kong/go-pdk/blob/master/client/client_test.go#L84
@lvermeire could you look into adding the test case? Thank you for your contribution! |
Added two test cases. |
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.
@lvermeire Thank you for your contribution! 🙏🏻
if consumer == nil { | ||
return fmt.Errorf("Invalid consumer") | ||
if consumer == nil && credential == nil { | ||
return fmt.Errorf("either credential or consumer must be provided") |
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.
nice that you preserved the kong error message here : )
77521b5
to
81330ef
Compare
Either `consumer` or `credential` may be nil. Fixes Kong#152
81330ef
to
ad21e33
Compare
@lvermeire - With this fix you are eligible for a "Kong contributor badge" since this is part of Kong Gateway; please fill out the form at https://docs.google.com/forms/d/e/1FAIpQLSfacQHac-PYIDIrDOi_W2l7cWxBDRIVBs6xE5HnlojPvdhL9g/viewform if you'd like to claim it! 🦍 |
#152
kong.client.authenticate should accept nil values for consumer and credential.