[rfc] branch/merge/push/pull operations with remote location (sftp/ftp) that require password and GUI
John Arbash Meinel
john at arbash-meinel.com
Thu Oct 26 13:37:39 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alexander Belchenko wrote:
> I hacking Olive (Bazaar GUI) a bit and wondering how to implement
> password dialog for operations with remote locations that require
> authentications.
>
> Current bzr code seems to be intended to use password request only with
> console UI. I'd like to understand how to implement custom password
> dialog. This is probably should be done like for progress bar?
>
> --
> Alexander
For ssh, we have the problem that if we spawn a subprocess, we can't
actually give it the password. This is because at least openssh connects
directly to the terminal to ask the user (and I would assume others do
too). This is a security measure, and also what allows you to do:
"ssh host command | local_processing"
And still get a password prompt.
However, I believe for paramiko (and since you are on win32, it is
fairly likely), then you can do password prompting through
bzrlib.ui.ui_factory.get_password(prompt='%(user)s@%(host)s',
user=foo, host=bar)
We use that for some of the http code, and if we aren't using it, we
should be elsewhere.
The prompt is intended to be a plain string with %(var)s values, and the
parameters are passed in as **kwargs.
It was hoped that this would provide enough flexibility in case the
front-end wanted to have a bit of leeway in how it represented the
request to users.
So my suggestion would be to override bzrlib.ui.ui_factory with whatever
GraphicalUIFactory that you have. This should also allow you to do
progress bars (bzrlib.ui.ui_factory.nested_progress_bar(), etc).
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFQKwTJdeBCYSNAAMRAoZWAJ4hSFuYrziUsfebpgP0dpRFX6EjlgCfdWj9
/IxzWH9jZc5F/38BozWDcfU=
=iSn5
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list