feat: replace cookie with resty session#29
Conversation
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
| --- error_code: 200 | ||
| --- error_log | ||
| login callback req with http post | ||
| ; Path=/; SameSite=None; Secure; HttpOnly, |
There was a problem hiding this comment.
assert cookie attributes
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
There was a problem hiding this comment.
Pull request overview
This pull request replaces the lua-resty-cookie library with lua-resty-session for session management in the SAML authentication library. This represents a significant architectural change from server-side session storage (using nginx shared dictionaries) to client-side encrypted cookie-based sessions.
Changes:
- Replaced lua-resty-cookie dependency with lua-resty-session in rockspecs
- Refactored session management from shared dictionary + cookies to encrypted session cookies
- Removed lua_shared_dict configuration requirement from tests
- Updated tests to validate cookie attributes for both HTTP-Redirect and HTTP-POST bindings
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/resty/saml.lua | Core refactoring to use lua-resty-session API for all session operations (login, login_callback, logout, logout_callback) |
| rockspec/lua-resty-saml-main-0-0.rockspec | Updated dependency from lua-resty-cookie to lua-resty-session 4.1.5-1 |
| rockspec/lua-resty-saml-0.2.3-0.rockspec | Incorrectly downgraded lua-resty-cookie version instead of replacing with lua-resty-session |
| t/saml.t | Removed lua_shared_dict config, added session_config with secret, updated test expectations for cookie attributes |
| t/saml-post.t | Removed lua_shared_dict config, added session_config with secret, updated test expectations for cookie attributes |
| t/lib/keycloak.lua | Added debug logging for cookies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
| lua_package_path '$pwd/lua/?.lua;$pwd/deps/share/lua/5.1/?.lua;$pwd/t/?.lua;;'; | ||
| lua_package_cpath '$pwd/?.so;;'; | ||
|
|
||
| lua_shared_dict saml_sessions 10m; |
There was a problem hiding this comment.
remember remove this shared dict from gateway repo too.
There was a problem hiding this comment.
added to my todo list
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…k/lua-resty-saml into feat/use-resty-session Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
No description provided.