Rev 4799: Protect more access to 'user' and 'password' auth attributes. in file:///home/vila/src/bzr/reviews/395714-auth-redirect/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Nov 26 13:08:41 GMT 2009
At file:///home/vila/src/bzr/reviews/395714-auth-redirect/
------------------------------------------------------------
revno: 4799
revision-id: v.ladeuil+lp at free.fr-20091126130840-jg8c4izdu06gdam2
parent: v.ladeuil+lp at free.fr-20091125150209-v3vxrbs38qq54ade
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 395714-auth-redirect
timestamp: Thu 2009-11-26 14:08:40 +0100
message:
Protect more access to 'user' and 'password' auth attributes.
* bzrlib/transport/http/_urllib2_wrappers.py:
(AbstractAuthHandler.get_user_password): Again, 'user' and
'password' may not yet been set.
-------------- next part --------------
=== modified file 'bzrlib/transport/http/__init__.py'
--- a/bzrlib/transport/http/__init__.py 2009-08-19 16:33:39 +0000
+++ b/bzrlib/transport/http/__init__.py 2009-11-26 13:08:40 +0000
@@ -154,7 +154,7 @@
None, None, self._host, self._port, path)
def _create_auth(self):
- """Returns a dict returning the credentials provided at build time."""
+ """Returns a dict containing the credentials provided at build time."""
auth = dict(host=self._host, port=self._port,
user=self._user, password=self._password,
protocol=self._unqualified_scheme,
=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
--- a/bzrlib/transport/http/_urllib2_wrappers.py 2009-11-25 15:02:09 +0000
+++ b/bzrlib/transport/http/_urllib2_wrappers.py 2009-11-26 13:08:40 +0000
@@ -1167,8 +1167,8 @@
and then during dialog with the server).
"""
auth_conf = config.AuthenticationConfig()
- user = auth['user']
- password = auth['password']
+ user = auth.get('user'. None)
+ password = auth.get('password', None)
realm = auth['realm']
if user is None:
More information about the bazaar-commits
mailing list