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

Re: [RFC] Deal with HTTP 401 by requesting credentials.

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 1, 2012, 17:01 UTC
Message-ID
<7vtxyv2cft.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120601083537.GA32340@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> On Thu, May 31, 2012 at 05:24:55PM -0500, Kevin Stange wrote:
>
>> Request credentials from the user if none are already defined when a
>> HTTP 401 is received on a restricted repository.  Then, resubmit the
>> request and return the final result.
>> 
>> This allows all webdav transactions to obtain credentials without having
>> to individually handle the case in each request.  Having push working
>> with HTTP auth is needed for a use case I have where storing the
>> credentials in .netrc or using SSH keys is inappropriate.
>
> We already do this at a higher level in http_request, which in turns
> calls into finish_active_slot. So if we were going to go this route,
> wouldn't we also want to remove the 401 handling in http_request?

Wouldn't the higher levels know a lot more about the context this request was made, though? What problem does the patch try to solve? Some higher level callers missing the "if we got 401, then reset and retry" logic? Wouldn't it be saner to fix the breakage there?

> The dumb-http push code is the only thing that does not go through
> http_request these days. So another option would be to refactor it to go
> through that central point.
It does sound like the right approach to take.
Thanks.
Previous: Jeff KingNext: Jeff King
Message 4 of 8 in “[RFC] Deal with HTTP 401 by requesting credentials.”
  1. Kevin StangeMay 31, 2012
  2. Kevin StangeMay 31, 2012
  3. Jeff KingJun 1, 2012
  4. Junio C HamanoJun 1, 2012
  5. Jeff KingJun 5, 2012
  6. Kevin StangeJun 1, 2012
  7. Jeff KingJun 5, 2012
  8. Kevin StangeJun 5, 2012

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.