From: Jeff King <peff@peff.net>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
Eric Sunshine <sunshine@sunshineco.com>,
Git List <git@vger.kernel.org>,
Dmitry Vilkov <dmitry.a.vilkov@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] http: add option to try authentication without username
Date: Mon, 15 Feb 2016 15:34:51 -0500 [thread overview]
Message-ID: <20160215203451.GA29705@sigill.intra.peff.net> (raw)
In-Reply-To: <20160215202937.GA57185@vauxhall.crustytoothpaste.net>
On Mon, Feb 15, 2016 at 08:29:37PM +0000, brian m. carlson wrote:
> > Rather than sprinkling curl_empty_auth special cases here and there,
> > would it be possible to simply set http_auth.username and
> > http_auth.password to empty strings early on if they are not already
> > set and curl_empty_auth is true, and then let the:
> >
> > strbuf_addf(&up, "%s:%s",
> > http_auth.username, http_auth.password);
> >
> > in init_curl_http_auth() handle them in the normal fashion, with the
> > end result being the same ":" set explicitly by this patch?
>
> That would work. I was concerned about the credential_fill call
> actually prompting the user, but it appears that it doesn't do that if
> the password already exists. I don't know if we want to rely on that
> functionality, though.
Yeah, credential_fill() will treat that as a noop, as it is no different
than getting "https://user:pass@example.com" in the URL in the first
place. But it will _also_ send the result to credential_approve() and
credential_reject(), which you probably don't want (because you do not
want to store these useless dummy credentials in your keystore).
So I think this hack should remain purely at the curl level, and never
touch the credential struct at all.
Which is a shame, because I think Eric's suggestion is otherwise much
more readable. :)
-Peff
next prev parent reply other threads:[~2016-02-15 20:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 9:11 [PATCH] remote-curl: don't fall back to Basic auth if we haven't tried Negotiate Dmitry Vilkov
2016-02-02 20:37 ` Junio C Hamano
2016-02-02 23:29 ` brian m. carlson
2016-02-05 9:18 ` Dmitry Vilkov
2016-02-05 17:54 ` Junio C Hamano
2016-02-05 20:58 ` brian m. carlson
2016-02-06 17:53 ` Daniel Stenberg
2016-02-05 20:46 ` brian m. carlson
2016-02-05 21:02 ` Junio C Hamano
2016-02-05 21:06 ` brian m. carlson
2016-02-05 21:52 ` Junio C Hamano
2016-02-08 9:11 ` Dmitry Vilkov
2016-02-15 18:44 ` [PATCH] http: add option to try authentication without username brian m. carlson
2016-02-15 20:19 ` Eric Sunshine
2016-02-15 20:29 ` brian m. carlson
2016-02-15 20:34 ` Jeff King [this message]
2016-02-15 20:36 ` brian m. carlson
2016-02-15 21:39 ` Junio C Hamano
2016-02-15 21:41 ` brian m. carlson
2016-02-15 21:46 ` Eric Sunshine
2016-02-15 21:51 ` brian m. carlson
2016-02-20 14:35 ` [PATCH] remote-curl: don't fall back to Basic auth if we haven't tried Negotiate Dmitry Vilkov
2016-02-20 15:23 ` brian m. carlson
2016-02-20 21:38 ` Junio C Hamano
2016-02-25 16:54 ` Dmitry Vilkov
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=20160215203451.GA29705@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=dmitry.a.vilkov@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.net \
--cc=sunshine@sunshineco.com \
/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).