Part of bzrlib.config View In Hierarchy
Implements the authentication.conf file described in doc/developers/authentication-ring.txt.
| Method | __init__ | Undocumented |
| Method | get_credentials | Returns the matching credentials from authentication.conf file. |
| Method | set_credentials | Set authentication credentials for a host. |
| Method | get_user | Get a user from authentication file. |
| Method | get_password | Get a password from authentication file or prompt the user for one. |
| Method | decode_password | Undocumented |
| Method | _get_config | Undocumented |
| Method | _save | Save the config file, only tests should use it for now. |
| Method | _set_option | Set an authentication configuration option |
Returns the matching credentials from authentication.conf file.
:param scheme: protocol
:param host: the server address
:param port: the associated port (optional)
:param user: login (optional)
:param path: the absolute path on the server (optional)
:param realm: the http authentication realm (optional)
:return: A dict containing the matching credentials or None.
This includes:
- name: the section name of the credentials in the
authentication.conf file,
- user: can't be different from the provided user if any,
- scheme: the server protocol,
- host: the server address,
- port: the server port (can be None),
- path: the absolute server path (can be None),
- realm: the http specific authentication realm (can be None),
- password: the decoded password, could be None if the credential
defines only the user
- verify_certificates: https specific, True if the server
certificate should be verified, False otherwise.
Any existing credentials with matching scheme, host, port and path will be deleted, regardless of name.
| Parameters | name | An arbitrary name to describe this set of credentials. |
| host | Name of the host that accepts these credentials. | |
| user | The username portion of these credentials. | |
| scheme | The URL scheme (e.g. ssh, http) the credentials apply to. | |
| password | Password portion of these credentials. | |
| port | The IP port on the host that these credentials apply to. | |
| path | A filesystem path on the host that these credentials apply to. | |
| verify_certificates | On https, verify server certificates if True. | |
| realm | The http authentication realm (optional). |
| Parameters | scheme | protocol |
| host | the server address | |
| port | the associated port (optional) | |
| realm | the realm sent by the server (optional) | |
| path | the absolute path on the server (optional) | |
| ask | Ask the user if there is no explicitly configured username (optional) | |
| default | The username returned if none is defined (optional). | |
| Returns | The found user. | |
| Parameters | scheme | protocol |
| host | the server address | |
| port | the associated port (optional) | |
| user | login | |
| realm | the realm sent by the server (optional) | |
| path | the absolute path on the server (optional) | |
| Returns | The found password or the one entered by the user. | |