diff 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
line wrap: on
line diff
--- a/roundup/cgi/client.py	Sun Jan 12 19:28:46 2020 +0000
+++ b/roundup/cgi/client.py	Mon Jan 13 09:36:40 2020 +0100
@@ -1001,10 +1001,14 @@
 
         user = None
         # first up, try http authorization if enabled
-        if self.instance.config['WEB_HTTP_AUTH']:
+        cfg = self.instance.config
+        if cfg.WEB_HTTP_AUTH:
             if 'REMOTE_USER' in self.env:
                 # we have external auth (e.g. by Apache)
                 user = self.env['REMOTE_USER']
+                if cfg.WEB_HTTP_AUTH_CONVERT_REALM_TO_LOWERCASE and '@' in user:
+                    u, d = user.split ('@', 1)
+                    user = '@'.join ((u, d.lower()))
             elif self.env.get('HTTP_AUTHORIZATION', ''):
                 # try handling Basic Auth ourselves
                 auth = self.env['HTTP_AUTHORIZATION']

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