feat(auth): expose subscription login methods and discover xAI endpoints - #3230
Open
uiharuayako wants to merge 1 commit into
Open
uiharuayako wants to merge 1 commit into
uiharuayako wants to merge 1 commit into
Conversation
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
No linked issue.
Type and Areas
Type: Feature / UI/UX
Areas: Web UI model settings, AI adapters subscription authentication, focused tests, adapter guide.
Motivation / Impact
Users running OpenBitFun on an unfamiliar machine may prefer to authorize from a phone or another computer where their account is already signed in. Codex already implements device-code authorization, but the local desktop sign-in action previously selected browser authorization without an explicit device-code choice. This change makes the supported methods visible and selectable.
Device authorization completes on another device while the OpenBitFun host receives and stores its own subscription credentials. This does not copy third-party credential files, synchronize existing accounts, or create a public OpenAI API key.
xAI endpoint discovery follows the approach used by CC-Switch. Each login or refresh reads the public discovery document using the existing subscription HTTP proxy configuration. A pending device grant retains the same discovered token endpoint throughout polling. Discovery errors are surfaced explicitly; inference URLs remain unchanged.
Verification
Re-run after moving the focused commit onto current upstream main:
cargo test -p openbitfun-ai-adapters --features subscription-auth --lib subscription_auth: 82 tests passed.pnpm --dir src/web-ui exec vitest run src/infrastructure/config/components/subscriptionLoginCoordinator.test.ts: 12 tests passed.pnpm run check:web: passed (type checking, Appearance, typography, theme color and visual contracts).node scripts/check-git-object-sizes.mjs --base origin/main --head HEAD: passed; five changed blobs within policy.git diff origin/main...HEAD --check: passed.AI-assisted implementation; testing level: lightly tested. Focused automated checks passed, but real-account device authorization, restart/reuse, token refresh and authenticated inference were not exercised.
Reviewer Notes
login_methods; older backends with an absent or empty field retain default sign-in behavior. Existing localized method labels are reused.auth.x.ai, port 443, without userinfo or fragments; issuer must match the expected issuer. Tests cover changed endpoint paths, missing fields, wrong issuers and unsafe origins.Checklist