Skip to content

Commit b62aaa4

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent d469f0f commit b62aaa4

File tree

5 files changed

+41
-28
lines changed

5 files changed

+41
-28
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Fixed:
99
- fix handling of invalid interval input
1010
- search locale files relative ro roundup installation path (sf bug 1219689)
1111
- use translation for boolean property rendering (sf bug 1225152)
12+
- enabled disabling of REMOTE_USER for when it's not a valid username (sf
13+
bug 1190187)
14+
- fix invocation of hasPermission from templating code (sf bug 1224172)
1215

1316

1417
2005-05-02 0.8.3

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ Dougal Scott,
135135
Stefan Seefeld,
136136
Jouni K Seppanen,
137137
Jeffrey P Shell,
138+
Dan Shidlovsky,
138139
Joel Shprentz,
139140
Terrel Shumway,
140141
Emil Sit,

roundup/cgi/client.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.211.2.1 2005-01-05 22:02:05 richard Exp $
1+
# $Id: client.py,v 1.211.2.2 2005-06-24 05:28:24 richard Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -396,32 +396,33 @@ def determine_user(self):
396396

397397
# first up, try the REMOTE_USER var (from HTTP Basic Auth handled
398398
# by a front-end HTTP server)
399-
if self.env.has_key('REMOTE_USER'):
400-
user = self.env['REMOTE_USER']
401-
else:
402-
user = 'anonymous'
399+
use_http_auth = self.instance.config['WEB_HTTP_AUTH'] == 'yes'
400+
user = 'anonymous'
401+
if use_http_auth:
402+
if self.env.has_key('REMOTE_USER'):
403+
user = self.env['REMOTE_USER']
404+
# try handling Basic Auth ourselves
405+
elif self.env.get('HTTP_AUTHORIZATION', ''):
406+
auth = self.env['HTTP_AUTHORIZATION']
407+
scheme, challenge = auth.split(' ', 1)
408+
if scheme.lower() == 'basic':
409+
try:
410+
decoded = base64.decodestring(challenge)
411+
except TypeError:
412+
# invalid challenge
413+
pass
414+
username, password = decoded.split(':')
415+
try:
416+
login = self.get_action_class('login')(self)
417+
login.verifyLogin(username, password)
418+
except LoginError, err:
419+
self.make_user_anonymous()
420+
self.response_code = 403
421+
raise Unauthorised, err
422+
423+
user = username
403424

404-
# try handling Basic Auth ourselves
405-
if (user == 'anonymous') and self.env.get('HTTP_AUTHORIZATION', ''):
406-
scheme, challenge = self.env['HTTP_AUTHORIZATION'].split(' ', 1)
407-
if scheme.lower() == 'basic':
408-
try:
409-
decoded = base64.decodestring(challenge)
410-
except TypeError:
411-
# invalid challenge
412-
pass
413-
username, password = decoded.split(':')
414-
try:
415-
self.get_action_class('login')(self).verifyLogin(
416-
username, password)
417-
except LoginError, err:
418-
self.make_user_anonymous()
419-
self.response_code = 403
420-
raise Unauthorised, err
421-
422-
user = username
423-
424-
# look up the user session cookie (may override the REMOTE_USER)
425+
# look up the user session cookie (may override the HTTP Basic Auth)
425426
cookie = self.cookie
426427
if (cookie.has_key(self.cookie_name) and
427428
cookie[self.cookie_name].value != 'deleted'):

roundup/cgi/templating.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def hasPermission(self, permission, classname=_marker,
10551055
if classname is self._marker:
10561056
classname = self._client.classname
10571057
return self._client.db.security.hasPermission(permission,
1058-
self._nodeid, classname)
1058+
self._nodeid, classname, property, itemid)
10591059

10601060
def HTMLItem(client, classname, nodeid, anonymous=0):
10611061
if classname == 'user':

roundup/configuration.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Roundup Issue Tracker configuration support
22
#
3-
# $Id: configuration.py,v 1.23.2.2 2005-02-14 02:55:30 richard Exp $
3+
# $Id: configuration.py,v 1.23.2.3 2005-06-24 05:28:24 richard Exp $
44
#
55
__docformat__ = "restructuredtext"
66

@@ -467,6 +467,14 @@ class NullableFilePathOption(NullableOption, FilePathOption):
467467
"by OS environment variable LANGUAGE, LC_ALL, LC_MESSAGES,\n"
468468
"or LANG, in that order of preference."),
469469
)),
470+
("web", (
471+
(Option, 'http_auth', "yes",
472+
"Whether to use HTTP Basic Authentication, if present.\n"
473+
"Roundup will use either the REMOTE_USER or HTTP_AUTHORIZATION\n"
474+
"variables supplied by your web server (in that order).\n"
475+
"Set this option to 'no' if you do not wish to use HTTP Basic\n"
476+
"Authentication in your web interface."),
477+
)),
470478
("rdbms", (
471479
(Option, 'name', 'roundup',
472480
"Name of the database to use.",

0 commit comments

Comments
 (0)