Authentication problems while porting Bazaar to other languages
tprimke at gmail.com
Mon May 12 12:26:12 BST 2008
I'm working on Bazaar library for Java developers (yes, I know about
bzr-eclipse; I don't understand its code, I don't intend to study it
nor to try to use it for NetBeans plugin I'm going to write) and I
have encountered a problem with authentication. This message is for
other developers who might have had similar problems (and, eventually,
have them solved already... ?).
The problem is quite simple to describe and to understand, but it
seems to be more complex to solve.
I think there are two ways to make a Bazaar binding for another
1) A language-specific Python binding can be used. In case of Java it
can be Jython (which is, to my best knowledge, the only Python
interpreter for Java platform).
Since this approach requires such a Python interpreter available, it
is possible only for those languages, for which such interpreter is
available. No Python interpreter for, say, Perl? Sorry, Perl
developers, you can't integrate Bazaar into your code this way.
2) Bazaar is a console application: it produces some output. This
output can be parsed... In this way it is possible to simply call
proper Bazaar command (usually using some "exec" function) and to get
its output and provide it in some more language-specific way to this
The big advantage of this approach is the fact, that it is possible in
any language which allows to run system commands (and since it is
possible in almost any programming language... :) ).
I have chosen the second approach. It's quite simple, if you ask me...
However, there is some problem with this approach. It works as long as
everything can be done with parsing Bazaar commands' output. And there
are commands which use bzr+ssh, which might prompt user for
The problem is this password is read directly from terminal, not from
stdin! (Yeah, I know, it's for security reasons...) So forget about
sending this password to Bazaar command's stdin.
Well, I have told you the story, so I can ask my question now.
How you, developers of other Bazaar bindings for languages different
than Python, have managed this problem? How have you implemented
"pull" and "push" commands?
This is also question for Bazaar GUI developers: how do you handle
passwords? How do you pass passwords to Bazaar?
More information about the bazaar