Redirect to location protected by HTTP auth fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Vincent Ladeuil |
Bug Description
When attempting to access a URL which redirects to a new URL, where the latter URL requires HTTP Authentication, Bzr throws a KeyError on the 'user' property of request.auth
I've set up a simple test case here:
bzr info http://
As far as I can tell, the auth dictionary is populated outside of the Request object initialisation, so when the Redirect creates a new request object, it doesnt get it's auth dict populated - leading to the key errors. I was hoping to be able to provide a fix, but I got lost in the program flow, here are the points of note:
Request.auth gets initialised as empty dict - bzrlib/
Auth dict gets populated - bzrlib/
Redirect creates new Request - bzrlib/
Bzr 1.16.1, reproduced on windows vista and mac os x
C:\temp>bzr info http://
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "C:\dev\
return the_callable(*args, **kwargs)
File "C:\dev\
ret = run(*run_argv)
File "C:\dev\
return self.run(
File "C:\dev\
result = func(*args, **kwargs)
File "C:\dev\
show_
File "C:\dev\
return BzrDir.
File "C:\dev\
result = BzrDir.
File "C:\dev\
redirected)
File "C:\dev\
return obj(*args, **kwargs)
File "C:\dev\
return action(transport)
File "C:\dev\
transport, _server_
File "C:\dev\
return format.
File "C:\dev\
transport = get_svn_
File "C:\dev\
resp = bzr_transport.
File "C:\dev\
response = self._opener.
File "C:\dev\
response = meth(req, response)
File "c:\dev\
code, msg, hdrs)
File "C:\dev\
result = self._call_
File "C:\dev\
result = func(*args)
File "c:\dev\
return self.parent.
File "C:\dev\
response = meth(req, response)
File "c:\dev\
code, msg, hdrs)
File "C:\dev\
result = self._call_
File "C:\dev\
result = func(*args)
File "c:\dev\
return self.auth_
File "c:\dev\
matching_
File "c:\dev\
if auth['user'] is None or auth['password'] is None:
KeyError: 'user'
bzr 1.16.1 on python 2.5.4 (win32)
arguments: ['C:\\pys\\bzr.py', 'info', 'http://
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
bzrtools c:\dev\
gtk C:\Users\
launchpad c:\dev\
netrc_
qbzr c:\dev\
svn c:\dev\
*** Bazaar has encountered an internal error.
Please report a bug at https:/
including this traceback, and a description of what you
were doing when the error occurred.
Related branches
Changed in bzr: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
summary: |
- Redirect to location proteced by HTTP auth fails + Redirect to location protected by HTTP auth fails |
tags: | added: http urllib |
Changed in bzr: | |
milestone: | none → 2.1.0b4 |
status: | Fix Committed → Fix Released |
I have the same problem with a Loggerhead instance that is proxied by Apache. The Apache config has authentication required for the path that is being passed on the local loggerhead instance. I see the same error in this case when doing ``bzr branch http:// server. example. com/bzr/ branch_ name`` where everything under /bzr is being passed on to the loggerhead server.