For #269213
This adds a new eslint rule for `as any` and `<any>({... })`. We'd like to remove almost all of these, however right now the first goal is to prevent them in new code. That's why with this first PR I simply add `eslint-disable` comments for all breaks
Trying to get this change in soon after branching off for release to hopefully minimize disruption during debt week work
A user reported that their proxy ZScaller has issues with Electron's fetch. More research needs to be done to understand why this is not playing nice wholistically...
... but, to unblock GitHub scenarios like Copilot, we add this setting to change the implementation of fetch used.
At some point, we need to have http.useElectronFetch setting be enabled by default and when that happens, this setting can be removed in favor of that.
cc @chrmarti @alexdima
* `issuer` -> `authorizationServer` refactor
Also:
* adds `authorizationServerGlobs` to the authentication contribution schema
* removes ugly MCP issuer hack and instead plumbs the authorizationServer down to the new auth providers
This should help in some cases where extensions call getSession to get github-enterprise and end up waiting 5 seconds for it to time out because it use to only be registered when there was a setting set.
* Attempt to use Electron fetch for github-authentication
Also changes fallback from node-fetch to the built-in Node fetch
* Remove Content-Length header Electron compatibility
It looks like it was set incorrectly to the body contents anyways.
For a long time the account id wasn't handled correctly. It should be a string, but the API returns a number. This ensures it's a string and does some migration logic.
So that all auth providers can take advantage of this logic. This basically will do a light enforcement that the account you signed in to matches the account that was requested (if it was specified).
This is needed for finalization.
* Fix some always true/false errors in codebase
Testing out latest TS nightly that can identify when an expression is always true/false. This caught a few likely coding mistakes in our codebase
Unsure about the intent in some of these cases but I've tried my best to understand them. Pinging relevant code owners for the confusing cases
* Bump TS version
* Fix unreachable in build scripts
* Bump versions
* restore intent
* Revert package.json change
* Fixing a few new layer checker errors
These are global in node now
* Skip lib check in integration project
* One more skiplibcheck
* More skip lib
---------
Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
It seems like this event fires in Codespaces... my _guess_ is that Codespaces basically overwrites all the settings from settings sync which causes this event to fire.
It's surprising to me that this event fires even though the value hasn't changed.
I can't repro this with the test resolver, and I also cant have Codespaces use Code - OSS, so we'll just have to see how this goes.
This _should_ do the trick though.
Fixes https://github.com/microsoft/vscode/issues/223508
* Have select account picker include accounts that don't match requested scopes (this will run `createSession` for that chosen account)
* Implement multi-account GitHub support behind a setting
The flows are crucial to the extension and I wanted to be able to declare which can be used when in a declarative way. This reworks the flows into that model.
Additionally, it pulls in the Client ID and secret from a config which will allow us to not rely on the vscode.dev proxy on Desktop (because we can make a distro change that includes the secret... which isn't a real secret, says GitHub)... unfortunately we still need to rely on it for Web due to CORS but we're in a position where it will be easy to rip the proxy out when GH supports it.
We don't need to fetch the user details when the Auth Session already has the info we need. This PR removes that extraneous web request.
I've also changed the `User-Agent` that we pass to be more specific so we can narrow down any future issues with spamming web requests.
Fixes#173645
* Organize Errors in GitHub Auth and make sure no double prompting happens
This mostly just moves some strings into variables... but this also fixes the GH Auth side of https://github.com/microsoft/vscode/issues/180697 so you should only be asked once if you want to try a different way to log in.
* add comments