From b3cb2f94deae7ea8baf97d9629d9a8ec6558959c Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Oct 23 2016 12:23:56 +0000 Subject: [PATCH 1/2] Allow PluginObjects to do something when their configuration is refreshed Signed-off-by: Patrick Uiterwijk Reviewed-by: Howard Johnson --- diff --git a/ipsilon/util/plugin.py b/ipsilon/util/plugin.py index 1e91346..2b49c82 100644 --- a/ipsilon/util/plugin.py +++ b/ipsilon/util/plugin.py @@ -134,6 +134,9 @@ class PluginObject(Log): def on_disable(self): return + def on_reconfigure(self): + return + def save_enabled_state(self): enabled = [] self._plugins.refresh_enabled() @@ -192,6 +195,7 @@ class PluginObject(Log): except Exception, e: # pylint: disable=broad-except self.error('Failed to refresh config for %s (%s)' % (self.name, e)) + self.on_reconfigure() def save_plugin_config(self, config=None): if config is None: From f41a7541ef878f262eb33d6c356889e3c68eac56 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Oct 23 2016 12:23:59 +0000 Subject: [PATCH 2/2] Let OpenID Connect provider reload its keyset and extensions on reconfigure Signed-off-by: Patrick Uiterwijk Reviewed-by: Howard Johnson --- diff --git a/ipsilon/providers/openidcp.py b/ipsilon/providers/openidcp.py index 54fd06c..7a68c7c 100644 --- a/ipsilon/providers/openidcp.py +++ b/ipsilon/providers/openidcp.py @@ -223,6 +223,12 @@ Provides OpenID Connect authentication infrastructure. """ return d + def on_reconfigure(self): + super(IdpProvider, self).on_reconfigure() + self.init_idp() + self.extensions.enable(self._config['enabled extensions'].get_value(), + self) + class Installer(ProviderInstaller):