fix(oauth): mirror ghe-copilot into the OAuth id map and MITM host list

#7546 registered the ghe-copilot provider in src/lib/oauth/providers/index.ts but
left it out of two mirrors that are asserted to stay in lock-step:

- PROVIDERS in src/lib/oauth/constants/oauth.ts (the canonical id map), which made
  oauth-providers-config.test.ts fail three assertions at once;
- MITM_TOOL_HOSTS, the client-safe projection of ALL_TARGETS, which made
  mitm-tool-hosts.test.ts fail its drift guard.

Both reds reproduce on the pure release tip and turned every open PR's unit shards
red, so this unblocks the whole queue. The test expectations are extended (not
weakened) to cover the new provider.
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-07-20 06:52:05 -03:00
parent eb02d4d266
commit 764d91fdfa
4 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1 @@
- fix(oauth): register `ghe-copilot` in the OAuth provider id map and the client-safe MITM host mirror, which #7546 left out of both — the gap turned the whole release branch red on `oauth-providers-config` and `mitm-tool-hosts`

View File

@@ -511,6 +511,7 @@ export const PROVIDERS = {
KIMI_CODING: "kimi-coding",
OPENAI: "openai",
GITHUB: "github",
GHE_COPILOT: "ghe-copilot",
GITLAB_DUO: "gitlab-duo",
KIRO: "kiro",
AMAZON_Q: "amazon-q",

View File

@@ -17,6 +17,9 @@ export const MITM_TOOL_HOSTS: Record<string, string[]> = {
],
kiro: ["api.anthropic.com"],
copilot: ["api.githubcopilot.com", "copilot-proxy.githubusercontent.com"],
// GHE Copilot has no fixed host: the enterprise domain is per-connection (gheUrl), so the
// canonical target declares an empty host list and nothing is added to the hosts file.
"ghe-copilot": [],
codex: ["chatgpt.com"],
cursor: ["api2.cursor.sh"],
zed: ["api.zed.dev"],

View File

@@ -31,6 +31,7 @@ const {
CODEBUDDY_CN_CONFIG,
ZED_CONFIG,
CURSOR_CONFIG,
GHE_COPILOT_CONFIG,
GITHUB_CONFIG,
GITLAB_DUO_CONFIG,
GROK_CLI_CONFIG,
@@ -59,6 +60,7 @@ const EXPECTED_PROVIDER_KEYS = [
"qwen",
"kimi-coding",
"github",
"ghe-copilot",
"gitlab-duo",
"kiro",
"amazon-q",
@@ -92,6 +94,7 @@ const EXPECTED_CONFIG_BY_PROVIDER = {
qwen: QWEN_CONFIG,
"kimi-coding": KIMI_CODING_CONFIG,
github: GITHUB_CONFIG,
"ghe-copilot": GHE_COPILOT_CONFIG,
"gitlab-duo": GITLAB_DUO_CONFIG,
kiro: KIRO_CONFIG,
"amazon-q": KIRO_CONFIG,
@@ -129,6 +132,8 @@ const REQUIRED_FIELDS_BY_PROVIDER = {
qwen: ["deviceCodeUrl", "tokenUrl", "scope", "clientId"],
"kimi-coding": ["deviceCodeUrl", "tokenUrl", "clientId"],
github: ["deviceCodeUrl", "tokenUrl", "userInfoUrl", "copilotTokenUrl", "clientId"],
// GHE Copilot derives its URLs at runtime from the per-connection gheUrl — only static fields.
"ghe-copilot": ["clientId", "scopes", "apiVersion", "userAgent"],
"gitlab-duo": [
"baseUrl",
"authorizeUrl",