feat: support post_logout_redirect_uri config in openid-connect plugin#6455
Conversation
| | realm | string | optional | "apisix" | | Realm used for the authentication | | ||
| | bearer_only | boolean | optional | false | | Setting this `true` will check for the authorization header in the request with a bearer token | | ||
| | logout_path | string | optional | "/logout" | | | | ||
| | post_logout_redirect_uri | string | optional | | | URL want to redirect when request logout_path |
| "uri": "/*" | ||
| }]], | ||
| [[{ | ||
| "node": { |
There was a problem hiding this comment.
We don't need to check the response data of this request, right?
There was a problem hiding this comment.
I think we should check the response data of this request like other route-creating tests.
Why we don't need to check the response?
There was a problem hiding this comment.
Yes, we check the response status code but not the data. The data is mostly an echo of the input.
| end | ||
| end | ||
|
|
||
| -- Get the final URI out of the Location response header. This should be the original URI that was requested. |
There was a problem hiding this comment.
The similar Lua snipper is repeated in multiple tests. Could we refactor it?
There was a problem hiding this comment.
Hi, @spacewander.
The similar Lua snipper is repeated in multiple tests.
Yes, they are repeated. But I have no idea about refactoring it, can you give me some examples or docs?
There was a problem hiding this comment.
Line 30 in acbb111
You can define helper functions in extra_init_by_lua
There was a problem hiding this comment.
Fixed. Please review it again.
What this PR does / why we need it:
Hi, this PR is used to support post_logout_redirect_uri config in openid-connect plugin.
So that we can redirect the uri when request the logout path of openid-connect plugin.
Fix: #6345, #6362
Since the lua-resty-openidc has support post_logout_redirect_uri already, we can just add post_logout_redirect_uri config in our plugin.
Refer: https://github.com/zmartzone/lua-resty-openidc/blob/3aac462f8206b8553cd1f34bb99b1788efbc2140/lib/resty/openidc.lua#L1331-L1339
Pre-submission checklist: