~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_urllib2_wrappers.py

  • Committer: Vincent Ladeuil
  • Date: 2007-10-22 15:18:24 UTC
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071022151824-eol757lk393ofc38
AuthenticationConfig can be queried for logins too (first step).

* bzrlib/transport/ssh.py:
(_paramiko_auth): Try to get a user from AuthenticationConfig.

* bzrlib/smtp_connection.py:
(SMTPConnection._authenticate): Try to get a user from
AuthenticationConfig.

* bzrlib/transport/ftp.py:
(FtpTransport._create_connection): Try to get a user from
AuthenticationConfig. Credentials are now (user, password) instead
of just password.

* bzrlib/tests/test_ftp_transport.py:
(TestFTPServerUI._add_authorized_user): Cleanup by refactoring.

* bzrlib/config.py:
(AuthenticationConfig.get_user): New method to get logins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
270
270
def extract_authentication_uri(url):
271
271
    """Extract the authentication uri from any url.
272
272
 
273
 
    In the context of bzr, we simplified the authentication uri
 
273
    In the context of bzr, we simplify the authentication uri
274
274
    to the host only. For the transport lifetime, we allow only
275
275
    one user by realm on a given host. I.e. handling several
276
276
    users for different paths for the same realm should be done
815
815
        # grok user:password@host:port as well as
816
816
        # http://user:password@host:port
817
817
 
 
818
        # FIXME: query AuthenticationConfig too
 
819
 
818
820
        # Extract credentials from the url and store them in the
819
821
        # password manager so that the proxy AuthHandler can use
820
822
        # them later.