From: Michal Nazarewicz <mina86@mina86•com>
To: Jeff King <peff@peff•net>
Cc: Junio C Hamano <gitster@pobox•com>,
Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>,
git@vger•kernel.org
Subject: Re: [PATCHv3 5/5] git-send-email: use git credential to obtain password
Date: Mon, 11 Feb 2013 18:17:27 +0100 [thread overview]
Message-ID: <xa1tmwvag47s.fsf@mina86.com> (raw)
In-Reply-To: <20130211170134.GE16402@sigill.intra.peff.net>
[-- Attachment #1: Type: text/plain, Size: 1877 bytes --]
> On Mon, Feb 11, 2013 at 05:23:39PM +0100, Michal Nazarewicz wrote:
>> + # TODO: Authentication may fail not because credentials were
>> + # invalid but due to other reasons, in which we should not
>> + # reject credentials.
>> + $auth = Git::credential({
>> + 'protocol' => 'smtp',
>> + 'host' => join(':', $smtp_server, $smtp_server_port),
>> + 'username' => $smtp_authuser,
>> + # if there's no password, "git credential fill" will
>> + # give us one, otherwise it'll just pass this one.
>> + 'password' => $smtp_authpass
>> + }, sub {
>> + my $cred = shift;
>> + return !!$smtp->auth($cred->{'username'}, $cred->{'password'});
>> + });
On Mon, Feb 11 2013, Jeff King wrote:
> What do we want to do about this TODO?
>
> I am happy to put it off until it becomes a problem, but I wonder if the
> Git::credential() interface is sufficient to express what we would want.
> It only allows two return values: true for approve, false for reject.
> But we would want a tri-state: approve, reject, indeterminate.
Being it tri-state is not a problem. The last can be easily represented
by undef.
> Reading the Net::SMTP code, it doesn't look like the information is even
> available to us (it really just passes out success or failure), so I
> don't think we can even make it work now. But it may be better to
> prepare the public Git::credential interface for it now, so we do not
> have to deal with breaking compatibility later.
I guess. I left it as is since git-send-email won't make use of the
indeterminate values, but I can add it in this patchset as well.
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +----<email/xmpp: mpn@google•com>--------------ooO--(_)--Ooo--
[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]
next prev parent reply other threads:[~2013-02-11 17:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-11 16:23 [PATCHv3 0/5] Add git-credential support to git-send-email Michal Nazarewicz
2013-02-11 16:23 ` [PATCHv3 1/5] Git.pm: allow command_close_bidi_pipe to be called as method Michal Nazarewicz
2013-02-11 16:23 ` [PATCHv3 2/5] Git.pm: fix example in command_close_bidi_pipe documentation Michal Nazarewicz
2013-02-11 16:23 ` [PATCHv3 3/5] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe Michal Nazarewicz
2013-02-11 16:23 ` [PATCHv3 4/5] Git.pm: add interface for git credential command Michal Nazarewicz
2013-02-11 16:53 ` Jeff King
2013-02-11 17:14 ` Michal Nazarewicz
2013-02-11 17:36 ` Jeff King
2013-02-11 16:23 ` [PATCHv3 5/5] git-send-email: use git credential to obtain password Michal Nazarewicz
2013-02-11 17:01 ` Jeff King
2013-02-11 17:17 ` Michal Nazarewicz [this message]
2013-02-11 17:31 ` Jeff King
2013-02-11 16:51 ` [PATCHv3 0/5] Add git-credential support to git-send-email Jeff King
2013-02-11 17:18 ` Michal Nazarewicz
2013-02-11 17:48 ` Jeff King
2013-02-11 18:40 ` Michal Nazarewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xa1tmwvag47s.fsf@mina86.com \
--to=mina86@mina86$(echo .)com \
--cc=Matthieu.Moy@grenoble-inp$(echo .)fr \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox