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

Re: [PATCH] http.c: prompt for username on 403

From
Ashlesh Gawande <git@ashlesh.me>
Date
Dec 10, 2025, 12:30 UTC
Message-ID
<37c3b31e-900e-4df0-ac30-284e71660487@ashlesh.me>
In-Reply-To
<aTjVenutFBprwrrz@fruit.crustytoothpaste.net>
On 12/10/25 07:35, brian m. carlson wrote:
Show 23 quoted lines
> On 2025-12-09 at 08:22:49, Ashlesh Gawande wrote:
>> I was working on separating the tests and thought about the original
>> proposal a bit more.
>> To stop the credentials from being erased on 403 could something like the
>> following be acceptable?
>>
>>          else if (results->http_code == 401 || results->http_code == 403) {
>>                  if ((http_auth.username && http_auth.password) ||\
>>                      (http_auth.authtype && http_auth.credential)) {
>> +                       // Do not override existing credentials on 403
>> +                       if (results->http_code == 403) {
>> +                               return HTTP_ERROR;
>> +                       }
>> +
>>                          if (http_auth.multistage) {
>>
>> So then we would prompt on 403 only if credentials are not configured.
> Can you tell me what file you see this in?  I don't actually see any
> place in the code that has "http_code == 403" in the latest version of
> the main branch.
>
> I wonder if your issue may already be fixed in a newer version than you
> have.

Oh, that http_code == 403 is my original proposal to prompt for username/password on 403 (I did the diff on top of that instead of base). But you pointed out that it would wipe out existing credentials. This is an attempt to fix that by not prompting on 403 if git credentials are set. So when credentials are provided through default netrc file (such that http_auth.* are not set; git credential helper is not set) then we can still get the prompt on 403.

Previous: brian m. carlsonNext: Ashlesh Gawande
Message 7 of 11 in “http.c: prompt for username on 403”
  1. http.c: prompt for username on 403Ashlesh Gawande, Oct 14, 2025
  2. brian m. carlsonOct 14, 2025
  3. Ashlesh GawandeOct 15, 2025
  4. brian m. carlsonOct 15, 2025
  5. Ashlesh GawandeDec 9, 2025
  6. brian m. carlsonDec 10, 2025
  7. Ashlesh GawandeDec 10, 2025
  8. Ashlesh GawandeDec 10, 2025
  9. rsbecker@nexbridge.comDec 10, 2025
  10. brian m. carlsonDec 10, 2025
  11. Ashlesh GawandeDec 11, 2025

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.