lua-resty-openidc icon indicating copy to clipboard operation
lua-resty-openidc copied to clipboard

lua_resty_session > v4.0.0 doesnt work

Open cuotos opened this issue 1 year ago • 7 comments

https://github.com/zmartzone/lua-resty-openidc/blob/v1.7.6/lib/resty/openidc.lua#L1482

lua_resty_session > v4.0.0 removed "present" from the item returned from "session.start()"

This causes this to always fail https://github.com/zmartzone/lua-resty-openidc/blob/5a7b9e2cfe4f5aab7c60032e6ca94d2d534f7d19/lib/resty/openidc.lua#L1483

Im using the https://github.com/revomatico/kong-oidc/tree/master plugin for kong and could not get it to work. Im new to lua, but was able to work my way through it and found that the v4.0.0 upgrade to the session library caused the break

cuotos avatar May 17 '23 20:05 cuotos

update: I had just been looking at the latest 1.7.6 tag as this was what was being used, and have just spotted this commit. Is there a plan for this to be released? or is there a way for me to do this manually in the meantime?

https://github.com/zmartzone/lua-resty-openidc/commit/4b9316403e1d6a162aecea86c466f50fe78232e8

cuotos avatar May 17 '23 20:05 cuotos

this has been released, it is the version that became 1.7.6-3 , it just looks as if there was no corresponding git tag. It is quite possible Kong won't work with lua-resty-session < 4 anymore. There is #478 that I haven't found time to review, yet.

bodewig avatar May 17 '23 20:05 bodewig

sorry for my ignorance,

if both 3.10 and >4 are installed at the same time, does the >4 module get used for everything?

If I (to test only) force remove v4 from my docker container, my problem is fixed, but as kong specifies it required >4, I cannot guarantee another area is broken. This would imply that the newer version is being used, even if a module specifies an older one in its rockspec file

cuotos avatar May 17 '23 21:05 cuotos

I'm not really an expert when it comes to Lua packaging, but I don't believe there is a way to support multiple versions of the same library at the same time. The modules would need to have different names for this to work IIUC. And I honestly don't know which one would win if two versions are around.

bodewig avatar May 18 '23 12:05 bodewig

That seems to be the conclusion my research has lead to too. This ticket can be closed if there are others covering the same subject and I'll have to reassess the approach I can't take with my project.

cuotos avatar May 18 '23 15:05 cuotos

THANK YOU SO MUCH ... I use https://github.com/Kong/kong (3.4.2) and I resolved the error using this command inside my custom kong image (to resolve lua_resty_session duplication

luarocks remove lua-resty-session 4.0.4-1 --force

Fabryprog avatar Nov 14 '23 12:11 Fabryprog

However the potential side effect on Kong itself is kinda scary :)

jack4it avatar Mar 04 '24 04:03 jack4it