nic-6443 commented on code in PR #14238:
URL: https://github.com/apache/apisix/pull/14238#discussion_r4662548238


##########
apisix/plugins/openid-connect.lua:
##########
@@ -63,6 +63,7 @@ local function build_session_opts(session_conf)
     end
     if session_conf.cookie and session_conf.cookie.lifetime then
         if not session_conf.absolute_timeout then
+            session_conf = core.table.clone(session_conf)
             session_conf.absolute_timeout = session_conf.cookie.lifetime
             core.log.warn("session.cookie.lifetime is deprecated; ",

Review Comment:
   Good catch, confirmed: with `session.cookie.lifetime` set and 
`session.absolute_timeout` unset, the warning fired on every call, since master 
only logged it once by writing `absolute_timeout` back into the shared conf.
   
   Fixed in 7e3f2fbed. A weak table keyed by the session conf records which 
confs have been warned about, so the warning is logged once per conf, and the 
derived `absolute_timeout` still lives only on the copy. I didn't normalize at 
load time because `check_schema` also runs on Admin API writes, so the 
normalized field would be stored in etcd as part of the configuration.
   
   `t/plugin/openid-connect10.t` TEST 13 calls `build_session_opts()` three 
times on the same conf and checks the effective timeout each time and that the 
warning shows up once. It fails without the fix.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to