Open
Conversation
3 tasks
Contributor
|
This needs a rebase onto current main. A few things landed after this PR was opened that cause conflicts (Grok provider, MiniMax expansion, model selection refactoring). The main spots are Let me know if you need a hand with the rebase. |
503c3aa to
3df6684
Compare
- Ollama as a built-in provider (OpenAI-compatible, no API key needed) - 8 default models: llama3.3, llama3.2, qwen2.5, qwen2.5:32b, mistral, gemma3, deepseek-r1, phi4 - Keyless provider activation: providers with only a baseUrl (no API key) now activate correctly - isProviderKeyRequired() helper for consistent key validation across routes - i18n strings for Ollama (zh-CN + en-US) and missing Doubao strings - SSRF guard documentation clarifying server-configured URLs bypass safely Previously, clients could send `x-requires-api-key: false` (header) or `requiresApiKey: false` (body) to skip API key validation for ANY provider, including ones like OpenAI that require keys. This meant a client could consume server-configured credentials without authorization. Fix: the server now derives requiresApiKey exclusively from its own provider registry. The client header and body field are removed from all server-side parsing. For Ollama, the registry says `requiresApiKey: false` so it works keyless. For OpenAI, the registry says `true` so the check is enforced regardless of what a client sends.
3df6684 to
8f92df6
Compare
Author
|
@wyuc Rebased onto main (95b5c2b), conflicts in spots are all resolved.
|
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
isProviderKeyRequired()helper for consistent key validation across routesSecurity: requiresApiKey no longer accepted from client
Previously, clients could send
x-requires-api-key: false(header) orrequiresApiKey: false(body) to skip API key validation for ANY provider, including ones like OpenAI that require keys. This meant a client could consume server-configured credentials without authorization.Fix: the server now derives
requiresApiKeyexclusively from its own provider registry. The client header and body field are removed from all server-side parsing. For Ollama, the registry saysrequiresApiKey: falseso it works keyless. For OpenAI, the registry saystrueso the check is enforced regardless of what a client sends.Test plan
OLLAMA_BASE_URL=http://localhost:11434/v1in.env.local, select Ollama model, verify chat worksx-requires-api-key: falseheader does NOT bypass key check for OpenAIDEFAULT_MODEL