实现双授权系统:支持FACTORY_API_KEY环境变量优先级和客户端授权回退机制

- 新增FACTORY_API_KEY环境变量支持(最高优先级)
- 保留现有refresh token自动刷新机制
- 添加客户端authorization头作为fallback
- 优化启动流程,无认证配置时不报错退出
- 更新所有端点支持新的授权优先级系统
- 修改GPT-5-Codex推理级别为off
This commit is contained in:
1e0n
2025-10-08 19:42:39 +08:00
parent 2dc8c89270
commit 25f89a12b7
4 changed files with 72 additions and 50 deletions

View File

@@ -110,7 +110,8 @@ app.use((err, req, res, next) => {
logInfo('Configuration loaded successfully');
logInfo(`Dev mode: ${isDevMode()}`);
// Initialize auth system (load and refresh API key)
// Initialize auth system (load and setup API key if needed)
// This won't throw error if no auth config is found - will use client auth
await initializeAuth();
const PORT = getPort();