auth: allow custom name for plugins if defined in the settings.
This commit is contained in:
parent
d077bef593
commit
5590b13ef5
9 changed files with 10 additions and 9 deletions
|
|
@ -215,9 +215,10 @@ class RhodeCodeAuthPluginBase(object):
|
|||
"""
|
||||
return self._plugin_id
|
||||
|
||||
def get_display_name(self):
|
||||
def get_display_name(self, load_from_settings=False):
|
||||
"""
|
||||
Returns a translation string for displaying purposes.
|
||||
if load_from_settings is set, plugin settings can override the display name
|
||||
"""
|
||||
raise NotImplementedError('Not implemented in base class')
|
||||
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
|
|||
def get_settings_schema(self):
|
||||
return CrowdSettingsSchema()
|
||||
|
||||
def get_display_name(self):
|
||||
def get_display_name(self, load_from_settings=False):
|
||||
return _('CROWD')
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
|
|||
route_name='auth_home',
|
||||
context=HeadersAuthnResource)
|
||||
|
||||
def get_display_name(self):
|
||||
def get_display_name(self, load_from_settings=False):
|
||||
return _('Headers')
|
||||
|
||||
def get_settings_schema(self):
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
|
|||
def get_settings_schema(self):
|
||||
return JasigCasSettingsSchema()
|
||||
|
||||
def get_display_name(self):
|
||||
def get_display_name(self, load_from_settings=False):
|
||||
return _('Jasig-CAS')
|
||||
|
||||
@hybrid_property
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
|
|||
def get_settings_schema(self):
|
||||
return LdapSettingsSchema()
|
||||
|
||||
def get_display_name(self):
|
||||
def get_display_name(self, load_from_settings=False):
|
||||
return _('LDAP')
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
|
|||
route_name='auth_home',
|
||||
context=PamAuthnResource)
|
||||
|
||||
def get_display_name(self):
|
||||
def get_display_name(self, load_from_settings=False):
|
||||
return _('PAM')
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class RhodeCodeAuthPlugin(RhodeCodeAuthPluginBase):
|
|||
def get_settings_schema(self):
|
||||
return RhodeCodeSettingsSchema()
|
||||
|
||||
def get_display_name(self):
|
||||
def get_display_name(self, load_from_settings=False):
|
||||
return _('RhodeCode Internal')
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class RhodeCodeAuthPlugin(RhodeCodeAuthPluginBase):
|
|||
def get_settings_schema(self):
|
||||
return RhodeCodeSettingsSchema()
|
||||
|
||||
def get_display_name(self):
|
||||
def get_display_name(self, load_from_settings=False):
|
||||
return _('Rhodecode Token')
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue