auth-plugins: expose docs and icon methods for authentication.

This commit is contained in:
Marcin Kuzminski 2018-11-21 18:43:26 +01:00
parent 0cc2c2c07d
commit 3947a873c5
5 changed files with 30 additions and 0 deletions

View file

@ -171,6 +171,20 @@ class RhodeCodeAuthPluginBase(object):
db_type = '{}.encrypted'.format(db_type)
return db_type
@classmethod
def docs(cls):
"""
Defines documentation url which helps with plugin setup
"""
return ''
@classmethod
def icon(cls):
"""
Defines ICON in SVG format for authentication method
"""
return ''
def is_enabled(self):
"""
Returns true if this plugin is enabled. An enabled plugin can be

View file

@ -215,6 +215,10 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
def get_display_name(self):
return _('CROWD')
@classmethod
def docs(cls):
return "https://docs.rhodecode.com/RhodeCode-Enterprise/auth/auth-crowd.html"
@hybrid_property
def name(self):
return "crowd"

View file

@ -396,6 +396,10 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
def get_display_name(self):
return _('LDAP')
@classmethod
def docs(cls):
return "https://docs.rhodecode.com/RhodeCode-Enterprise/auth/auth-ldap.html"
@hybrid_property
def name(self):
return "ldap"

View file

@ -97,6 +97,10 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
def get_display_name(self):
return _('PAM')
@classmethod
def docs(cls):
return "https://docs.rhodecode.com/RhodeCode-Enterprise/auth/auth-pam.html"
@hybrid_property
def name(self):
return "pam"

View file

@ -69,6 +69,10 @@ class RhodeCodeAuthPlugin(RhodeCodeAuthPluginBase):
def get_display_name(self):
return _('Rhodecode Token Auth')
@classmethod
def docs(cls):
return "https://docs.rhodecode.com/RhodeCode-Enterprise/auth/auth-token.html"
@hybrid_property
def name(self):
return "authtoken"