nginx-auth-cas-lua
nginx-auth-cas-lua copied to clipboard
store is nil
Cas login pass, cas.lua error happen:
2021/03/11 17:49:04 [error] 87487#2288134: *2 lua entry thread aborted: runtime error: /usr/local/Cellar/openresty/1.19.3.1_1/lualib/cas.lua:78: attempt to index upvalue 'store' (a nil value)
stack traceback:
coroutine 0:
/usr/local/Cellar/openresty/1.19.3.1_1/lualib/cas.lua: in function '_set_store_and_cookie'
/usr/local/Cellar/openresty/1.19.3.1_1/lualib/cas.lua:118: in function 'validate_with_CAS'
/usr/local/Cellar/openresty/1.19.3.1_1/lualib/cas.lua:135: in function 'forceAuthentication'
access_by_lua(nginx.conf:35):1: in main chunk, client: 127.0.0.1, server: console.cloud.ll.com, request: "GET /s1?ticket=ST-5-9Z-euig-7AtF0nZnLrKVZTeebc0liulei07 HTTP/1.1", host: "console.cloud.ll.com"
I have enhanced error message for this configuration issue.
New error:
writing a global Lua variable ('store_name') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
Oops, my version of nginx+lua did not warn me :-(
Corrected in updated commit.
@prigaux The cas.lua basic logci may be ok, but it has many lua grammar error.
It has been tested and validated with debian 10 libnginx-mod-http-lua which uses lua nginx 0.10.13 (ref)