Kong / go-pdk

Write Kong plugins in Go! 🦍
https://pkg.go.dev/github.com/Kong/go-pdk
Apache License 2.0
146 stars 50 forks source link

kong.client.authenticate should support nil values for consumer and credential #152

Closed lvermeire closed 7 months ago

lvermeire commented 1 year ago

https://github.com/Kong/go-pdk/blob/4deec45a5bfe421a0ceebcbf7931d395250949b0/client/client.go#L125-L152

The function kong.client.authenticate in the Kong PDK client module supports nil values for both consumer and credential:

While both consumer and credential can be nil, at least one of them must exist. Otherwise, this function will throw an error.

The current implementation of the go client does not allow either parameter to be nil, but it should.

StarlightIbuki commented 1 year ago

Thanks for the report and the PR! We will be looking into it soon.