diff options
author | Unknown <tolsen@limebits.com> | 2008-06-24 16:32:35 -0400 |
---|---|---|
committer | Unknown <tolsen@limebits.com> | 2008-06-24 16:32:35 -0400 |
commit | 44d4371c887b0b1e1b2ab03af859d5e08b001a9b (patch) | |
tree | 799a546b03686b379ffedef14f02f3849406151c | |
parent | 994dc668a269424e22e62d92c6275fc1d250c26f (diff) | |
download | urllib2_kerberos-44d4371c887b0b1e1b2ab03af859d5e08b001a9b.tar.gz |
rename HTTPNegotiateAuthHandler class to HTTPKerberosAuthHandler class
-rw-r--r-- | http_kerberos_auth_handler.py | 12 |
1 files 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 |