/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
hazard (see `bug #34685
51
51
<https://launchpad.net/products/bzr/+bug/34685>`_).
52
52
 
53
 
Storing passwords in ``~/.config/breezy/breezy.conf`` or
54
 
``~/.config/breezy/locations.conf`` is also a security risk.
 
53
Storing passwords in ``~/.bazaar/bazaar.conf`` or ``~/.bazaar/locations.conf``
 
54
is also a security risk.
55
55
 
56
56
Typing user and passwords is error-prone and boring.
57
57
 
61
61
This specification describes a way to provide user and passwords to bzr while
62
62
storing them in a relatively safe way.
63
63
 
64
 
Note that SSH servers can be configured to use keys instead of (``user``,
 
64
Note that ssh servers can be configured to use keys instead of (``user``,
65
65
``password``) and, when used with appropriate agents, provide the same kind of
66
 
comfort this specification aims to provide for all other schemes. Since SSH 
 
66
comfort this specification aims to provide for all other schemes. Since ssh
67
67
agents provide a safer way to secure the passwords, this specification is
68
68
restricted to providing ``user`` but does not provide ``password`` when used
69
 
for SSH.
 
69
for ssh.
70
70
 
71
71
Authentication definitions
72
72
--------------------------
77
77
1. user and password
78
78
 
79
79
``FTP`` and ``SFTP`` needs a (``user``, ``password``) to authenticate against a
80
 
``host`` (SFTP can use SSH keys too, but we don't talk about that in this
81
 
specification as SSH agents provide a better solution).
 
80
``host`` (SFTP can use ssh keys too, but we don't talk about that in this
 
81
specification as ssh agents provide a better solution).
82
82
 
83
83
2. user, realm and password
84
84
 
115
115
 
116
116
  * ``path``: can be empty (FTP or SFTP will never use it),
117
117
 
118
 
  * ``user``: can be empty (``bzr`` will defaults to Python's
119
 
    ``getpass.get_user()`` for FTP, SFTP and SSH),
 
118
  * ``user``: can be empty (``bzr`` will defaults to python's
 
119
    ``getpass.get_user()`` for FTP, SFTP and ssh),
120
120
 
121
121
  * ``password``: can be empty (for security reasons, a user may use the
122
122
    definitions without storing the passwords but want to be prompted ; or the
158
158
 
159
159
Encoding passwords in ``base64``, while weak, provides protection against
160
160
accidental reading (if an administrator have to look into the file, he will not
161
 
see the passwords in clear).
 
161
see the passwords in clear).(Not implemented yet).
162
162
 
163
163
This specification intends to ease the authentication providing, not to secure
164
164
it in the best possible way.
179
179
File format
180
180
-----------
181
181
 
182
 
Even if ``~/.config/breezy/breezy.conf`` and
183
 
``~/.config/breezy/locations.conf`` seems to provide most of the needed
184
 
infrastructure, we choose to use a dedicated file
185
 
for the authentication info ``~/.config/breezy/authentication.conf`` for the following
 
182
Even if ``~/.bazaar/bazaar.conf`` and ``~/.bazaar/locations.conf`` seems to
 
183
provide most of the needed infrastructure, we choose to use a dedicated file
 
184
for the authentication info ``~/.bazaar/authentication.conf`` for the following
186
185
reasons:
187
186
 
188
187
  * allow the user to protect the content of one file only, relaxing security
193
192
    generally servers. The same authentification definition can even be used
194
193
    for several schemes for servers providing those schemes.
195
194
 
196
 
``~/.config/breezy//authentication.conf`` will use the same file format as
197
 
``~/.config/breezy/breezy.conf``.
 
195
``~/.bazaar/authentication.conf`` will use the same file format as
 
196
``~/.bazaar/bazaar.conf``.
198
197
 
199
198
Each section describes an authentication definition.
200
199
 
267
266
        scheme=https
268
267
        host=home.net
269
268
        user=joe
270
 
        # Obtain the base64 encoded password by running 'echo -n "secret-pass" | base64'
271
269
        password='c2VjcmV0LXBhc3M='
272
270
        password_encoding=base64
273
271
        verify_certificates=no # Still searching a free certificate provider
305
303
  * source hosting provider declaring sub-domains for each project::
306
304
 
307
305
        [sfnet domain]
308
 
        # we use SFTP, but SSH is the scheme used for authentication
 
306
        # we use sftp, but ssh is the scheme used for authentication
309
307
        scheme=ssh
310
308
        # The leading '.' ensures that 'sf.net' alone doesn't match
311
309
        host=.sf.net
325
323
 
326
324
2. ``user`` given in the URL.
327
325
 
328
 
  Get a password from ``~/.config/breezy/authentication.conf`` or prompt
 
326
  Get a password from ``~/.bazaar/authentication.conf`` or prompt
329
327
  for one if none is found.
330
328
 
331
329
3. No ``user`` given in the URL (and no ``password``).
332
330
 
333
 
  Get a user from ``~/.config/breezy/authentication.conf`` or prompt for one if
334
 
  none is found. Continue as 2. (Not implemented yet)
 
331
  Get a user from ``~/.bazaar/authentication.conf`` or prompt for one if none is
 
332
  found. Continue as 2. (Not implemented yet)
335
333
 
336
334
Note: A user will be queried only if the server requires it for ``HTTP`` or
337
335
``HTTPS``, other protocols always require a user.
349
347
* No assumptions should be made about the clients of this service
350
348
  (i.e. Transport is the primary target but plugins must be able to use it as
351
349
  well, the definitions used: (``scheme, host, [port,] path``) are general
352
 
  enough to described credentials for ``svn`` servers or LaunchPad XML-RPC
 
350
  enough to described credentials for ``svn`` servers or LaunchPad xmlrpc
353
351
  calls).
354
352
 
355
353
* Policies regarding default users may be taken into account by the
363
361
  a password.
364
362
 
365
363
* As this specification proposes a matching between some credentials
366
 
  definitions and real URLs, the implementation provides an optional UI
 
364
  definitions and real urls, the implementation provides an optional UI
367
365
  feedback about which credential definition is used. Using ``-Dauth`` will
368
 
  output some traces in the ``brz.log`` file metionning the sections
 
366
  output some traces in the ``.bzr.log`` file metionning the sections
369
367
  used. This allows the user to validate his definitions.
370
368
 
371
369
Questions and Answers
394
392
    * plugins can be written and registered to handle the associated
395
393
      ``password_encoding``.
396
394
 
397
 
  * Could it be possible to encode the whole authentication file with an SSH key
 
395
  * Could it be possible to encode the whole authentication file with a ssh key
398
396
    ?
399
397
 
400
398
    * yes and if the user configure a ssh-agent it will not be queried for