comparison roundup/cgi/client.py @ 6053:380dec305c28

Add config option 'http_auth_convert_realm_to_lowercase'
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 13 Jan 2020 09:36:40 +0100
parents 6ed03d01491d
children a3221c686736
comparison
equal deleted inserted replaced
6052:302eceff0c49 6053:380dec305c28
999 # take the opportunity to cleanup expired sessions and otks 999 # take the opportunity to cleanup expired sessions and otks
1000 self.clean_up() 1000 self.clean_up()
1001 1001
1002 user = None 1002 user = None
1003 # first up, try http authorization if enabled 1003 # first up, try http authorization if enabled
1004 if self.instance.config['WEB_HTTP_AUTH']: 1004 cfg = self.instance.config
1005 if cfg.WEB_HTTP_AUTH:
1005 if 'REMOTE_USER' in self.env: 1006 if 'REMOTE_USER' in self.env:
1006 # we have external auth (e.g. by Apache) 1007 # we have external auth (e.g. by Apache)
1007 user = self.env['REMOTE_USER'] 1008 user = self.env['REMOTE_USER']
1009 if cfg.WEB_HTTP_AUTH_CONVERT_REALM_TO_LOWERCASE and '@' in user:
1010 u, d = user.split ('@', 1)
1011 user = '@'.join ((u, d.lower()))
1008 elif self.env.get('HTTP_AUTHORIZATION', ''): 1012 elif self.env.get('HTTP_AUTHORIZATION', ''):
1009 # try handling Basic Auth ourselves 1013 # try handling Basic Auth ourselves
1010 auth = self.env['HTTP_AUTHORIZATION'] 1014 auth = self.env['HTTP_AUTHORIZATION']
1011 try: 1015 try:
1012 scheme, challenge = auth.split(' ', 1) 1016 scheme, challenge = auth.split(' ', 1)

Roundup Issue Tracker: http://roundup-tracker.org/