kovasaurus opened a new pull request, #14212:
URL: https://github.com/apache/apisix/pull/14212
### Description
This PR makes Redis Sentinel a supported, documented session storage option
for the `openid-connect` plugin.
The plugin already passes `conf.session` to lua-resty-session unchanged.
lua-resty-session 4.2.0 (the bundled version) switches to its Sentinel
backend (`resty.session.redis.sentinel`, built on
`lua-resty-redis-connector`) whenever `redis.sentinels` is set.
Because`session.redis` doesn't restrict extra properties, this has worked by
accident since `session.redis` was introduced in apache/apisix#12986 (APISIX
3.16.0).
But it's undocumented and unvalidated: incomplete configs fail only at
request time.
This PR declares the fields, validates them, encrypts the password, and
documents and tests the feature.
It needs no runtime changes and no dependency bumps.
New `session.redis` fields:
- `sentinels`: array of `{host, port}`, `minItems: 1`. When set, `host` and
`port` are ignored.
- `master`: name of the Sentinel master. Required when `sentinels` is set.
- `sentinel_username` / `sentinel_password`: credentials for Sentinel.
`sentinel_password` is added to `encrypt_fields`.
The field names match lua-resty-session's own config keys, so they keep the
plugin's pass-through contract.
The PR doesn't expose `role`, because sessions need a writable master.
Redis Cluster (`nodes`) is out of scope.
### Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [x] I have added tests corresponding to this change
- [x] I have updated the documentation to reflect this change
- [x] I have verified that this change is backward compatiblew (this feature
is already available and tested in 3.18, 3.19 by providing additional keys in
the `redis.session` object)
--
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]