From 3e49389eff2c3ce4eb621a3e1603ced5fc44834f Mon Sep 17 00:00:00 2001 From: Johannes Bornhold Date: Mon, 6 Jun 2016 11:24:23 +0200 Subject: [PATCH] authn: Store legacy plugins prefix in module variable. --- rhodecode/authentication/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rhodecode/authentication/__init__.py b/rhodecode/authentication/__init__.py index e274b7b2..24e2f046 100644 --- a/rhodecode/authentication/__init__.py +++ b/rhodecode/authentication/__init__.py @@ -30,8 +30,12 @@ from rhodecode.authentication.routes import AuthnRootResource from rhodecode.config.routing import ADMIN_PREFIX from rhodecode.model.settings import SettingsModel + log = logging.getLogger(__name__) +# Legacy plugins are stored with this prefix in 'auth_plugins'. +legacy_plugin_prefix = 'py:' + # TODO: Currently this is only used to discover the authentication plugins. # Later on this may be used in a generic way to look up and include all kinds @@ -52,7 +56,7 @@ def _discover_plugins(config, entry_point='enterprise.plugins1'): return _discovered_plugins -def _discover_legacy_plugins(config, prefix='py:'): +def _discover_legacy_plugins(config, prefix=legacy_plugin_prefix): """ Function that imports the legacy plugins stored in the 'auth_plugins' setting in database which are using the specified prefix. Normally 'py:' is