git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: M Hickford <mirth.hickford@gmail.com>
To: Jeff King <peff@peff.net>
Cc: M Hickford via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, M Hickford <mirth.hickford@gmail.com>
Subject: Re: [PATCH] docs: clarify that credential discards unrecognised attributes
Date: Sat, 12 Nov 2022 02:21:24 +0000	[thread overview]
Message-ID: <CAGJzqsmH0DpEZDVZYU=6XpBO_vPfbirrK7KaWm2RmKG3aAk0oA@mail.gmail.com> (raw)
In-Reply-To: <Y1cm2a3qy9aowwNh@coredump.intra.peff.net>

On Tue, 25 Oct 2022 at 00:59, Jeff King <peff@peff.net> wrote:
>
> On Mon, Oct 24, 2022 at 07:57:48AM +0000, M Hickford via GitGitGadget wrote:
>
> > It was previously unclear how unrecognised attributes are handled.
>
> Yeah, this was always part of the intended behavior, but I agree we did
> not say it very explicitly (aside from an in-code comment!). Both the
> intent and content of your patch look good to me.

Thanks. What happens next? I should look for this change in the seen
branch? https://git-scm.com/docs/MyFirstContribution#after-approval

> We did discuss patches a long time ago that would let Git carry
> arbitrary keys between helpers, even if Git itself didn't understand it.
> One of the intended uses was to let helpers talk to each other about
> TTLs. So if you had say:
>
>   [credential]
>   helper = generate-some-token
>   helper = cache
>
> where the first helper generates a token, and the second caches it, the
> first one could shove a "ttl" or "expiration" key into the protocol,
> which the cache could then learn to respect.

Composing helpers like this is how I encourage users to configure
git-credential-oauth [1][2]. Note that the storage helper should come
*before* the generator, so that `credential fill` finds a stored
credential before it generates a fresh credential.

> the first one could shove a "ttl" or "expiration" key into the protocol,
> which the cache could then learn to respect.
>
> But we never merged such a thing, and in practice I think people would
> just implement both parts as a single helper for simplicity.

Composing helpers has the advantage that the user can choose their
preferred storage. Generated credentials aren't necessarily short
lived. GitHub OAuth tokens, for example, are good for at least one
year [3].

[1] https://lore.kernel.org/git/CAGJzqs=+fCQzkDX53H8Mz-DjXicVVgRmmzPjkatSiOpYO7wGGA@mail.gmail.com/
[2] https://github.com/hickford/git-credential-oauth
[3] https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocation#token-expired-due-to-lack-of-use

  parent reply	other threads:[~2022-11-12  2:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24  7:57 [PATCH] docs: clarify that credential discards unrecognised attributes M Hickford via GitGitGadget
2022-10-24 23:59 ` Jeff King
2022-10-25  0:00   ` Jeff King
2022-10-25  1:51   ` Thanks M Hickford
2022-10-25  9:05     ` Thanks Bagas Sanjaya
2022-10-26  4:39       ` Thanks M Hickford
2022-10-26  5:18         ` Thanks Jeff King
2022-10-26  9:36         ` Thanks Junio C Hamano
2022-11-12  2:21   ` M Hickford [this message]
2022-11-12 16:47     ` [PATCH] docs: clarify that credential discards unrecognised attributes Jeff King
2022-11-12 19:08       ` M Hickford
2022-11-14 22:40         ` Jeff King
2022-11-13  4:56       ` Taylor Blau

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='CAGJzqsmH0DpEZDVZYU=6XpBO_vPfbirrK7KaWm2RmKG3aAk0oA@mail.gmail.com' \
    --to=mirth.hickford@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=peff@peff.net \
    /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).