Uh oh!
There was an error while loading. Please reload this page.
feat(openid-connect): support stateless session revocation - #13651
feat(openid-connect): support stateless session revocation#13651Hockenba wants to merge 6 commits into
Conversation
Hello @Hockenba,
Update: This PR depends on bungle/lua-resty-session#208 status https://the-asf.slack.com/archives/CUC5MN17A/p1783014722148709 |
janiussyafiq
commented
Aug 27, 2026
Some comments that you can address or state your reasoning on why you think the current approaches should remain:
"session": {
"storage": "cookie",
"redis": { "host": "127.0.0.1" },
"revocation": "redis",
"revocation_fail_mode": "closed"
}
|
Hockenba
commented
Aug 27, 2026
You make a lot of great points. It is a little late in my time zone, so I'll refine this tomorrow based on your comments. One thing: the Chinese documentation needs to the created and pushed to this PR by someone who actually knowns Chinese. I do not know a lick of Chinese and I am sure we want better than what Google Translate will spit out for me. |
janiussyafiq
commented
Aug 27, 2026
Thanks for the fast reply. For Chinese translation u can ask your agent to do it on your behalf, it usually does it right the first time if the change is not so complex. If there's any issue then maintainers will give some feedback. |
I wasn't sure how good agents are at English to Chinese translation. Sounds good. Will do. I'll be spending my workday tomorrow refactoring and addressing your comments with either commits or follow up discussion (Eastern Standard Time). So be on the look out for that. Thanks. |
7e084f2 to
72f7000CompareHockenba
commented
Aug 27, 2026
Done. Refactored it quite a bit. Cut out all the unnecessary bloat. Ready for review again. |
janiussyafiq
commented
Aug 28, 2026
Thanks for addressing my concerns, however few issues remain:
|
05f98a6 to
4c92d96CompareHockenba
commented
Aug 28, 2026
1-4 should be addressed. |
janiussyafiq
commented
Aug 28, 2026
Thanks, 1-4 look good and |
2ea49cd to
2548150Compare
Should be all addressed now. I ran all the openid-connect tests, and they all passed. No idea why the CI tests failed, but none are related to my changes or even the openid-connect plugin. |
There was a problem hiding this comment.
Pull request overview
Adds Redis-backed revocation for stateless OpenID Connect cookie sessions.
Changes:
- Adds revocation schema validation and session option forwarding.
- Upgrades
lua-resty-sessionto 4.2.0-1. - Adds integration tests and bilingual documentation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
apisix/plugins/openid-connect.lua | Defines revocation configuration. |
apisix-master-0.rockspec | Upgrades the session dependency. |
t/plugin/openid-connect-revocation.t | Tests configuration and revocation. |
docs/en/latest/plugins/openid-connect.md | Documents the feature in English. |
docs/zh/latest/plugins/openid-connect.md | Documents the feature in Chinese. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| }, | ||
| revocation_fail_mode = { | ||
| type = "string", | ||
| enum = {"open", "closed"}, |
There was a problem hiding this comment.
Not sure if the AI is correct (will verify in the morning), but this may be intentional best-effort logout design—either by the project or something we may want ourselves—so users aren't blocked when Redis is down. The client cookie still clears, and from the UI's perspective, the logout happened successfully. A bug-free UI won't randomly reuse deleted cookies, and this scenario is really aimed at bad actors rather than normal operation.
The replay risk only exists if the session value was stolen and reused. Even then, fail-open or fail-closed doesn't change the fact that we can't revoke it without Redis up—so we have to eat that risk either way. If we fail closed, it doesn't stop the replay attack; it just tells the user their logout failed and leaves them retrying over and over again, which isn't great for UX.
If we prefer stricter failure handling regardless, we can add it now or defer it. Either direction works depending on what makes sense for the project.
There was a problem hiding this comment.
I think the concern is valid, could u address this
There was a problem hiding this comment.
A proper fix depends on a change in lua-resty-openidc, since that’s where the destroy() error isn’t being propagated. I’m pausing this PR for now and will work on fixing it there first.
There was a problem hiding this comment.
@janiussyafiq@juzhiyuan See zmartzone/lua-resty-openidc#571. Looks like https://github.com/kevinlzw is the maintainer of this library. I reached out to him by email.
There was a problem hiding this comment.
@janiussyafiq@juzhiyuan BTW, said PR is merged, and I have updated lua-resty-openidc to the latest version. Along with the changes and test to detect that errors and return correctly. Should be ready to continue with the review.
df76484df76484 to
7de0bccCompareAdd opt-in Redis-backed revocation for cookie sessions, with schema validation, documentation, and focused coverage.
Forward lua-resty-session revocation settings directly and make the fail-open default explicit.
Let lua-resty-session apply fail-open behavior only when revocation is enabled, preserving unchanged defaults for other sessions.
7de0bcc to
0c3c35cComparejaniussyafiq
commented
Sep 7, 2026
could u rebase/merge with master to fix CI |
Hockenba
commented
Sep 7, 2026
@janiussyafiq Done. |
Description
Adds opt-in Redis-backed revocation for OpenID Connect cookie sessions.
Setting
session.revocationtoredisenables lua-resty-session's Redis revocation backend.session.revocation_fail_modedefaults toopenand can be set toclosed. Redis-backed session storage remains unchanged, and incompatible or incomplete configurations are rejected.Session options remain a direct pass-through to lua-resty-session. The deprecated
session.cookie.lifetimealias continues to writeabsolute_timeoutto the shared configuration, so its warning is not emitted on every request.This also upgrades
lua-resty-sessionto4.2.0-1and lua-resty-openidc to1.9.1-1and documents the feature in English and Chinese.Which issue(s) this PR fixes:
N/A
Test plan
open, explicitclosed, and omitted revocation configurations.Checklist