diff options
author | David Trowbridge <trowbrds@gmail.com> | 2009-11-28 14:00:32 -0800 |
---|---|---|
committer | David Trowbridge <trowbrds@gmail.com> | 2009-11-28 14:01:36 -0800 |
commit | 2c49710c08f9ab2498b941e93a4297e5af679e71 (patch) | |
tree | 9bb9fd3f2bcd4e09db555b9bd1e9b06e5af17dac | |
parent | 30ad034ad82b58ca878826b9260d83b321e8144a (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/
-rw-r--r-- | AUTHORS | 1 | ||||
-rwxr-xr-x | rbtools/postreview.py | 13 |
2 files changed, 9 insertions, 5 deletions
@@ -18,5 +18,6 @@ Contributors: * Matthew Woehlke * Paul Scott * Raghu Kaippully + * Ryan Oblak * Stacey Sheldon * Steven Russell 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) |