git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Jeff King <peff@peff.net>
Cc: roucherj <roucherj@telesun.imag.fr>,
	git@vger.kernel.org, kim-thuat.nguyen@ensimag.fr,
	pavel.volek@ensimag.fr, javier.roucher-iglesias@ensimag.fr
Subject: Re: credential-helpers + remote-helper, starting  point?
Date: Thu, 24 May 2012 22:23:07 +0200	[thread overview]
Message-ID: <vpq8vghxr9w.fsf@bauges.imag.fr> (raw)
In-Reply-To: <20120524200122.GA18936@sigill.intra.peff.net> (Jeff King's message of "Thu, 24 May 2012 16:01:22 -0400")

Jeff King <peff@peff.net> writes:

>> +When a function in Git or one of its remote-helpers needs to obtain
>> +credentials (either by asking the user or by fetching from a store),
>> +it can call the functions in the C API. These functions will fork a
>> +new process, and communicate with it by passing command-line arguments
>> +and then communicating through a pipe (see 'Credential Helpers'
>> +below).
>
> We might or might not fork a new process. It depends on which helpers
> are defined.

OK, so s/will fork/may fork/ may be more appropriate.

>> +For example, the execution of a command connecting to an HTTP server
>> +and using the credential helper "cache" will have the following
>> +structure:
>> +
>> +------------
>> ++-----+ -----> +-----------------+
>> +| git |  pipe  | git remote-http | --- to HTTP server --->
>> ++-----+ <----- +-----------------+
>> +                    ^      |
>> +                    | pipe |
>> +                    |      v
>> +             +----------------------+
>> +             | git credential-cache |
>> +             +----------------------+
>> +------------
>> +
>> +git remote-http will take care of contacting the HTTP server, do the
>> +actual authentication and see if it's accepted by the server. The
>> +credential helper will deal with the credential store (which can be
>> +done by contacting a keyring daemon) and the prompting if needed.
>
> I feel like adding remote-helpers into the mix just makes the situation
> more complex (and necessitates the diagram).

The helper is not strictly needed, but that seems to be a common
situation, so I thought describing the common case made sense.

I think it's important to show the difference between the actual
authentication process (e.g. HTTP) and the credential helper. I took
time to understand the example later:

	credential_fill(&c);
        /* [...] */
	status = send_foo_login(f, c.username, c.password);
	switch (status) {

then I understood that send_foo_login was the one doing the actual
authentication, and that further calls to the credential API was needed
to say how it went. Making explicit the fact that the Git code talks
both the helper and the server on which we are authenticating would have
helped me to understand at least.

I think mentionning the fact that a credential helper may connect to a
keyring daemon was important also. I first read some discussions about
credential helpers thinking that we would have to re-implement the
storing mechanism, and really understood what it was all about when I
saw patches for KDE support for example.

Other than that, I do like your wording. If it was just me, I'd take
your introduction, but keep my example + diagram.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2012-05-24 20:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-24 15:14 credential-helpers + remote-helper, starting point? roucherj
2012-05-24 18:21 ` Jeff King
2012-05-24 19:20   ` Matthieu Moy
2012-05-24 20:01     ` Jeff King
2012-05-24 20:23       ` Matthieu Moy [this message]
2012-05-24 22:09       ` Junio C Hamano
2012-05-25  9:15         ` Matthieu Moy
2012-05-25 13:28   ` roucherj
2012-05-25 20:35     ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpq8vghxr9w.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=javier.roucher-iglesias@ensimag.fr \
    --cc=kim-thuat.nguyen@ensimag.fr \
    --cc=pavel.volek@ensimag.fr \
    --cc=peff@peff.net \
    --cc=roucherj@telesun.imag.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).