comparison src/server/server.py @ 471:de039f008333

server side: added config only option empty_password_allowed_warning_dangerous_list, which allow to connect with a profile with empty password. /!\ MUST not be used if Libervia is accessible from outside, this option is mainly useful for developpers.
author Goffi <goffi@goffi.org>
date Tue, 10 Jun 2014 15:59:52 +0200
parents 34ce41e014c4
children 42c8e91af048
comparison
equal deleted inserted replaced
470:34ce41e014c4 471:de039f008333
629 629
630 if login_.startswith('@'): 630 if login_.startswith('@'):
631 raise Exception('No profile_key allowed') 631 raise Exception('No profile_key allowed')
632 632
633 profile_check = self.sat_host.bridge.getProfileName(login_) 633 profile_check = self.sat_host.bridge.getProfileName(login_)
634 if not profile_check or profile_check != login_ or not password_: 634 if ((not profile_check or profile_check != login_) or
635 (not password_ and profile_check not in self.sat_host.empty_password_allowed_warning_dangerous_list)):
636 return "PROFILE AUTH ERROR"
635 # profiles with empty passwords are restricted to local frontends 637 # profiles with empty passwords are restricted to local frontends
636 return "PROFILE AUTH ERROR"
637 638
638 if login_ in self.profiles_waiting: 639 if login_ in self.profiles_waiting:
639 return "ALREADY WAITING" 640 return "ALREADY WAITING"
640 641
641 def auth_eb(failure): 642 def auth_eb(failure):
1013 ['redirect_to_https', 'r', 1, _(u'Automatically redirect from HTTP to HTTPS.'), int], 1014 ['redirect_to_https', 'r', 1, _(u'Automatically redirect from HTTP to HTTPS.'), int],
1014 ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.'), int], 1015 ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.'), int],
1015 ['passphrase', 'k', '', _(u"Passphrase for the SàT profile named '%s'") % C.SERVICE_PROFILE, str], 1016 ['passphrase', 'k', '', _(u"Passphrase for the SàT profile named '%s'") % C.SERVICE_PROFILE, str],
1016 ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia'), coerceDataDir], 1017 ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia'), coerceDataDir],
1017 ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html 1018 ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html
1018 OPT_PARAMETERS_CFG = [] # Options which are in sat.conf only 1019 OPT_PARAMETERS_CFG = [['empty_password_allowed_warning_dangerous_list', None, '', None]] # Options which are in sat.conf only
1019 1020
1020 def __init__(self, *args, **kwargs): 1021 def __init__(self, *args, **kwargs):
1021 self.initialised = defer.Deferred() 1022 self.initialised = defer.Deferred()
1022 1023
1023 # options managing 1024 # options managing