authn: Store legacy plugins prefix in module variable.

This commit is contained in:
Johannes Bornhold 2016-06-06 11:24:23 +02:00
parent 8906d7163b
commit 3e49389eff

View file

@ -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