~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/authentication-ring.txt

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-24 07:28:00 UTC
  • mfrom: (2929.1.2 workingtree)
  • Revision ID: pqm@pqm.ubuntu.com-20071024072800-p2qtv2632xrbrs02
(robertc) Use a dictionary to obtain stat caches rather than digging into the dirstate on every path. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
Authentication definitions
71
71
--------------------------
72
72
 
73
 
There are two kinds of authentication used by the various schemes supported by
74
 
bzr:
 
73
There are two kinds of authentication used by the various schemes:
75
74
 
76
75
1. user and password
77
76
 
102
101
``password``).
103
102
 
104
103
  * ``scheme``: can be empty (meaning the rest of the definition can be used
105
 
    for any scheme), ``SFTP`` and ``bzr+ssh`` should not be used here, ``ssh``
106
 
    should be used instead since this is the real scheme regarding
107
 
    authentication,
 
104
    for any scheme),
108
105
 
109
106
  * ``host``: can be empty (to act as a default for any host),
110
107
 
111
108
  * ``port`` can be empty (useful when an host provides several servers for the
112
 
    same scheme), only numerical values are allowed, this should be used only
113
 
    when the server uses a port different than the scheme standard port,
 
109
    same scheme), only numerical values are allowed,
114
110
 
115
111
  * ``path``: can be empty (FTP or SFTP will never user it),
116
112
 
117
 
  * ``user``: can be empty (``bzr`` will defaults to python's
118
 
    ``getpass.get_user()`` and attempt another matching(see below)),
 
113
  * ``user``: can be empty (and will use the same default as ``bzr``, python's
 
114
    ``getpass.get_user()``),
119
115
 
120
116
  * ``password``: can be empty (for security reasons, a user may use the
121
 
    definitions without storing the passwords but want to be prompted ; or the
122
 
    password will be provided by an external plugin via the
123
 
    ``password_encoding`` mechanism decribed below).
 
117
    definitions without storing the passwords but want to be prompted).
124
118
 
125
119
  * ``password_encoding``: can be empty (default is ``plaintext``).
126
120
 
137
131
 
138
132
 3. ``scheme`` matches even if decorators are used in the requested URL,
139
133
 
140
 
 4. ``host`` matches exactly or act as a domain if it starts with '.'
141
 
    (``project.bzr.sf.net`` will match ``.bzr.sf.net`` but ``projectbzr.sf.net``
142
 
    will not match ``bzr.sf.net``).
 
134
 4. ``host`` matches if included in the requested URL. ``foo.net`` will match a
 
135
    requested ``bzr.foo.net``.
143
136
 
144
137
 5. ``port`` matches if included in the requested URL (exact matches only)
145
138
 
165
158
 
166
159
.. [#password_encoding] Additional password encoding methods may be defined
167
160
   that will rely on external means to store the password which, in these
168
 
   cases, will not appear anymore in the definition. It is assumed that
169
 
   additional password encodings will provide a storage outside of the file
170
 
   described here. An encoding named ``netrc`` for example will provide
171
 
   passwords by retrieving them in the ``.netrc`` file.
 
161
   cases, will not appear anymore in the definition but be provided. An
 
162
   encoding named ``netrc`` for example will provide passwords by using the
 
163
   ``.netrc`` file.
172
164
 
173
165
File format
174
166
-----------
189
181
``~/.bazaar/authentication.conf`` will use the same file format than
190
182
``~/.bazaar/bazaar.conf``.
191
183
 
192
 
Each section describes an authentication definition.
 
184
Each section will define an authentication definition.
193
185
 
194
186
The section name is an arbitrary string, only the ``DEFAULT`` value is reserved
195
187
and should appear as the *last* section.
220
212
 
221
213
This section could define:
222
214
 
223
 
  * ``user``: default user to be used (if not defined the usual
224
 
    bzr way applies, see below).
 
215
  * ``user``: default user to be used.
225
216
 
226
217
  * ``password_encoding``: default password encoding.
227
218
 
245
236
        bzr branch ftp://foo.net/bzr/branch
246
237
        bzr pull ftp://bzr.foo.net/bzr/product/branch/trunk
247
238
 
248
 
  * all connections are done with the same ``user`` (the remote one for which
249
 
    the default bzr one is not appropriate) and the password is always prompted
250
 
    with some exceptions::
 
239
  * all connections are done with the same ``user`` (the local one) and the
 
240
    password is always prompted with some exceptions::
251
241
 
252
242
        # Pet projects on hobby.net
253
243
        [hobby]
 
244
        scheme=https
254
245
        host=r.hobby.net
 
246
        verify_certificates=no
255
247
        user=jim
256
248
        password=obvious1234
257
249
        
258
250
        # Home server
259
251
        [home]
260
 
        scheme=https
261
252
        host=home.net
262
253
        user=joe
263
254
        password='c2VjcmV0LXBhc3M='
264
255
        password_encoding=base64
265
 
        verify_certificates=no # Still searching a free certificate provider
266
256
        
267
257
        [DEFAULT]
268
 
        # Our local user is barbaz, on all remote sites we're known as foobar
269
258
        user=foobar
270
259
        
271
 
  * an HTTP server and a proxy::
 
260
  * an HTTP server that also acts as a proxy (weird)::
272
261
 
273
262
        # development branches on dev server
274
263
        [dev]
286
275
        user=user2
287
276
        password=pass2
288
277
        
289
 
        # proxy
 
278
        # Pesky proxy
290
279
        [proxy]
291
280
        scheme=http
292
 
        host=proxy.company.com
293
 
        port=3128
 
281
        host=dev.company.com
294
282
        user=proxyuser1
295
283
        password=proxypass1
296
 
 
297
 
  * source hosting provider declaring sub-domains for each project::
298
 
 
299
 
        [sfnet domain]
300
 
        # we use sftp, but ssh is the scheme used for authentication
301
 
        scheme=ssh
302
 
        # The leading '.' ensures that 'sf.net' alone doesn't match
303
 
        host=.sf.net
304
 
        user=georges
305
 
        password=ben...son
306
 
 
 
284
        
 
285
Note that the proxy should be specified last because it uses no path. An
 
286
alternative is to specify the port used by the proxy.
307
287
 
308
288
UI Changes
309
289
----------
325
305
  Get a user from ``~/.bazaar/authentication.conf`` or prompt for one if none is
326
306
  found. Continue as 2.
327
307
 
328
 
Note: A user will be queried only if the server requires it for ``HTTP`` or
329
 
``HTTPS``, other protocols always require a user.
 
308
Note: A user will be queried only if the server requires it for ``HTTP``, other
 
309
protocols always require a user.
330
310
 
331
311
In any case, if the server refuses the authentication, bzr reports to the user
332
312
and terminates.
335
315
--------------------------
336
316
 
337
317
* bzr should be able to prompt for a ``user`` for a given (``scheme``, ``host``
338
 
  [, ``realm``]). Note that ``realm`` is available only after a first
 
318
  [, ``realm``]). Note that ``realm`` may be available only after a first
339
319
  connection attempt to the server.
340
320
 
341
321
* No assumptions should be made about the clients of this service