From 5457236e7116d32aa7c2429adde784e1690fdf9d Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 24 Jun 2008 16:32:35 -0400 Subject: rename HTTPNegotiateAuthHandler class to HTTPKerberosAuthHandler class --- http_kerberos_auth_handler.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/http_kerberos_auth_handler.py b/http_kerberos_auth_handler.py index 76a8821..a76c243 100644 --- a/http_kerberos_auth_handler.py +++ b/http_kerberos_auth_handler.py @@ -24,7 +24,7 @@ import urllib2 as u2 import kerberos as k def getLogger(): - log = logging.getLogger("http_negotiate_auth_handler") + log = logging.getLogger("http_kerberos_auth_handler") handler = logging.StreamHandler() formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') handler.setFormatter(formatter) @@ -33,8 +33,8 @@ def getLogger(): log = getLogger() -class HTTPNegotiateAuthHandler(u2.BaseHandler): - """auth handler for urllib2 that does HTTP Negotiate Authentication +class HTTPKerberosAuthHandler(u2.BaseHandler): + """auth handler for urllib2 that does Kerberos HTTP Negotiate Authentication """ rx = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I) @@ -44,7 +44,7 @@ class HTTPNegotiateAuthHandler(u2.BaseHandler): authreq = headers.get('www-authenticate', None) if authreq: - mo = HTTPNegotiateAuthHandler.rx.search(authreq) + mo = HTTPKerberosAuthHandler.rx.search(authreq) if mo: return mo.group(1) else: @@ -66,7 +66,7 @@ class HTTPNegotiateAuthHandler(u2.BaseHandler): return None if self.retried > 5: - raise HTTPError(req.get_full_url(), 401, "negotiate auth failed", + raise HTTPError(req.get_full_url(), 401, "kerberos negotiate auth failed", headers, None) self.retried += 1 @@ -129,7 +129,7 @@ def test(): log.setLevel(logging.DEBUG) log.info("starting test") opener = u2.build_opener() - opener.add_handler(HTTPNegotiateAuthHandler()) + opener.add_handler(HTTPKerberosAuthHandler()) resp = opener.open(sys.argv[1]) print dir(resp), resp.info(), resp.code -- cgit