Repository navigation
fix(copilot): support enterprise ghe.com device login safely - #3880
amitksingh1490 wants to merge 3 commits into
Conversation
…ations Co-authored-by: ForgeCode <noreply@forgecode.dev>
Draft verification / authored versus automation headAs of 2026-09-16 05:01 UTC, autofix.ci added
The PR remains draft / blocked, both for the expanded remote scope and for live enterprise device login/refresh/inference plus changed-CLI verification. Please provide user-assisted browser access to a licensed GHE.com account, never tokens or credentials in comments. Full local infra/services/CLI builds remain constrained by storage; only this issue's own newly generated build target was removed after preserving logs. No force push, automation change, workflow approval, merge or issue closure was performed. Co-Authored-By: ForgeCode noreply@forgecode.dev |
|
Action required: PR inactive for 5 days. |
|
PR closed after 10 days of inactivity. |
Summary
Refs #3860. Draft, not ready for merge. Published at the user's explicit request despite external verification gaps.
github.comremains the default. Accept onlygithub.comor a valid single-label<enterprise>.ghe.comhost (case-insensitive); reject arbitrary hosts, schemes, ports, userinfo and path/query/fragment input.api.<enterprise>.ghe.com. Persist the selected configuration. Refresh uses that saved configuration, not the catalog's public GitHub defaults.endpoints.apifor model/chat URLs; revalidate saved endpoints. Enterprise tokens cannot silently fall back to public Copilot or a different enterprise; missing enterprise endpoints fail closed. Older public credentials retain the public default.Official evidence
copilot login --host SUBDOMAIN.ghe.com.*.githubcopilot.comendpoints from enterprise*.SUBDOMAIN.ghe.comservices.ghat microsoft/vscode commit6182a6ebe:extensions/github-authentication/src/flows.tsderives/login/device/codeand/login/oauth/access_tokenfrom the enterprise base URI;src/vs/platform/agentHost/common/githubEndpoints.tsderives theapi.enterprise REST host and documents per-user Copilot API endpoints;extensions/copilot/src/platform/authentication/common/copilotToken.tsdefines the token response'sendpoints.api.Verification actually performed
cargo test --locked --offline -p forge_domain --lib: 621 passed, including all six new destination tests.cargo clippy --locked --offline -p forge_domain --lib -- -D warnings: passed.forge_domaintypes and the real auth utilities. A small trait adapter avoids the unrelated cloud SDK dependency graph; the unused non-Copilot template path deliberately panics. This is not a full forge_infra/forge_services/forge_main build. Harness and reproduction scripts are preserved in/home/forge/issue-patches/3860/auth-harness.cargo clippy --tests -- -D warnings -A dead_code -A unused_imports: passed (allowances are for unused code/imports caused by slicing).rustfmt --edition 2024 --checkon the four changed files andgit diff --check: passed. Stable rustfmt warned that repository nightly-only settings were ignored; no workspace-wide reformat was applied.cargo insta test --accept --test-runner cargo-test -- --locked --offline -p forge_domain --libunexpectedly rebuilt dependencies and was stopped by the disk guard at the 600 MiB reserve; it is not a passing insta run. No snapshot changes. Only this task's newly created build target was removed afterward; others' artifacts were untouched.Remaining blockers / required verification
--helpandprovider login --helppassed, but it does not include this patch. Its isolated/no-credentials-psmoke reportedNo such device or address (os error 6)despite exit 0; not a successful prompt or login test.Authored scope / recovery
Authored commit:
1a8e1fe00(four files, +596/-21). Durable worktree:/home/forge/worktrees/3860; patch/evidence:/home/forge/issue-patches/3860(authored.patch,publication.patch, logs, reproduction harness). Any bot-expanded head is separate from this verified authored scope. No force push, merge, issue closure, workflow approval or automation changes requested/performed.Co-Authored-By: ForgeCode noreply@forgecode.dev