##// END OF EJS Templates
core: allow loading all auth plugins in once place for CE/EE code.
milka -
r4602:592efda0 stable
parent child
Show More
@@ -234,7 +234,7 def includeme_first(config):
234 '_static/rhodecode', path='rhodecode:public', cache_max_age=3600 * 24)
234 '_static/rhodecode', path='rhodecode:public', cache_max_age=3600 * 24)
235
235
236
236
237 def includeme(config):
237 def includeme(config, auth_resources=None):
238 log.debug('Initializing main includeme from %s', os.path.basename(__file__))
238 log.debug('Initializing main includeme from %s', os.path.basename(__file__))
239 settings = config.registry.settings
239 settings = config.registry.settings
240 config.set_request_factory(Request)
240 config.set_request_factory(Request)
@@ -266,14 +266,23 def includeme(config):
266 config.include('rhodecode.integrations')
266 config.include('rhodecode.integrations')
267
267
268 if load_all:
268 if load_all:
269 ce_auth_resources = [
270 'rhodecode.authentication.plugins.auth_crowd',
271 'rhodecode.authentication.plugins.auth_headers',
272 'rhodecode.authentication.plugins.auth_jasig_cas',
273 'rhodecode.authentication.plugins.auth_ldap',
274 'rhodecode.authentication.plugins.auth_pam',
275 'rhodecode.authentication.plugins.auth_rhodecode',
276 'rhodecode.authentication.plugins.auth_token',
277 ]
278
269 # load CE authentication plugins
279 # load CE authentication plugins
270 config.include('rhodecode.authentication.plugins.auth_crowd')
280
271 config.include('rhodecode.authentication.plugins.auth_headers')
281 if auth_resources:
272 config.include('rhodecode.authentication.plugins.auth_jasig_cas')
282 ce_auth_resources.extend(auth_resources)
273 config.include('rhodecode.authentication.plugins.auth_ldap')
283
274 config.include('rhodecode.authentication.plugins.auth_pam')
284 for resource in ce_auth_resources:
275 config.include('rhodecode.authentication.plugins.auth_rhodecode')
285 config.include(resource)
276 config.include('rhodecode.authentication.plugins.auth_token')
277
286
278 # Auto discover authentication plugins and include their configuration.
287 # Auto discover authentication plugins and include their configuration.
279 if asbool(settings.get('auth_plugin.import_legacy_plugins', 'true')):
288 if asbool(settings.get('auth_plugin.import_legacy_plugins', 'true')):
General Comments 0
You need to be logged in to leave comments. Login now