On Sat, Aug 27, 2011 at 09:54:02PM +0200, Lukas Sandström wrote: > This Python script plugs into the credentials API > of Git to ask the user for passwords with a nice > KDE password dialog. Thanks for working on this. > .../git-kde-credentials-helper.py | 122 ++++++++++++++++++++ Can we call it git-credential-kdewallet or similar? Then users can just do: git config credential.helper kdewallet (where "kdewallet" can be whatever you think is most appropriate; the key is naming it git-credential-*). > 1 files changed, 122 insertions(+), 0 deletions(-) > create mode 100755 contrib/kde-credetials-helper/git-kde-credentials-helper.py Minor typo in directory name. > + def check_wallet(self): > + (res, data) = self.wallet.readMap(self.token) > + if res != 0: > + return None > + try: > + self.username = data[QString("username")] > + self.password = data[QString("password")] > + except KeyError: > + return None > + return self.username and self.password If I am reading this correctly, you look up based purely on the context token. Which means that if I do something like this: $ git push https://host.com/repo.git [enter username: user1, password: foo] $ git push https://user2@xxxxxxxx/other-repo.git We will invoke the helper as: git credential-kdewallet --unique=https:host.com --username=user2 but the helper will ignore the "user2" bit, and return "user1 / foo". The "cache" helper I wrote handles this situation better, by indexing both on the token and the username. I wonder if the username should become part of the token. Or if the token should really just become a canonicalized URL, minus the actual path. So the first one would get: --unique=https://host.com and the second would get: --unique=https://user2@xxxxxxxx Then helpers wouldn't need to worry about doing anything special. What do you think? Also, any comments in general on writing a helper? You are the first one besides me to do so. Did you find anything in the interface or the documentation confusing? Suggestions are very welcome, as nothing has been released yet and we're free to tweak as much as we want. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html