From 656a419c84bfa67f1df9a8eb482de7404df815d8 Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Fri, 29 Nov 2019 11:15:13 +0100 Subject: [PATCH] app-setup: allow skip of legacy plugin discovery. --- configs/development.ini | 3 +++ configs/production.ini | 3 +++ rhodecode/config/middleware.py | 5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configs/development.ini b/configs/development.ini index 4aeccc0a..0baf0ae5 100644 --- 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 index 23a5118e..6ebc29d8 100644 --- 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 index 4c08d2ee..efc16c60 100644 --- 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: