Repository navigation
Conversation
51d86e8 to
ecf3d02
Compare
When session:destroy() fails (for example because the revocation store is unreachable in closed fail mode), return the error from openidc_logout and authenticate instead of continuing with the logout redirect.
ecf3d02 to
d128dc9
Compare
kevinlzw
left a comment
There was a problem hiding this comment.
Thanks for addressing the fail-closed logout behavior. Before merging, please add coverage for the other newly introduced fail-closed path: a closed-mode revocation read failure during session.start().
The current test only makes revocation.set fail after session startup, so it does not exercise the new unable to check session revocation branch in openidc_start_session, nor the openidc.access_token() caller. Please add tests that make revocation.get fail and verify that both APIs return the error without authenticating the request.
Also, this logic relies on exact lua-resty-session error strings while the rockspec accepts any version >= 4.2.0. Please either use a stable upstream error signal or constrain and test the supported dependency range, so a later dependency release cannot silently weaken closed-mode behavior.
3d5f703 to
bf70243
Compare
bf70243 to
02bbadc
Compare
Addressed. |
Summary
When
lua-resty-session4.2 is configured with cookie storage and a revocationbackend,
session:destroy()can fail if the store is unreachable whilerevocation_fail_modeisclosed. Previously,openidc_logoutignored thaterror and continued the logout redirect, so the user appeared logged out while
the session cookie remained valid after the store recovered.
This change propagates revocation-store failures from logout and session start
when fail mode is
closed, so callers can handle the error instead of treatinglogout as successful.
openidc_destroy_sessionand return destroy errors fromopenidc_logoutand
authenticateopenidc_start_sessionto surface closed-mode revocation errors fromsession.startinauthenticateandaccess_tokenlua-resty-sessionto 4.2.0revocation_fail_modeopenandclosedduringlogout
See Lua-Resty-Session (completed by me) and APISIX (paused until this is merged).
Checklist
docker build -f tests/Dockerfile . -t lua-resty-openidc/testdocker run -t --rm lua-resty-openidc/test:latestChangeLogis updated for behavior changes, bug fixes, features, or user-visible documentation changes