feat: add OAuth device-flow providers (Codex, Gemini, Qwen, MiniMax) with vault token persistence#1115
Open
AlexZander85 wants to merge 2 commits intoRightNow-AI:mainfrom
Open
feat: add OAuth device-flow providers (Codex, Gemini, Qwen, MiniMax) with vault token persistence#1115AlexZander85 wants to merge 2 commits intoRightNow-AI:mainfrom
AlexZander85 wants to merge 2 commits intoRightNow-AI:mainfrom
Conversation
…with vault token persistence
Adds a new oauth_providers module with device-flow implementations for
OpenAI Codex, Google Gemini, Qwen (DashScope), and MiniMax. Tokens are
persisted to both the in-memory vault and secrets.env for dual-write
durability. The Copilot flow is preserved unchanged.
New routes:
POST /api/providers/openai-codex/oauth/start
GET /api/providers/openai-codex/oauth/poll/{poll_id}
POST /api/providers/gemini-oauth/oauth/start
GET /api/providers/gemini-oauth/oauth/poll/{poll_id}
POST /api/providers/qwen-oauth/oauth/start
GET /api/providers/qwen-oauth/oauth/poll/{poll_id}
POST /api/providers/minimax-oauth/oauth/start
GET /api/providers/minimax-oauth/oauth/poll/{poll_id}
UI: Settings page shows Login buttons for each provider with device-code
display and polling feedback.
… OAuth routes - Add allow_no_auth to AuthConfig (default true) for backward compatibility - Replace fail-open with fail-close+opt-in: when allow_no_auth=false and no API key is set, return 401 instead of allowing all access (RightNow-AI#1034) - Add codex/gemini/qwen/minimax OAuth routes to middleware public endpoint list - Add auth middleware unit tests
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
persist_oauth_secret/persist_oauth_tokenshelpers for secure token storage (credential vault + secrets.env + env var)SlowDowninterval update in DashMap (matching Copilot/Codex pattern)pending->errorwhenqwen_poll_oauth_flow()returnsErr.ag/and.beads/to.gitignoreChanged files
.gitignore- add.ag/logs/,.beads/Cargo.toml/Cargo.lock- version 0.5.7 -> 0.5.9crates/openfang-api/src/routes.rs- persist_oauth helpers, Gemini interval fix, token persistence in poll handlersTest plan
cargo build --workspace --lib- compiles cleancargo test -p openfang-api -p openfang-runtime -p openfang-types- all 910+ tests passcargo clippy --workspace --all-targets -- -D warnings- zero warningsPart of #1030 OAuth providers review split (PR 1 of 3)