Skip to content

[pull] master from microsoft:master - #143

Merged
pull[bot] merged 3 commits into
cgallred:masterfrom
microsoft:master
Aug 18, 2026
Merged

pull[bot] merged 3 commits into
cgallred:masterfrom
microsoft:master

Conversation

@pull

@pull pull Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

GVFS erased a valid credential when an object-download response was HTTP 400,
which triggered a storm of Git Credential Manager popups.

A 400 is a request or formatting problem, not an authentication failure. An
expired or invalid credential always returns 401 (Unauthorized) or 302 (the
Azure DevOps sign-in redirect), never 400. Treating 400 as an auth failure
erased good credentials and produced the misleading "Your PAT may be expired"
message.

Remove BadRequest (400) from the credential-rejection branch in SendRequest.
Only 401 and 302 now reject credentials; 400 flows through the generic,
non-auth error path (unchanged retry / circuit-breaker behavior, and 400
remains non-retryable). Extract the decision into ShouldRejectCredentials so it
is unit tested: 400 does not reject credentials, while 401 and 302 still do.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
…"auth required" body

An earlier change dropped HTTP 400 from the credential-rejection branch entirely,
on the premise that a 400 is never an authentication failure. That premise is
incomplete. The Azure DevOps GVFS cache server returns a 400 (not a 401) in one
genuine authentication case: when the request carried no parseable Basic
Authorization header. Its response body is "A valid Basic Authorization header is
required." microsoft/git's git-gvfs-helper maps that same cache-server 400 to a
401 for this reason, and its own TODO says to confirm the response body - which is
what this change does.

A present-but-expired or invalid credential still returns 401, and a malformed
request (for example a corrupt object SHA in the loose-object URL) returns a 400
that has nothing to do with credentials. So the decision is now body-aware:

- 401 and 302 always reject credentials.
- 400 rejects credentials only when the body matches the cache server's
  auth-required message (case-insensitive substring).
- Every other 400 (and 404/5xx/timeouts) does not reject credentials.

This stops the credential-manager popup storm caused by rejecting a valid
credential on a non-auth 400, while preserving credential refresh for the one 400
that really does mean "authentication required", keeping the behavior consistent
with git-gvfs-helper.

Tests updated for the new body-aware signature and cases.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
…als-on-400

HttpRequestor: do not reject credentials on HTTP 400
@pull pull Bot locked and limited conversation to collaborators Aug 18, 2026
@pull pull Bot added the ⤵️ pull label Aug 18, 2026
@pull
pull Bot merged commit 8890e09 into cgallred:master Aug 18, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant