Repository navigation
Fix marketplace 403 responses prompting repeated sign-in - #343686
Karthik Nadig (karthiknadig) merged 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped correction preserves existing error handling and has focused regression coverage with no unresolved issues.
No open issues 🎉
What changed in this PR
Fixes repeated marketplace sign-in prompts by preserving the distinction between authentication failure (401) and access denial (403), consistent with the linked issue’s HTTP contract.
Changes:
- Routes service-index
403responses through the existingAccessDeniedpath while retainingRequiresSignInfor401. - Adds provider/token/status regression coverage, includes late
403responses in sign-out race tests, and verifies recovery after interactive Entra consent.
| File | Description |
|---|---|
| src/vs/workbench/services/extensionManagement/test/electron-browser/extensionGalleryManifestService.test.ts | Extends status, sign-out race, and consent recovery coverage. |
| src/vs/workbench/services/extensionManagement/electron-browser/extensionGalleryManifestService.ts | Limits the authentication-required error to 401 responses. |
Review effort: Balanced
|
Karthik Nadig (@karthiknadig) this is ready for your review. Thank you. |
f4ff917 to
0b9b05f
Compare
|
Karthik Nadig (@karthiknadig) this is ready for your review 🙏 |
Karthik Nadig (karthiknadig)
left a comment
There was a problem hiding this comment.
LGTM. A 401 still asks for sign-in, and a 403 now reaches the existing AccessDenied path, which fixes the sign-in loop for GitHub users the marketplace denies.
One ordering note: please merge this after #343689. While main still falls back to sending the Entra sign-in token, a marketplace that answers that token with a 403 would show "contact your administrator" instead of offering sign-in.
Review assisted by Copilot.
|
Replying to Karthik's landing-order note: Agreed. I'll keep this behind #343689 and rebase after that lands, so 403 handling does not change while the sign-in-token fallback is still present. No need to broaden this PR beyond the 401/403 correction. Drafted with GitHub Copilot. |
Treat service-index 401 responses as authentication challenges and preserve 403 as access denied regardless of provider or bearer presence. Cover the provider/status matrix, Entra consent recovery, and sign-out races. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 7e5dd4b9-d381-460c-911e-9bb109420931
0b9b05f to
3cf842b
Compare
|
Karthik Nadig (@karthiknadig) this needs more reviewers. Are you able to help us with that? |
There was a problem hiding this comment.
🟡 Changes recommended
The new 403 test delays the metadata probe instead of only the service-index request, causing sign-out to cancel account resolution before the manifest fetch and leaving late manifest responses untested.
1 open issue
Review effort: Max
Complete protected-resource metadata discovery before holding the actual service-index GET. Prove the blocked request uses the resource bearer, await the sign-out status before releasing each late response, and verify the manifest and token remain cleared. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 7e5dd4b9-d381-460c-911e-9bb109420931
1764deb
Karthik Nadig (karthiknadig)
left a comment
There was a problem hiding this comment.
LGTM. The new commit only tightens the sign-out race test so the late response reaches the service-index request, and the production change is the same one I approved before.
This now conflicts with #343689, so whichever of the two lands second will need a rebase.
Review assisted by Copilot.

Related to microsoft/vscode#325412.
Behavior
A custom marketplace service-index 401 maps to
RequiresSignIn; a 403 follows the existingAccessDeniedpath. The mapping is independent of the configured account provider and whether the request carries a bearer.Denied responses do not retain marketplace authorization. Existing status UI, localized labels, and actions are reused; token selection, acquisition, renewal, and metadata caching are unchanged.
Validation
npm run typecheck-clientnode build\next\build-fast.ts --client-only$env:VSCODE_SKIP_PRELAUNCH = '1'; .\scripts\test.bat --run src\vs\workbench\services\extensionManagement\test\electron-browser\extensionGalleryManifestService.test.ts --reporter dotThe status matrix covers default, GitHub, and Microsoft account configurations, anonymous and bearer requests, and both HTTP statuses. Consent recovery verifies
RequiresSignIntoAvailable; sign-out coverage includes a late 403.No live private-marketplace or interactive identity-provider flow was exercised.
Drafted with GitHub Copilot.