Rev 4053: Slight cosmetic tweaks. in file:///net/bigmamac/Volumes/home/vila/src/bzr/bugs/256612-http-auth/

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Feb 25 19:34:20 GMT 2009


At file:///net/bigmamac/Volumes/home/vila/src/bzr/bugs/256612-http-auth/

------------------------------------------------------------
revno: 4053
revision-id: v.ladeuil+lp at free.fr-20090225193419-ynaapyvufvg3nh8k
parent: v.ladeuil+lp at free.fr-20090225192444-az73q3t73x8ti6bi
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 256612-http-auth
timestamp: Wed 2009-02-25 20:34:19 +0100
message:
  Slight cosmetic tweaks.
-------------- next part --------------
=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
--- a/bzrlib/transport/http/_urllib2_wrappers.py	2009-02-25 19:24:44 +0000
+++ b/bzrlib/transport/http/_urllib2_wrappers.py	2009-02-25 19:34:19 +0000
@@ -983,11 +983,13 @@
     _max_retry = 3
     """We don't want to retry authenticating endlessly"""
 
+    requires_username = True
+    """Whether the auth mechanism requires a username."""
+
     # The following attributes should be defined by daughter
     # classes:
     # - auth_required_header:  the header received from the server
     # - auth_header: the header sent in the request
-    # - requires_username: whether the auth mechanism requires a username
 
     def __init__(self):
         # We want to know when we enter into an try/fail cycle of
@@ -1222,8 +1224,6 @@
 
     auth_regexp = re.compile('realm="([^"]*)"', re.I)
 
-    requires_username = True
-
     def build_auth_header(self, auth, request):
         raw = '%s:%s' % (auth['user'], auth['password'])
         auth_header = 'Basic ' + raw.encode('base64').strip()
@@ -1277,11 +1277,9 @@
 class DigestAuthHandler(AbstractAuthHandler):
     """A custom digest authentication handler."""
 
-    # Before basic as digest is a bit more secure
+    # Before basic as digest is a bit more secure and should be preferred
     handler_order = 490
 
-    requires_username = True
-
     def auth_params_reusable(self, auth):
         # If the auth scheme is known, it means a previous
         # authentication was successful, all information is



More information about the bazaar-commits mailing list