membphis commented on code in PR #14238:
URL: https://github.com/apache/apisix/pull/14238#discussion_r4662429318
##########
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:
**[P1] Avoid writing the OIDC deprecation warning on every request**
With `session.cookie.lifetime` configured and `session.absolute_timeout`
unset, `build_session_opts()` saves the derived timeout only on the copy. Every
request that enters session-based authentication then emits a `WARN` entry to
the NGINX error log at the default log level. The old code logged once per
effective session configuration table. A focused check with two calls against
the same configuration went from one warning to two, with the same effective
timeout. On a busy route, error-log writes now scale with authentication
traffic.
Please normalize the legacy field when loading the configuration or cache
the derived session options per configuration version. Add a regression test
that checks the effective timeout and the warning count across repeated
requests.
--
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]