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, 19:08 UTC
Message-ID
<CAGJzqsnd3UbCuj6xfsAgVEFz5OaDBhnCTNeAvOVPK9NWBDnDRA@mail.gmail.com>
In-Reply-To
<Y2/OIrSz+xrqkd+C@coredump.intra.peff.net>
On Sat, 12 Nov 2022 at 16:47, Jeff King <peff@peff.net> wrote:
Show 16 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.
> >
>
> What you're doing works fine with the code as-is; you just can't carry
> extra data (like a ttl) between the two.

FWIW I have a draft patch that adds password_expiry_utc and oauth_refresh_token attributes to credential https://github.com/gitgitgadget/git/pull/1394 introducing expiry logic in the credential layer. I'll share a RFC sometime in future.

> I agree for GitHub's tokens that the times involved make auto-expiration
> not that important. The example back in that thread was something more
> time-limited (like minutes or hours). I don't know how often that kind
> of things is in the wild.

GitLab OAuth tokens expire after 2 hours (the refresh tokens are valid longer). This is a security improvement over long-lived tokens.

Previous: Jeff KingNext: Jeff King
Message 11 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.