auth: allow custom name for plugins if defined in the settings.

This commit is contained in:
Milka Kuzminski 2020-11-03 13:25:13 +01:00
parent d077bef593
commit 5590b13ef5
9 changed files with 10 additions and 9 deletions

View file

@ -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')

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -32,8 +32,8 @@
<img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
</div>
<%block name="above_login_button" />
<div id="login" class="right-column">
<%block name="above_login_button" />
<!-- login -->
<div class="sign-in-title">
<h1>${_('Sign In using username/password')}</h1>