Summary
During the GitHub operations audit of PR #384 (fix(router): use LiteLLM master key in responses_api and default backend_conf in execute_proxy), security and stability improvements were identified based on CodeRabbit review feedback and system verification:
Identified Issues & Required Improvements
LiteLLM Master Key Fail-Fast Validation (router/main.py):
os.getenv("LITELLM_MASTER_KEY") can resolve to None or placeholder strings (e.g., producing Bearer None), causing opaque upstream authorization failures.- Action: Validate
LITELLM_MASTER_KEY before constructing Authorization headers in responses_api and execute_proxy pathways.
Enforce Caller Authentication on Responses Endpoints:
- Routes
/v1/responses and /responses proxy upstream using the server's master key without authenticating incoming client requests first. - Action: Add client authentication dependency checks before upstream forwarding.
Dynamic OpenRouter Model Sync & Purge:
- Ensure OpenRouter models loaded from LiteLLM config are dynamically registered into LiteLLM DB on lifespan startup while purging stale database entries.
Related Pull Request
Component Scope
router/main.pyscripts/verification/verify_canonical_endpoints.py
Summary
During the GitHub operations audit of PR #384 (
fix(router): use LiteLLM master key in responses_api and default backend_conf in execute_proxy), security and stability improvements were identified based on CodeRabbit review feedback and system verification:Identified Issues & Required Improvements
LiteLLM Master Key Fail-Fast Validation (
router/main.py):os.getenv("LITELLM_MASTER_KEY")can resolve toNoneor placeholder strings (e.g., producingBearer None), causing opaque upstream authorization failures.LITELLM_MASTER_KEYbefore constructing Authorization headers inresponses_apiandexecute_proxypathways.Enforce Caller Authentication on Responses Endpoints:
/v1/responsesand/responsesproxy upstream using the server's master key without authenticating incoming client requests first.Dynamic OpenRouter Model Sync & Purge:
Related Pull Request
Component Scope
router/main.pyscripts/verification/verify_canonical_endpoints.py