"vscode:/vscode.git/clone" did not exist on "1acfc46f46b9acbead5ff32022f59ce8cf55097b"
- 27 Dec, 2025 1 commit
-
-
IanShaw authored
* fix(middleware): 修复 Gemini API Key 认证中间件用户上下文类型错误 修复了 ApiKeyAuthWithSubscriptionGoogle 中间件中设置用户上下文时的类型错误。 **问题:** - 中间件直接设置 `apiKey.User` 对象到上下文 - 导致 handler 中获取 `AuthSubject` 时类型断言失败 - 所有 Gemini v1beta 端点返回 500 "User context not found" **修复:** - 改为设置 `AuthSubject` 结构体,与 `api_key_auth.go` 保持一致 - 添加 `ContextKeyUserRole` 设置以完整支持角色检查 **影响范围:** - Gemini v1beta API 端点 (generateContent, streamGenerateContent) - 使用 Google API Key 认证的所有请求 **测试:** - 验证 Gemini CLI 调用成功返回 200 - 确认用户上下文正确传递到 handler * fix(web): 修复 /responses 端点被前端中间件拦截的问题 - 将 /responses 路径添加到 API 白名单,防止其被当作前端路由处理 - 修复 /responses 端点返回 HTML 而非 API 响应的 BUG - 解决 codex CLI stream 在远程服务器上断开连接的问题 根本原因: 在 6c469b42 提交中添加了 /responses 路由,但未同步更新前端嵌入中间件 的 API 白名单,导致该路由被拦截并返回 index.html 而非 API 响应。
-
- 26 Dec, 2025 2 commits
-
-
ianshaw authored
- 更新 middleware import 路径到 internal/server/middleware - 修复 api_key_auth_google.go 使用正确的 service 类型 - 更新 router.go 和 http.go 支持 Gemini v1beta 路由 - 在 routes/gateway.go 中添加 Gemini v1beta API 端点 - 在 routes/admin.go 中添加 Gemini OAuth 路由 - 更新 wire.go 添加 GeminiOAuthService cleanup - 重新生成 wire_gen.go
-
ianshaw authored
- 新增 api_key_auth_google.go: 支持 x-goog-api-key 格式认证 - 更新 api_key_auth.go: 适配 Gemini 原生 API 格式
-