diff --git a/configs/development.ini b/configs/development.ini --- a/configs/development.ini +++ b/configs/development.ini @@ -290,6 +290,9 @@ instance_id = ## egg:rhodecode-enterprise-ce#crowd #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode +## Flag to control loading of legacy plugins in py:/path format +auth_plugin.import_legacy_plugins = true + ## alternative return HTTP header for failed authentication. Default HTTP ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with ## handling that causing a series of failed authentication calls. diff --git a/configs/production.ini b/configs/production.ini --- a/configs/production.ini +++ b/configs/production.ini @@ -265,6 +265,9 @@ instance_id = ## egg:rhodecode-enterprise-ce#crowd #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode +## Flag to control loading of legacy plugins in py:/path format +auth_plugin.import_legacy_plugins = true + ## alternative return HTTP header for failed authentication. Default HTTP ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with ## handling that causing a series of failed authentication calls. diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -266,7 +266,6 @@ def includeme(config): config.include('rhodecode.integrations') if load_all: - from rhodecode.authentication import discover_legacy_plugins # load CE authentication plugins config.include('rhodecode.authentication.plugins.auth_crowd') config.include('rhodecode.authentication.plugins.auth_headers') @@ -277,7 +276,9 @@ def includeme(config): config.include('rhodecode.authentication.plugins.auth_token') # Auto discover authentication plugins and include their configuration. - discover_legacy_plugins(config) + if asbool(settings.get('auth_plugin.import_legacy_plugins', 'true')): + from rhodecode.authentication import discover_legacy_plugins + discover_legacy_plugins(config) # apps if load_all: