Add support for redis sentinel#763
Open
emilioah wants to merge 7 commits intocatalyst:MOODLE_39_STABLEfrom
Open
Add support for redis sentinel#763emilioah wants to merge 7 commits intocatalyst:MOODLE_39_STABLEfrom
emilioah wants to merge 7 commits intocatalyst:MOODLE_39_STABLEfrom
Conversation
Member
|
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! |
|
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 |
| if (empty($CFG->auth_saml2_redis_server)) { | ||
| throw new \coding_exception('Redis connection string is not configured in $CFG->auth_saml2_redis_server'); | ||
| } | ||
| if (!empty($CFG->auth_saml2_redissentinel_servers) && !empty($CFG->auth_saml2_redissentinel_group)) { |
Contributor
There was a problem hiding this comment.
These really need to be plugin scope config items not globals please, its a very simple change. Get the config using get_config and set it in config.php like:
$CFG->forced_plugin_settings['auth_saml2']['foobar'] = 0;
This also needs to be documented somewhere like the readme file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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';