Merge lp:~jelmer/bzr/missing-get-revdelta into lp:~bzr/bzr/trunk-old

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jelmer/bzr/missing-get-revdelta
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: None lines
To merge this branch: bzr merge lp:~jelmer/bzr/missing-get-revdelta
To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

The attached patch allows AuthHandlers in the HTTP code to indicate that
they do not require a username.

This means it's possible to use GSSAPI authentication without a username in
the URL.

Cheers,

 Jelmer

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
2--- bzrlib/transport/http/_urllib2_wrappers.py 2009-02-17 14:46:26 +0000
3+++ bzrlib/transport/http/_urllib2_wrappers.py 2009-02-18 16:23:31 +0000
4@@ -987,6 +987,7 @@
5 # classes:
6 # - auth_required_header: the header received from the server
7 # - auth_header: the header sent in the request
8+ # - requires_username: whether the auth mechanism requires a username
9
10 def __init__(self):
11 # We want to know when we enter into an try/fail cycle of
12@@ -1034,7 +1035,7 @@
13 # We already tried that, give up
14 return None
15
16- if auth.get('user', None) is None:
17+ if self.requires_username and auth.get('user', None) is None:
18 # Without a known user, we can't authenticate
19 return None
20
21@@ -1158,6 +1159,8 @@
22
23 handler_order = 480
24
25+ requires_username = False
26+
27 def auth_match(self, header, auth):
28 scheme = header.lower()
29 if scheme != 'negotiate':
30@@ -1203,6 +1206,8 @@
31
32 auth_regexp = re.compile('realm="([^"]*)"', re.I)
33
34+ requires_username = True
35+
36 def build_auth_header(self, auth, request):
37 raw = '%s:%s' % (auth['user'], auth['password'])
38 auth_header = 'Basic ' + raw.encode('base64').strip()
39@@ -1260,6 +1265,8 @@
40 # Before basic as digest is a bit more secure
41 handler_order = 490
42
43+ requires_username = True
44+
45 def auth_params_reusable(self, auth):
46 # If the auth scheme is known, it means a previous
47 # authentication was successful, all information is