-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Kong Oauth2 backend headers NULL and discussion point. #3609
Comments
|
@jeremyjpj0916 I would give a |
@bungle yeah I was looking at the OAuth2 code the other day and realized X-Consumer-Groups header had to deal with ACL plguin code and not OAuth2 in my suggestion. So glad to hear you think that would be an appropriate change as each API Provider does not need to know all the groups(which really represent either access to one or many proxies) a consumer has access to(must be a specific use case yall were thinking about when it was designed). And as for X-Consumer-Custom-ID: userdata: NULL being populated by the OAuth2 plugin you would consider that to be a bug right and a PR to the OAuth2 plugin checking for nil before assignment is appropriate? |
Yes, that is a bug, that is lurking around in a lot of places as new dao (kong.db) returns |
Edit... the placeholder for the comment I had here is already resolved with merged PR! null in the other header value this issue was originally opened for may still persist. |
@jeremyjpj0916, Yes, I think so. Thanks! |
Minimal changes to add a { nulls = true } options argument to the new DAO, so that by default it returns Lua `nil` on null values, but can also return explicit `ngx.null` upon request. Adjusts the Admin API endpoint generator to pass this option, and also the router (so that code changes to the router at this point are minimal). Fix #3609 Fix #3617
Summary
When backend receives a valid Oauth2 Client, headers that are null should not be set and passed.
One other thing I wanted to bring up, X-Consumer-Groups is not a valuable header to us, would kong accept a PR boolean to Oauth2 that disables this header? Think about it. A consumer at scale with an ACL to each proxy(if you do it like that) ends up being 100-200+ uuids thrown in this header, not super performant. Would Kong accept a PR to enable/disable that in the Oauth2 schema?
X-Consumer-ID: 8aa31296-a4ec-4cb4-bfc7-64a5428b3c65
X-Consumer-Custom-ID: userdata: NULL
X-Consumer-Username: admin
X-Consumer-Groups: c3af0477-4747-4700-b9bc-520d158fdc15, 614c8995-a153-408b-b67d-06f0fc524898
Steps To Reproduce
Additional Details & Logs
The text was updated successfully, but these errors were encountered: