~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: 2008-03-16 14:01:20 UTC
  • mfrom: (3280.2.5 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080316140120-i3yq8yr1l66m11h7
Start 1.4 development

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
This specification also proposes a way to describe credentials so that several
42
42
remote branches can use the same definition. This is particularily important
43
 
for users handling a lot of passwords and who need to update them on a regular
 
43
for users handling a lot of passwords who need to update them on a regular
44
44
basis.
45
45
 
46
46
Rationale
63
63
 
64
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
67
 
agents provide a safer way to secure the passwords, this specification is
68
 
restricted to providing ``user`` but does not provide ``password`` when used
69
 
for ssh.
 
66
comfort this specification aims to provide for all other schemes. These
 
67
specification do not try to cover these configurations by providing
 
68
pass-phrases, but the mechanisms presented *can* be used to provide users.
70
69
 
71
70
Authentication definitions
72
71
--------------------------
90
89
when prompting for the password (unless someone found a way to declare two
91
90
different realms for the same path). 
92
91
 
93
 
``HTTP proxy`` can be handled as ``HTTP`` (or ``HTTPS``) by explicitly
 
92
``HTTP proxy`` can be handled as ``HTTP`` (or ``HTTPS``) by explicitely
94
93
specifying the appropriate port.
95
94
 
96
95
.. [#ignored_realm] The true purpose of realms is to allow the same credentials
113
112
    same scheme), only numerical values are allowed, this should be used only
114
113
    when the server uses a port different than the scheme standard port,
115
114
 
116
 
  * ``path``: can be empty (FTP or SFTP will never use it),
 
115
  * ``path``: can be empty (FTP or SFTP will never user it),
117
116
 
118
117
  * ``user``: can be empty (``bzr`` will defaults to python's
119
 
    ``getpass.get_user()`` for FTP, SFTP and ssh),
 
118
    ``getpass.get_user()`` and attempt another matching(see below)),
120
119
 
121
120
  * ``password``: can be empty (for security reasons, a user may use the
122
121
    definitions without storing the passwords but want to be prompted ; or the
123
122
    password will be provided by an external plugin via the
124
 
    ``password_encoding`` mechanism decribed below). Must be left empty for
125
 
    ``ssh``.
 
123
    ``password_encoding`` mechanism decribed below).
126
124
 
127
125
  * ``password_encoding``: can be empty (default is ``plaintext``).
128
126
 
129
127
Also note that an optional ``verify_certificates=no`` field will allow the
130
128
connection to ``HTTPS`` hosts that provides a self certified certificate (the
131
 
default should be to refuse the connection and inform the user). (Not
132
 
implemented yet)
 
129
default should be to refuse the connection and inform the user).
133
130
 
134
131
Multiple definitions can be provided and, for a given URL, bzr will select a
135
132
(``user`` [, ``password``]) based on the following rules :
158
155
 
159
156
Encoding passwords in ``base64``, while weak, provides protection against
160
157
accidental reading (if an administrator have to look into the file, he will not
161
 
see the passwords in clear).(Not implemented yet).
 
158
see the passwords in clear).
162
159
 
163
 
This specification intends to ease the authentication providing, not to secure
 
160
This specification intend to ease the authentication providing, not to secure
164
161
it in the best possible way.
165
162
 
166
 
Plugins can provide additional password encodings. The provided
167
 
``netrc_credential_store`` plugin can be used as an example implementation.
168
 
 
169
163
Future versions of this specification may provide additional
170
164
encodings [#password_encoding]_.
171
165
 
173
167
   that will rely on external means to store the password which, in these
174
168
   cases, will not appear anymore in the definition. It is assumed that
175
169
   additional password encodings will provide a storage outside of the file
176
 
   described here. The ``netrc`` encoding, for example, provides passwords by
177
 
   retrieving them from the ``.netrc`` file.
 
170
   described here. An encoding named ``netrc`` for example will provide
 
171
   passwords by retrieving them in the ``.netrc`` file.
178
172
 
179
173
File format
180
174
-----------
192
186
    generally servers. The same authentification definition can even be used
193
187
    for several schemes for servers providing those schemes.
194
188
 
195
 
``~/.bazaar/authentication.conf`` will use the same file format as
 
189
``~/.bazaar/authentication.conf`` will use the same file format than
196
190
``~/.bazaar/bazaar.conf``.
197
191
 
198
192
Each section describes an authentication definition.
211
205
  * ``port``: the port the server is listening,
212
206
 
213
207
  * ``verify_certificates``: to control certificate verification (useful
214
 
    for self certified hosts). This applies to HTTPS only. Accepted values
 
208
    for self certified hosts). This applies to HTTP[S] only. Accepted values
215
209
    are yes and no, default to yes.
216
210
 
217
211
  * ``path``: the branch location,
329
323
3. No ``user`` given in the URL (and no ``password``).
330
324
 
331
325
  Get a user from ``~/.bazaar/authentication.conf`` or prompt for one if none is
332
 
  found. Continue as 2. (Not implemented yet)
 
326
  found. Continue as 2.
333
327
 
334
328
Note: A user will be queried only if the server requires it for ``HTTP`` or
335
329
``HTTPS``, other protocols always require a user.
361
355
  a password.
362
356
 
363
357
* As this specification proposes a matching between some credentials
364
 
  definitions and real urls, the implementation provides an optional UI
365
 
  feedback about which credential definition is used. Using ``-Dauth`` will
366
 
  output some traces in the ``.bzr.log`` file metionning the sections
367
 
  used. This allows the user to validate his definitions.
 
358
  definitions and real urls, the implementation should provide an optional UI
 
359
  feedback about which credential definition is used. That will allow the user
 
360
  to validate his definitions.
368
361
 
369
362
Questions and Answers
370
363
---------------------
378
371
 
379
372
  * What if a ``.netrc`` file exists ?
380
373
 
381
 
    * It is honored if the definition specifies
382
 
      ``password_encoding=netrc``.
 
374
    * It will be honored if the definition specifies
 
375
      ``password_encoding=netrc`` once the appropriate plugin have been
 
376
      written.
383
377
 
384
378
  * What mode should the authentication file use ?
385
379
 
386
380
    * 600 read/write for owner only by default, if another mode (more
387
381
      permissive) is used, a warning will be issued to inform the users of the
388
 
      potential risks.(Not implemented yet)
 
382
      potential risks.
389
383
 
390
384
  * What about using ``seahorse`` on Ubuntu or ``KeyChain Access`` on Mac OS X ?
391
385
 
396
390
    ?
397
391
 
398
392
    * yes and if the user configure a ssh-agent it will not be queried for
399
 
      pass-phrase every time we want to query the file for a password. But
400
 
      that seems a bit extreme for a first version.(Not implemented yet and
401
 
      may be never)
 
393
      pass-phrase every time we want to query the file for a password. But that
 
394
      seems a bit extreme for a first version.
402
395
 
403
396
  * Why can't bzr update the authentication file when it queried the user for a
404
397
    password ?