summaryrefslogtreecommitdiff
path: root/rbtools
diff options
context:
space:
mode:
authorDavid Trowbridge <trowbrds@gmail.com>2009-11-28 14:00:32 -0800
committerDavid Trowbridge <trowbrds@gmail.com>2009-11-28 14:01:36 -0800
commit2c49710c08f9ab2498b941e93a4297e5af679e71 (patch)
tree9bb9fd3f2bcd4e09db555b9bd1e9b06e5af17dac /rbtools
parent30ad034ad82b58ca878826b9260d83b321e8144a (diff)
Add HTTP Digest Authentication to post-review
Patch from Ryan Oblak to add support for HTTP Digest Authentication to post-review. It was really trivial given the work already added in for HTTP Basic Authentication. Testing done: This has been tested on my Review Board 1.1 alpha 1 installation with Digest, Basic, and no authentication. Reviewed at http://reviews.reviewboard.org/r/1265/
Diffstat (limited to 'rbtools')
-rwxr-xr-xrbtools/postreview.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/rbtools/postreview.py b/rbtools/postreview.py
index 3bbd8ca..c157277 100755
--- a/rbtools/postreview.py
+++ b/rbtools/postreview.py
@@ -277,11 +277,14 @@ class ReviewBoardServer(object):
self.cookie_jar = cookielib.MozillaCookieJar(self.cookie_file)
# Set up the HTTP libraries to support all of the features we need.
- cookie_handler = urllib2.HTTPCookieProcessor(self.cookie_jar)
- password_mgr = ReviewBoardHTTPPasswordMgr(self.url)
- auth_handler = urllib2.HTTPBasicAuthHandler(password_mgr)
-
- opener = urllib2.build_opener(cookie_handler, auth_handler)
+ cookie_handler = urllib2.HTTPCookieProcessor(self.cookie_jar)
+ password_mgr = ReviewBoardHTTPPasswordMgr(self.url)
+ basic_auth_handler = urllib2.HTTPBasicAuthHandler(password_mgr)
+ digest_auth_handler = urllib2.HttpDigestAuthHandler(password_mgr)
+
+ opener = urllib2.build_opener(cookie_handler,
+ basic_auth_handler,
+ digest_auth_handler)
opener.addheaders = [('User-agent', 'post-review/' + VERSION)]
urllib2.install_opener(opener)