fix(copilot): support enterprise ghe.com device login safely - #3880
Draft
amitksingh1490 wants to merge 3 commits into
Draft
amitksingh1490 wants to merge 3 commits into
amitksingh1490 wants to merge 3 commits into
Conversation
…ations Co-authored-by: ForgeCode <noreply@forgecode.dev>
Contributor
Author
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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