auth: login/registration changes for upcomming new rules for login using external identities.

- show session expiration
This commit is contained in:
Marcin Kuzminski 2019-01-15 11:34:50 +01:00
parent 0a7d8bb9ea
commit 1ead0d3876
8 changed files with 104 additions and 109 deletions

View file

@ -24,6 +24,9 @@ RhodeCode authentication plugin for built in internal auth
import logging
import colander
from rhodecode.authentication.schema import AuthnPluginSettingsSchemaBase
from rhodecode.translation import _
from rhodecode.authentication.base import RhodeCodeAuthPluginBase, hybrid_property
@ -43,6 +46,18 @@ class RhodecodeAuthnResource(AuthnPluginResourceBase):
pass
class RhodeCodeSettingsSchema(AuthnPluginSettingsSchemaBase):
superadmin_restriction = colander.SchemaNode(
colander.Bool(),
default=False,
description=_('Only allow super-admins to log-in using this plugin.'),
missing=False,
title=_('Enabled'),
widget='bool',
)
class RhodeCodeAuthPlugin(RhodeCodeAuthPluginBase):
uid = 'rhodecode'
@ -64,6 +79,9 @@ class RhodeCodeAuthPlugin(RhodeCodeAuthPluginBase):
route_name='auth_home',
context=RhodecodeAuthnResource)
def get_settings_schema(self):
return RhodeCodeSettingsSchema()
def get_display_name(self):
return _('RhodeCode Internal')