git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] docs: clarify that credential discards unrecognised attributes

From
M Hickford <mirth.hickford@gmail.com>
Date
Nov 12, 2022, 02:21 UTC
Message-ID
<CAGJzqsmH0DpEZDVZYU=6XpBO_vPfbirrK7KaWm2RmKG3aAk0oA@mail.gmail.com>
In-Reply-To
<Y1cm2a3qy9aowwNh@coredump.intra.peff.net>
On Tue, 25 Oct 2022 at 00:59, Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
>
> 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

Show 12 quoted lines
> 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.

Show 5 quoted lines
> 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

Previous: Junio C HamanoNext: Jeff King
Message 9 of 13 in “docs: clarify that credential discards unrecognised attributes”
  1. docs: clarify that credential discards unrecognised attributesM Hickford via GitGitGadget, Oct 24, 2022
  2. Jeff KingOct 24, 2022
  3. Jeff KingOct 25, 2022
  4. ThanksM Hickford, Oct 25, 2022
  5. Bagas SanjayaOct 25, 2022
  6. M HickfordOct 26, 2022
  7. Jeff KingOct 26, 2022
  8. Junio C HamanoOct 26, 2022
  9. M HickfordNov 12, 2022
  10. Jeff KingNov 12, 2022
  11. M HickfordNov 12, 2022
  12. Jeff KingNov 14, 2022
  13. Taylor BlauNov 13, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.