git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Kevin Stange <kevin@steadfast.net>, git@vger.kernel.org
Subject: Re: [RFC] Deal with HTTP 401 by requesting credentials.
Date: Tue, 5 Jun 2012 12:23:09 -0400	[thread overview]
Message-ID: <20120605162309.GA20915@sigill.intra.peff.net> (raw)
In-Reply-To: <7vtxyv2cft.fsf@alter.siamese.dyndns.org>

On Fri, Jun 01, 2012 at 10:01:58AM -0700, Junio C Hamano 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?

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

  reply	other threads:[~2012-06-05 16:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 22:24 [RFC] Deal with HTTP 401 by requesting credentials Kevin Stange
2012-05-31 23:18 ` Kevin Stange
2012-06-01  8:35 ` Jeff King
2012-06-01 17:01   ` Junio C Hamano
2012-06-05 16:23     ` Jeff King [this message]
2012-06-01 17:02   ` Kevin Stange
2012-06-05 16:28     ` Jeff King
2012-06-05 16:41       ` Kevin Stange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120605162309.GA20915@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kevin@steadfast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).