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

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

From
Jeff King <peff@peff.net>
Date
Jun 5, 2012, 16:23 UTC
Message-ID
<20120605162309.GA20915@sigill.intra.peff.net>
In-Reply-To
<7vtxyv2cft.fsf@alter.siamese.dyndns.org>
On Fri, Jun 01, 2012 at 10:01:58AM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> >> 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?

I don't know that the higher level really has much more context; the URL is really the only context we use. I think the problem is adequately solved in http_request; it is simply that the http-push code paths do not use it. The patch solves that by pushing it to a lower level.

-Peff
Previous: Junio C HamanoNext: Kevin Stange
Message 5 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.