catalyst / moodle-auth_saml2

SAML done 100% in Moodle, fast, simple, secure
https://moodle.org/plugins/auth_saml2
70 stars 132 forks source link

Add support for redis sentinel #763

Open emilioah opened 1 year ago

emilioah commented 1 year ago

Quick changes to support redis sentinel.

Configuration in moodle/config.php:

$CFG->auth_saml2_store = '\auth_saml2\redis_store'; // OPT 1: Single redis server $CFG->auth_saml2_redis_server = '{{ moodle_config.redishost }}'; # Required for the redis_store above // OPT 2: Redis Sentinel $CFG->auth_saml2_redissentinel_servers = '1.1.1.1:26397,2.2.2.2:26397,3.3.3.3:26397'; $CFG->auth_saml2_redissentinel_group = 'rediscluster';

danmarsden commented 1 year ago

I know the existing code pollutes the global $CFG to store auth_saml2 specific settings, but we should really migrate those to config_plugins table instead if possible, although we might not block merging based on that for now... I'll see if someone here can PR this properly - thanks!

matt-catalyst commented 1 year ago

SimpleSAML has builtin support for Redis Sentinel - could it be utilised by this patch?

https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance.html#configuring-redis-storage