From 2c49710c08f9ab2498b941e93a4297e5af679e71 Mon Sep 17 00:00:00 2001 From: David Trowbridge Date: Sat, 28 Nov 2009 14:00:32 -0800 Subject: 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/ --- AUTHORS | 1 + rbtools/postreview.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 765c328..277a5ad 100644 --- a/AUTHORS +++ b/AUTHORS @@ -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) -- cgit v1.2.3