##// END OF EJS Templates
authentication: use registerd UID for plugin definition for more consistent loading of auth plugins.
marcink -
r3246:ef7f5bf1 default
parent child Browse files
Show More
@@ -94,6 +94,9 b' class LazyFormencode(object):'
94 94
95 95
96 96 class RhodeCodeAuthPluginBase(object):
97 # UID is used to register plugin to the registry
98 uid = None
99
97 100 # cache the authentication request for N amount of seconds. Some kind
98 101 # of authentication methods are very heavy and it's very efficient to cache
99 102 # the result of a call. If it's set to None (default) cache is off
@@ -189,6 +189,7 b' class CrowdServer(object):'
189 189
190 190
191 191 class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
192 uid = 'crowd'
192 193 _settings_unsafe_keys = ['app_password']
193 194
194 195 def includeme(self, config):
@@ -290,5 +291,5 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
290 291
291 292
292 293 def includeme(config):
293 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format('crowd')
294 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format(RhodeCodeAuthPlugin.uid)
294 295 plugin_factory(plugin_id).includeme(config)
@@ -75,7 +75,7 b' class HeadersSettingsSchema(AuthnPluginS'
75 75
76 76
77 77 class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
78
78 uid = 'headers'
79 79 def includeme(self, config):
80 80 config.add_authn_plugin(self)
81 81 config.add_authn_resource(self.get_id(), HeadersAuthnResource(self))
@@ -226,5 +226,5 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
226 226
227 227
228 228 def includeme(config):
229 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format('headers')
229 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format(RhodeCodeAuthPlugin.uid)
230 230 plugin_factory(plugin_id).includeme(config)
@@ -66,6 +66,7 b' class JasigCasSettingsSchema(AuthnPlugin'
66 66
67 67
68 68 class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
69 uid = 'jasig_cas'
69 70
70 71 def includeme(self, config):
71 72 config.add_authn_plugin(self)
@@ -168,5 +169,5 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
168 169
169 170
170 171 def includeme(config):
171 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format('jasig_cas')
172 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format(RhodeCodeAuthPlugin.uid)
172 173 plugin_factory(plugin_id).includeme(config)
@@ -379,6 +379,7 b' class LdapSettingsSchema(AuthnPluginSett'
379 379
380 380
381 381 class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
382 uid = 'ldap'
382 383 # used to define dynamic binding in the
383 384 DYNAMIC_BIND_VAR = '$login'
384 385 _settings_unsafe_keys = ['dn_pass']
@@ -529,5 +530,5 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
529 530
530 531
531 532 def includeme(config):
532 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format('ldap')
533 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format(RhodeCodeAuthPlugin.uid)
533 534 plugin_factory(plugin_id).includeme(config)
@@ -72,6 +72,7 b' class PamSettingsSchema(AuthnPluginSetti'
72 72
73 73
74 74 class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
75 uid = 'pam'
75 76 # PAM authentication can be slow. Repository operations involve a lot of
76 77 # auth calls. Little caching helps speedup push/pull operations significantly
77 78 AUTH_CACHE_TTL = 4
@@ -166,5 +167,5 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
166 167
167 168
168 169 def includeme(config):
169 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format('pam')
170 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format(RhodeCodeAuthPlugin.uid)
170 171 plugin_factory(plugin_id).includeme(config)
@@ -44,6 +44,7 b' class RhodecodeAuthnResource(AuthnPlugin'
44 44
45 45
46 46 class RhodeCodeAuthPlugin(RhodeCodeAuthPluginBase):
47 uid = 'rhodecode'
47 48
48 49 def includeme(self, config):
49 50 config.add_authn_plugin(self)
@@ -144,5 +145,5 b' class RhodeCodeAuthPlugin(RhodeCodeAuthP'
144 145
145 146
146 147 def includeme(config):
147 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format('rhodecode')
148 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format(RhodeCodeAuthPlugin.uid)
148 149 plugin_factory(plugin_id).includeme(config)
@@ -47,6 +47,7 b' class RhodeCodeAuthPlugin(RhodeCodeAuthP'
47 47 """
48 48 Enables usage of authentication tokens for vcs operations.
49 49 """
50 uid = 'token'
50 51
51 52 def includeme(self, config):
52 53 config.add_authn_plugin(self)
@@ -152,5 +153,5 b' class RhodeCodeAuthPlugin(RhodeCodeAuthP'
152 153
153 154
154 155 def includeme(config):
155 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format('token')
156 plugin_id = 'egg:rhodecode-enterprise-ce#{}'.format(RhodeCodeAuthPlugin.uid)
156 157 plugin_factory(plugin_id).includeme(config)
General Comments 0
You need to be logged in to leave comments. Login now