Commit Graph

293 Commits

Author SHA1 Message Date
Matt Bierner
162806006a Update a few package-locks for mocha 2025-10-13 11:13:12 -07:00
Matt Bierner
98b069c041 Work towards getting isolated built-in extension compiles
For #271167

This makes it so our built-in extensions can mostly be built using `tsc` on the command line. Previously the extensions were picking up a lot of typing info from the root `node_modules` that meant they weren't truly independent
2025-10-13 11:03:20 -07:00
Tyler James Leonhardt
8845fc4b5c Remove any casts in auth extensions (#270089) 2025-10-06 12:28:27 -07:00
Matt Bierner
360c9fd134 Add lint rule for as any and bulk ignore all existing breaks
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
2025-10-02 23:38:33 -07:00
Tyler James Leonhardt
2deaa78bcf Add /login/oauth path part to the ghes supported authorization server (#265703)
Fixes GHE MCP loading
2025-09-08 17:38:49 +00:00
Christof Marti
f5f2ea58fc Rerun fallbacks (#260297) 2025-09-08 16:55:43 +02:00
Tyler James Leonhardt
71b461ab86 Support PKCE for GitHub Auth (#265381)
Fixes https://github.com/microsoft/vscode/issues/264795
2025-09-05 19:55:35 +02:00
Christof Marti
7be2a0b2e6 Retry with first fetcher to avoid fallback on resume 2025-09-04 21:42:15 +02:00
Benjamin Pasero
d44d16c464 Wire in a auth callback parameter to indicate Copilot terms were shown to the user (microsoft/vscode-internalbacklog#5761) (#262439)
* implement as a bag

* nit

---------

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
2025-08-22 14:42:25 +09:00
Christof Marti
5bf6e4d607 Fall back to alternate fetch implementation (#262181) 2025-08-19 04:46:22 -07:00
Tyler James Leonhardt
d3c3cf8f50 Attempt to fix Codespaces bug by declaring a default (#261484)
Fixes https://github.com/microsoft/vscode/issues/261238
2025-08-13 16:44:28 +00:00
Copilot
97bc9a439c Fix GitHub Authentication reload dialog appearing unnecessarily in remote tunnel scenarios (#261257) 2025-08-12 09:47:23 -07:00
Tyler James Leonhardt
631a4d9dbb Workaround electron proxy issues for GitHub by allowing to switch to node's fetch (#261099)
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
2025-08-11 18:39:45 +00:00
Matt Bierner
ed71020bfc Convert extension webpack scripts to modules 2025-08-07 17:20:22 -07:00
Matt Bierner
d8c9852fe9 Don't use experimental decorators in extensions
Seeing if we can compile our extensions using TS native which doesn't support these. The usage is so low that I think we can just remove them
2025-08-06 13:24:19 -07:00
Benjamin Pasero
2188c90df5 Add sign in option for Apple (microsoft/vscode-internalbacklog#5578) (#255155) 2025-07-10 14:43:10 -07:00
Tyler James Leonhardt
8bd52a173e Redirect to vscode.dev/redirect and then vscode://.... (#254841)
So that the browser remembers who triggered the redirect.

Fixes https://github.com/microsoft/vscode/issues/254810
2025-07-09 12:33:37 +02:00
Tyler James Leonhardt
b1e40f2893 Revert "Use Code OSS GitHub client id" (#252559) 2025-06-26 18:04:50 -07:00
Lee Murray
e0233e7545 Add insiders filter support in CSS and update variables dynamically (#252488)
Co-authored-by: lemurra_microsoft <Lee.Murray@microsoft.com>
2025-06-26 21:09:15 +02:00
Tyler James Leonhardt
8d05b579cc Use Code OSS GitHub client id (#252426)
To separate Code OSS & VS Code.
2025-06-25 18:58:58 +02:00
Benjamin Pasero
b8aaad0ef8 auth - update animation (#251939) 2025-06-19 20:57:09 +02:00
Benjamin Pasero
a6c11ed472 auth - modernise local redirect page (#251895) 2025-06-19 16:56:55 +02:00
Tyler James Leonhardt
51eba2dc05 Support provider parameter in device code flow (#251767)
Not lit up on the server side, but should be ready in the next day or so.
2025-06-18 03:20:41 +02:00
Tyler James Leonhardt
559c2fa308 Use provider query parameter (#251662)
The identity team are gonna take this direction instead.
2025-06-17 18:06:36 +02:00
Tyler James Leonhardt
2fabac413d Introduce auth-provider specific props & use it for social sign in for GitHub (#251649)
ref https://github.com/microsoft/vscode/issues/251648

NOTE: the server side is not quite ready. It doesn't redirect back to VS Code properly, but this should be good to go whenever that is.
2025-06-16 23:02:36 +02:00
Copilot
5a501dcde9 Add light mode support to GitHub authentication sign-in page (#251509)
* Initial plan for issue

* Add light mode support to GitHub auth page using CSS media queries

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>

* use vscode colors

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: Tyler Leonhardt <tyleonha@microsoft.com>
2025-06-15 23:27:27 -07:00
Tyler James Leonhardt
5d83e82b2d Fix name branding (#251566)
* Fix name branding

Typo...

* one more fix

* move around
2025-06-16 05:41:57 +00:00
Tyler James Leonhardt
9cbcaa893f Bring in branding when built (#251451)
* Bring in branding when built

Since we shouldn't have "Visual Studio Code" in this OSS repo.

* fix test
2025-06-13 16:41:29 -07:00
Tyler James Leonhardt
31620a3dec Have Loopback Server flow redirect back to VS Code and make it the primary flow (#251333)
* Have Loopback Server flow redirect back to VS Code and make it the primary flow

Fixes https://github.com/microsoft/vscode/issues/250086

* Fix test

* Fix test

* Fix other test
2025-06-13 08:14:41 +02:00
Tyler James Leonhardt
89fbfc20ab Fix race condition in unregistering authentication providers (#250667)
A minimal change for endgame.
2025-06-04 13:35:13 -07:00
Tyler James Leonhardt
c235626145 issuer -> authorizationServer refactor (#250359)
* `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
2025-06-02 17:38:21 -07:00
Tyler James Leonhardt
86efdcd2c1 Introduce Issuer handling in the Authentication stack (#248948)
Mostly plumbing... this enables:
```
vscode.authentication.getSession('microsoft', scopes, { issuer: "https://login.microsoftonline.com/common/v2.0" });
```
And the respective API for an auth providers to handle it being passed in.

This props up work in MCP land which needs a way to map an issuer to an auth provider... but I certainly see utility outside of that space.

Fixes https://github.com/microsoft/vscode/issues/248775#issuecomment-2876711396
2025-05-14 23:02:15 +02:00
Tyler James Leonhardt
a1d4a24624 Register a NullAuthProvider for github-enterprise when there is no setting set (#248870)
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.
2025-05-13 16:24:14 -07:00
Tyler James Leonhardt
b2224f2fc6 Improve logic for detection of node vs web worker extension host (#248534)
* Use `WorkerGlobalScope` instead of `navigator` since node defines `navigator` now

* microsoft auth too

* better logic
2025-05-09 19:37:27 +02:00
Robo
12326f9906 chore: update to Electron 35 (#245423)
* chore: bump electron@35.0.1

* chore: update types/node@22.x

* chore: update web types for node v22.x

* chore: bump electron@35.1.2

* chore: update node.js build

* chore: update app.dock usage

Refs 71f3ff6bf2

* chore: bump electron@35.1.4

* chore: bump electron@35.1.5

* ci: bump sysroot to glibc 2.28 and gcc 10.5.0

* ci: enable timeout for smoketests

* chore: bump min glibcxx to 3.4.26 for server

* Revert "ci: enable timeout for smoketests"

This reverts commit afb637e85d.

* chore: update debian dependencies

* fix: workaround npm.ps1 argument parsing with powershell

* chore: update rpm dependencies

* test: partially revert changes from 242535

* test: remove redudant keybinding dispatch for selectTab

* test: fix test failure from running configured tasks

* test: focus settings editor for preferences.test.ts

* node - adopt compile cache (#246835)

* node - adopt compile cache

* adopt for utility process

* tweaks

* log state of compilation cache

* Revert "log state of compilation cache"

This reverts commit f3840387a583013834762e2c44f6e8424929297f.

* Revert "node - adopt compile cache (#246835)"

This reverts commit 673a00cab66c9bac87f3cd27b80efa41c80150f1.

* chore: update builds

* chore: bump electron@35.2.0

* chore: bump electron@35.2.1

* chore: bump electron@35.2.2

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
2025-05-09 19:03:36 +09:00
Tyler James Leonhardt
9ca1204521 Doc calling out GitHub OAuth client secret behavior (#242210) 2025-02-27 18:47:41 +01:00
Tyler James Leonhardt
d5f4a77e00 GitHub Enterprise GHE.com Setting clarity (#240289)
And a pattern to make sure no one puts a DotCom URL.

ref https://github.com/microsoft/vscode-pull-request-github/issues/6602
2025-02-10 20:35:06 +01:00
Devraj Mehta
63d1401dee fix: add electron as an external for webpack (#239134)
* fix: add electron as an external for webpack

* refactor: move electron external to shared webpack
2025-02-03 18:54:18 +00:00
Devraj Mehta
87ed97df8b Use Electron fetch or Node fetch for github-authentication to support proxies (#238149)
* 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.
2025-01-17 19:05:10 +00:00
Logan Ramos
e689b912ba Update telemetry package (#236378) 2024-12-17 20:12:49 +01:00
Tyler James Leonhardt
950b401a9c Make multiple accounts the default (#231618) 2024-10-18 01:36:06 +02:00
Tyler James Leonhardt
6d482e38cd No longer look at sessions[0] (#231063)
We don't need to do this anymore now that account preference is kept across sessions.
2024-10-10 14:50:19 -07:00
Robo
9494a89080 chore: add npmrc to extensions folder (#230214) 2024-10-01 12:43:01 +02:00
Tyler James Leonhardt
52b0ec07b8 Allow Multi-account in GitHub Auth in Insiders (#229106) 2024-09-20 00:31:40 +02:00
Tyler James Leonhardt
c4d1cc2e67 Fix GitHub account ids being numbers (#228045)
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.
2024-09-10 04:39:37 +02:00
hj
88d7b97c93 chore: rm unreached ignore items when build extensions. (#227906)
chore: rm unreached ignore items when compiling extensions.
2024-09-09 10:32:51 +00:00
Robo
b5a6aa14a8 feat: switch to npm as default package manager (#226927)
* feat: move from yarn to npm

* chore: skip yarn.lock files

* fix: playwright download

* chore: fix compile and hygiene

* chore: bump vsce@2.17.0

Refs 8b49e9dfdf

* test: update results for bat and sh colorizer tests

* fix: add missing lock files for windows

* fix: switch to legacy-peer-deps

* chore: update markdown-it@14.1.0

Refs 737c95a129

esbuild step in extensions-ci-pr was previously using markdown-it
from root which had userland punycode and was able to compile successfully.

* ci: increase pr timeout for windows integration tests

* chore: fix product build

* build: ignore extension dev dependency for rcedit

* build: fix working directory inside container

* build: fix dependency generation

* npm: update dependencies

* ci: use global npmrc

* ci: update cache

* ci: setup global npmrc for private npm auth

* build: fix extension bundling

* chore: sync npm dependencies

* ci: debug env variables for container

* ci: fix win32 cli pipeline

* build: fix npmrc config usage for build/ and remote/ dirs

* fix: windows build

* fix: container builds

* fix: markdown-language-features tests and bundling

```
[03:58:22] Error: Command failed: /Users/demohan/.nvm/versions/node/v20.15.1/bin/node /Users/demohan/github/vscode/extensions/markdown-language-features/esbuild-notebook.js --outputRoot /Users/demohan/github/vscode/.build/extensions/markdown-language-features
✘ [ERROR] Could not resolve "punycode"

    extensions/markdown-language-features/node_modules/markdown-it/lib/index.js:14:27:
      14 │ var punycode     = require('punycode');
         ╵                            ~~~~~~~~~~

  The package "punycode" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
```

Adds userland package based on beed9aee2c

* fix: container builds for distro

* chore: update yarn occurrences

* fixup! chore: bump vsce@2.17.0

Uses the closest version to `main` branch that does not
include d3cc84cdec
while still having the fix 8b49e9dfdf

* chore: sync npm dependencies

* chore: sync npm dependencies

* chore: sync npm dependencies

* chore: throw error when yarn is used for installation

* chore: add review feedback

* chore: switch exec => run where needed

* chore: npm sync dependencies

* fix: markdown-language-features bundling

```
✘ [ERROR] Could not resolve "punycode"

    extensions/markdown-language-features/node_modules/markdown-it/lib/index.js:14:27:
      14 │ var punycode     = require('punycode');
         ╵                            ~~~~~~~~~~

  The package "punycode" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
```

Adds missing userland package based on markdown-it/markdown-it@beed9ae,
can be removed once we update markdown-it >= 14.1.0

* ci: rename no-yarn-lock-changes.yml

* chore: sync npm dependencies

* ci: restore no-yarn-lock-changes.yml

We can disable it in a separate PR to keep the required
checks happy and also need workflow edit perms.

* chore: sync npm dependencies

* ci: rebuild cache

* ci: fix no-package-lock-changes.yml

* chore: bump distro

* chore: rm yarn.lock files

* chore: rm yarn.lock files without dependencies

* chore: add vscode-selfhost-import-aid to postinstall dirs

* chore: bump distro
2024-09-06 22:18:02 +09:00
Tyler James Leonhardt
04bcb01ddf Move 'incorrect account' handling into core (#224872)
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.
2024-08-05 12:45:11 -07:00
Tyler James Leonhardt
02b638ae27 Finalize getAccounts API (#224877)
Fixes https://github.com/microsoft/vscode/issues/152399
2024-08-05 11:59:33 -07:00
Matt Bierner
84607a2fe2 Fix some always true/false errors in codebase (#223359)
* 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>
2024-07-30 15:37:27 -07:00