Add OAuth token fallback for provider auth#268
Open
MegaDigitalCode wants to merge 1 commit intoRightNow-AI:mainfrom
Open
Add OAuth token fallback for provider auth#268MegaDigitalCode wants to merge 1 commit intoRightNow-AI:mainfrom
MegaDigitalCode wants to merge 1 commit intoRightNow-AI:mainfrom
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
This PR adds provider credential fallback support for OAuth-style tokens in OpenFang runtime auth resolution and provider auth status detection.
What Changed
anthropic:ANTHROPIC_OAUTH_TOKENthenANTHROPIC_API_KEYqwen:QWEN_OAUTH_TOKENthenDASHSCOPE_API_KEYminimax:MINIMAX_OAUTH_TOKENthenMINIMAX_API_KEYdetect_auth()to mark providers as configured when those OAuth env vars are present.Why
Some providers support OAuth-derived tokens in addition to static API keys. This change aligns runtime behavior and auth-status UX with those supported auth modes.
Validation
Executed on runner environment:
cargo test -p openfang-runtimetest_detect_auth_anthropic_oauth_tokentest_detect_auth_qwen_oauth_tokentest_detect_auth_minimax_oauth_tokentest_resolve_provider_api_key_prefers_anthropic_oauthtest_resolve_provider_api_key_qwen_oauth_fallbacktest_resolve_provider_api_key_minimax_oauth_fallbackcargo clippy -p openfang-runtime --all-targets -- -D warningsScope
Single concern only: provider auth fallback behavior plus matching docs/tests.