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

Re: Remembering which http remotes require authentication

From
M Hickford <mirth.hickford@gmail.com>
Date
Jun 21, 2023, 06:30 UTC
Message-ID
<CAGJzqsnU9HOCWOOaMdUcNzSDWg6wUqK0bhNvtNAv82yeCkHwgQ@mail.gmail.com>
In-Reply-To
<xmqqh6rc72k8.fsf@gitster.g>
On Mon, 12 Jun 2023 at 23:12, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
>
> M Hickford <mirth.hickford@gmail.com> writes:
>
> > Could Git remember which remotes require authentication for which
> > operations?
>
> Interesting idea.
>
> Credential helpers may know which URL needed authentication before,
> but that is not per operation.  I wonder if it is sufficient as the
> zeroth approximation to always try authenticated access if helpers
> have any auth material to the URL regardless of the operation?

The simplicity appeals. A challenge is that `helper get` may be slow or even block requiring user interaction (to unlock a keyring or complete OAuth). A solution could be to introduce a new action `get-existing` or `fast-get` to the helper protocol. Storage helpers would handle this similarly to `get` (unless a keyring is locked). Credential-generating helpers would refrain from generating fresh credentials.

However as Brian pointed out, Git doesn't know which authentication scheme to use until it sees the WWW-Authenticate header in the response from the initial unauthenticated request, so I think config or state would be necessary.

Show 6 quoted lines
>
> There needs a way to force unautheticated access if we were to do
> anything of that sort, of course.
>
>
>
Previous: Junio C HamanoNext: brian m. carlson
Message 4 of 5 in “Remembering which http remotes require authentication”
  1. M HickfordJun 12, 2023
  2. brian m. carlsonJun 12, 2023
  3. Junio C HamanoJun 12, 2023
  4. M HickfordJun 21, 2023
  5. brian m. carlsonJun 21, 2023

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.