IanShaw027
7ebca553ef
feat(ops): 实现上游错误事件记录与查询功能
...
**新增功能**:
- 新建ops_upstream_error_events表存储上游服务错误详情
- 支持记录上游429/529/5xx错误的详细上下文信息
- 提供按时间范围查询上游错误事件的API
**后端改动**:
1. 模型层(ops_models.go, ops_port.go):
- 新增UpstreamErrorEvent结构体
- 扩展Repository接口支持上游错误事件CRUD
2. 仓储层(ops_repo.go):
- 实现InsertUpstreamErrorEvent写入上游错误
- 实现GetUpstreamErrorEvents按时间范围查询
3. 服务层(ops_service.go, ops_upstream_context.go):
- ops_service: 新增GetUpstreamErrorEvents查询方法
- ops_upstream_context: 封装上游错误上下文构建逻辑
4. Handler层(ops_error_logger.go):
- 新增GetUpstreamErrorsHandler处理上游错误查询请求
5. Gateway层集成:
- antigravity_gateway_service.go: 429/529错误时记录上游事件
- gateway_service.go: OpenAI 429/5xx错误时记录
- gemini_messages_compat_service.go: Gemini 429/5xx错误时记录
- openai_gateway_service.go: OpenAI 429/5xx错误时记录
- ratelimit_service.go: 429限流错误时记录
**数据记录字段**:
- request_id: 关联ops_logs主记录
- platform/model: 上游服务标识
- status_code/error_message: 错误详情
- request_headers/response_body: 调试信息(可选)
- created_at: 错误发生时间
2026-01-11 15:30:27 +08:00
IanShaw027
89a725a433
feat(ops): 添加QPS脉搏线图并优化指标布局
...
- 添加实时QPS/TPS历史数据追踪(最近60个数据点)
- 在平均QPS/TPS上方添加SVG脉搏线图(sparkline)
- 将延迟和TTFT卡片的指标布局从2列改为3列
- 恢复Max指标显示(P95/P90/P50/Avg/Max)
2026-01-11 11:49:34 +08:00
IanShaw027
645609d441
merge: 正确合并 main 分支改动
...
合并 origin/main 最新改动,正确保留所有配置:
- Ops 运维监控配置和功能
- LinuxDo Connect OAuth 配置
- Update 在线更新配置
- 优惠码功能
- 其他 main 分支新功能
修复之前合并时错误删除 LinuxDo 和 Update 配置的问题。
2026-01-11 11:41:10 +08:00
IanShaw027
fc4ea65936
fix: 临时保存编译错误修复
...
- 添加 LinuxDo 和 Update 配置(从 main 分支缺失)
- 添加 LinuxDoConnectSyntheticEmailDomain 常量
- 添加 IsClaudeCodeClient context key
- 添加 GetLinuxDoConnectOAuthConfig 方法
- 修复 BindStickySession 调用签名
- 修复前端 i18n 重复属性
- 重新生成 wire 依赖注入代码
这个提交准备被合并替换,先保存以防丢失。
2026-01-11 10:59:01 +08:00
Wesley Liddick
0c4f1762c9
Merge pull request #232 from Edric-Li/feat/api-key-ip-restriction
...
feat(settings): 首页自定义内容 & 配置注入优化
2026-01-11 10:36:01 +08:00
kzw200015
24d19a5f78
fix: 从codex请求参数中移除max_output_tokens ( #231 )
...
某些客户端比如 opencode 会在请求中附加 max_output_tokens,这会导致上游返回400错误
2026-01-10 19:37:04 +08:00
Edric Li
3fb4a2b0ff
style: replace interface{} with any per golangci-lint rules
2026-01-10 19:08:41 +08:00
Edric Li
f6f072cb9a
Merge branch 'main' into feat/api-key-ip-restriction
2026-01-10 18:49:50 +08:00
Edric Li
5265b12cc7
feat(settings): add home content customization and config injection
...
- Add home_content setting for custom homepage (HTML or iframe URL)
- Inject public settings into index.html to eliminate page flash
- Support ETag caching with automatic invalidation on settings update
- Add Vite plugin for dev mode settings injection
- Refactor HomeView to use appStore instead of local API calls
2026-01-10 18:37:44 +08:00
yangjianbo
e79dbad602
Merge branch 'main' into test
2026-01-10 14:56:51 +08:00
yangjianbo
6a9cc13e3e
fix(网关): 明确粘性命中范围并优化映射构建
...
仅在粘性命中时构建候选账号映射以减少开销
新增用例验证粘性账号缺失时回退负载感知选择
2026-01-10 14:51:16 +08:00
shaw
d1a6d6b1cf
Merge branch 'mt21625457/main'
2026-01-10 14:44:58 +08:00
yangjianbo
7a0ca05233
perf(网关): 粘性会话命中复用候选账号
...
使用候选账号映射避免粘性命中时额外的 GetByID 查询
新增单测确保粘性命中不触发 GetByID 且提前返回
2026-01-10 14:39:33 +08:00
IanShaw027
3a67002cfe
merge: 合并主分支改动并保留 ops 监控实现
...
合并 main 分支的最新改动到 ops 监控分支。
冲突解决策略:保留当前分支的 ops 相关改动,接受主分支的其他改动。
保留的 ops 改动:
- 运维监控配置和依赖注入
- 运维监控 API 处理器和中间件
- 运维监控服务层和数据访问层
- 运维监控前端界面和状态管理
接受的主分支改动:
- Linux DO OAuth 集成
- 账号过期功能
- IP 地址限制功能
- 用量统计优化
- 其他 bug 修复和功能改进
2026-01-10 13:24:40 +08:00
long
9f4d4e5adf
feat: 实现注册优惠码功能
...
- 支持创建/编辑/删除优惠码,设置赠送金额和使用限制
- 注册页面实时验证优惠码并显示赠送金额
- 支持 URL 参数自动填充 (?promo=CODE)
- 添加优惠码验证接口速率限制
- 使用数据库行锁防止并发超限
- 新增后台优惠码管理页面,支持复制注册链接
2026-01-10 13:23:03 +08:00
long
d2fc14fb97
feat: 实现注册优惠码功能
...
- 支持创建/编辑/删除优惠码,设置赠送金额和使用限制
- 注册页面实时验证优惠码并显示赠送金额
- 支持 URL 参数自动填充 (?promo=CODE)
- 添加优惠码验证接口速率限制
- 使用数据库行锁防止并发超限
- 新增后台优惠码管理页面,支持复制注册链接
2026-01-10 13:14:35 +08:00
yangjianbo
3730819857
chore(合并): 修复合并冲突并保留分组上下文优化
...
解决 GroupRepository 接口签名更新导致的测试失败
保留 ctxkey.Group Hydrated 覆盖逻辑相关测试
测试: make test-backend
2026-01-10 10:00:49 +08:00
yangjianbo
297f08c683
Merge branch 'test' into dev
2026-01-10 09:39:02 +08:00
yangjianbo
435f693892
test(分组): 增加无效上下文覆盖回归测试
...
补充 GatewayService 与 APIKey 中间件对无效 ctxkey.Group 的覆盖行为测试
测试: make test-backend
2026-01-10 09:27:47 +08:00
yangjianbo
72f78f8a56
fix(分组): 强化上下文分组可信校验
...
- 引入 Hydrated 标记限制复用来源
- 无效上下文分组允许被新值覆盖自愈
- 更新相关单测覆盖
2026-01-10 08:40:27 +08:00
yangjianbo
2597fe78ba
fix(分组): 防止降级环并校验上下文分组
...
- 增加降级链路环检测并拦截配置
- 仅复用合法分组上下文并必要时回退查询
- 标注 GetByIDLite 轻量语义并补充测试
2026-01-10 07:56:50 +08:00
IanShaw027
585257d340
feat(运维监控): 增强监控功能和健康评分系统
...
后端改进:
- 新增健康评分计算服务(ops_health_score.go)
- 添加分布式锁支持(ops_advisory_lock.go)
- 优化指标采集和聚合逻辑
- 新增运维指标采集间隔配置(60-3600秒)
- 移除未使用的WebSocket查询token认证中间件
- 改进清理服务和告警评估逻辑
前端改进:
- 简化OpsDashboard组件结构
- 完善国际化文本(中英文)
- 新增运维监控相关API类型定义
- 添加运维指标采集间隔设置界面
- 优化错误详情模态框
测试:
- 添加健康评分单元测试
- 更新API契约测试
2026-01-10 01:38:47 +08:00
yangjianbo
675543240e
perf(网关): 复用分组上下文减少热路径查询
...
新增 GetByIDLite 并在网关与 Gemini 选择流程复用上下文 group,避免 COUNT 触发
更新 API key 中间件注入 group 上下文,减少重复查库
补充 gateway/gemini 中间件与仓库层回归测试
测试: make test
2026-01-09 23:01:42 +08:00
Song Siyu
7d1fe818be
feat: antigravity 配额域限流 + SSE 上限 ( #222 )
...
* fix: 添加 gemini-3-flash 前缀映射支持 gemini-3-flash-preview
* feat(antigravity): 增强请求参数和注入 Antigravity 身份 system prompt
* feat: antigravity 配额域限流
* chore: 调整 SSE 单行上限到 25MB
* chore: 提升 SSE 单行上限到 40MB
2026-01-09 22:00:14 +08:00
Edric.Li
0a4641c24e
feat(api-key): 添加 IP 白名单/黑名单限制功能 ( #221 )
...
* feat(api-key): add IP whitelist/blacklist restriction and usage log IP tracking
- Add IP restriction feature for API keys (whitelist/blacklist with CIDR support)
- Add IP address logging to usage logs (admin-only visibility)
- Remove billing_type column from usage logs UI (redundant)
- Use generic "Access denied" error message for security
Backend:
- New ip package with IP/CIDR validation and matching utilities
- Database migrations for ip_whitelist, ip_blacklist (api_keys) and ip_address (usage_logs)
- Middleware IP restriction check after API key validation
- Input validation for IP/CIDR patterns on create/update
Frontend:
- API key form with enable toggle for IP restriction
- Shield icon indicator in table for keys with IP restriction
- Removed billing_type filter and column from usage views
* fix: update API contract tests for ip_whitelist/ip_blacklist fields
Add ip_whitelist and ip_blacklist fields to expected JSON responses
in API contract tests to match the new API key schema.
2026-01-09 21:59:32 +08:00
Edric Li
6b97a8be28
Merge branch 'main' into feat/api-key-ip-restriction
2026-01-09 21:34:28 +08:00
Edric Li
90798f14b5
feat(api-key): add IP whitelist/blacklist restriction and usage log IP tracking
...
- Add IP restriction feature for API keys (whitelist/blacklist with CIDR support)
- Add IP address logging to usage logs (admin-only visibility)
- Remove billing_type column from usage logs UI (redundant)
- Use generic "Access denied" error message for security
Backend:
- New ip package with IP/CIDR validation and matching utilities
- Database migrations for ip_whitelist, ip_blacklist (api_keys) and ip_address (usage_logs)
- Middleware IP restriction check after API key validation
- Input validation for IP/CIDR patterns on create/update
Frontend:
- API key form with enable toggle for IP restriction
- Shield icon indicator in table for keys with IP restriction
- Removed billing_type filter and column from usage views
2026-01-09 21:24:59 +08:00
IanShaw027
2d123a11ad
feat(设置): 集成运维监控配置到系统设置
...
- 扩展 setting_handler 支持 ops 配置管理
- 扩展 setting_service 支持 ops 配置持久化
- 更新 settings_view 包含 ops 配置视图
2026-01-09 20:57:32 +08:00
IanShaw027
5baa8b5673
feat(service): 实现运维监控业务逻辑层
...
- 新增 ops 主服务(ops_service.go)和端口定义(ops_port.go)
- 实现账号可用性检查服务(ops_account_availability.go)
- 实现数据聚合服务(ops_aggregation_service.go)
- 实现告警评估服务(ops_alert_evaluator_service.go)
- 实现告警管理服务(ops_alerts.go)
- 实现数据清理服务(ops_cleanup_service.go)
- 实现并发控制服务(ops_concurrency.go)
- 实现仪表板服务(ops_dashboard.go)
- 实现错误处理服务(ops_errors.go)
- 实现直方图服务(ops_histograms.go)
- 实现指标采集服务(ops_metrics_collector.go)
- 实现查询模式服务(ops_query_mode.go)
- 实现实时监控服务(ops_realtime.go)
- 实现请求详情服务(ops_request_details.go)
- 实现重试机制服务(ops_retry.go)
- 实现配置管理服务(ops_settings.go)
- 实现趋势分析服务(ops_trends.go)
- 实现窗口统计服务(ops_window_stats.go)
- 添加 ops 相关领域常量
- 注册 service 依赖注入
2026-01-09 20:53:44 +08:00
IanShaw027
d55866d375
feat(数据库): 添加运维监控数据模型和数据库迁移脚本
...
- 新增 ops 监控数据库迁移脚本(表结构定义)
- 定义核心数据模型(ops_models.go)
- 定义告警相关模型(ops_alert_models.go)
- 定义仪表板数据模型(ops_dashboard_models.go)
- 定义实时监控数据模型(ops_realtime_models.go)
- 定义配置相关模型(ops_settings_models.go)
- 定义趋势分析数据模型(ops_trend_models.go)
2026-01-09 20:52:17 +08:00
shaw
62dc0b953b
Merge branch 'fix/table-pagination-and-features'
2026-01-09 20:42:05 +08:00
IanShaw027
7c3d5cadd5
fix(admin): 代码审查修复 - 输入验证和测试完善
...
根据 Codex 代码审查报告,修复所有 P0 和 P1 优先级问题。
## P0 紧急修复
### 1. 修复集成测试编译错误
- 更新 group_repo_integration_test.go 中所有 ListWithFilters 调用
- 添加缺失的 search 参数(传入空字符串)
- 修复 4 处旧签名调用,避免 CI 编译失败
### 2. 添加统一的 search 参数输入验证
为所有 admin handler 添加一致的输入验证逻辑:
- group_handler.go: 添加 TrimSpace + 长度限制
- proxy_handler.go: 添加 TrimSpace + 长度限制
- redeem_handler.go: 添加 TrimSpace + 长度限制
- user_handler.go: 添加 TrimSpace + 长度限制
验证规则:
- TrimSpace() 去除首尾空格
- 最大长度 100 字符(防止 DoS 攻击)
- 超长输入自动截断
## P1 改进
### 3. 补充 search 功能的单元测试
新增 admin_service_group_test.go 中的测试:
- TestAdminService_ListGroups_WithSearch
- search 参数正常传递到 repository 层
- search 为空字符串时的行为
- search 与其他过滤条件组合使用
新增 admin_service_search_test.go 文件:
- 为其他 admin API 添加 search 测试覆盖
- 统一的测试模式和断言
### 4. 补充 search 功能的集成测试
新增 group_repo_integration_test.go 测试场景:
- TestListWithFilters_Search
- 搜索 name 字段匹配
- 搜索 description 字段匹配
- 搜索不存在内容(返回空)
- 大小写不敏感测试
- 特殊字符转义测试(%、_)
- 与其他过滤条件组合
## 测试结果
- ✅ 编译检查通过
- ✅ 单元测试全部通过 (3/3)
- ✅ 集成测试编译通过
- ✅ 所有 service 测试通过
## 影响范围
修改文件: 8 个
代码变更: +234 行 / -8 行
## 相关 Issue
解决代码审查中的安全性和稳定性问题:
- 防止 DoS 攻击(超长搜索字符串)
- 修复测试编译错误(CI 阻塞问题)
- 提升测试覆盖率
2026-01-09 19:43:19 +08:00
shaw
f060db0b30
fix: 加固 LinuxDo OAuth 登录安全与配置校验
2026-01-09 19:32:06 +08:00
IanShaw027
5e936fbf0e
feat(admin): 添加账号批量调度开关功能
...
- 后端:支持批量更新账号的 schedulable 字段
- 在 BulkUpdateAccountsRequest 中添加 schedulable 参数
- 在 AccountBulkUpdate 中添加 schedulable 字段支持
- 更新 repository 层批量更新 SQL 逻辑
- 前端:在账号管理页面添加批量调度控制
- 新增"批量启用调度"和"批量停止调度"按钮
- 添加 handleBulkToggleSchedulable 处理函数
- 显示具体的成功提示信息(包含操作账号数量)
- 国际化:添加批量调度相关中英文翻译
- 优化:添加 search 参数标准化和验证(account_handler)
2026-01-09 19:26:32 +08:00
IanShaw027
3820232241
fix(admin): 修复表格批量操作和搜索功能问题
...
1. 恢复账号管理批量操作栏缺失的功能按钮
- 添加"本页全选"按钮支持批量选择当前页所有账号
- 添加"清除已选"按钮快速清空已选账号列表
- 在重构拆分组件时遗漏,现已恢复
2. 修复分组管理搜索功能仅搜索当前页的问题
- 前端:移除本地过滤逻辑,改用后端搜索
- 后端:添加 search 参数支持,搜索名称和描述字段
- 支持不区分大小写的模糊匹配
- 统一所有管理页面的搜索体验
2026-01-09 18:58:06 +08:00
shaw
1a1e23fc76
fix(auth): 注册接口安全加固 - 默认关闭注册
2026-01-09 18:26:32 +08:00
admin
d1c2a61d19
refactor(auth): 将 Linux DO OAuth 配置迁移到系统设置
...
- 将 LinuxDo Connect 配置从环境变量迁移到数据库持久化
- 在管理后台系统设置中添加 LinuxDo OAuth 配置项
- 简化部署流程,无需修改 docker-compose.override.yml
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-09 18:26:32 +08:00
admin
152d0cdec6
feat(auth): 添加 Linux DO Connect OAuth 登录支持
...
- 新增 Linux DO OAuth 配置项和环境变量支持
- 实现 OAuth 授权流程和回调处理
- 前端添加 Linux DO 登录按钮和回调页面
- 支持通过 Linux DO 账号注册/登录
- 添加相关国际化文本
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-09 18:26:32 +08:00
shaw
43f104bdf7
fix(auth): 注册接口安全加固 - 默认关闭注册
2026-01-09 14:49:20 +08:00
shaw
0a9c17b9d1
Merge PR #213 : feat(openai): 支持 OpenAI Responses API 标准内容格式
2026-01-09 10:40:47 +08:00
程序猿MT
799b010631
fix(auth): 修复 RefreshToken 使用过期 token 时的 nil pointer panic ( #214 )
...
* fix(auth): 修复 RefreshToken 使用过期 token 时的 nil pointer panic
问题分析:
- RefreshToken 允许过期 token 继续流程(用于无感刷新)
- 但 ValidateToken 在 token 过期时返回 nil claims
- 导致后续访问 claims.UserID 时触发 panic
修复方案:
- 修改 ValidateToken,在检测到 ErrTokenExpired 时仍然返回 claims
- jwt-go 在解析时即使遇到过期错误,token.Claims 仍会被填充
- 这样 RefreshToken 可以正常获取用户信息并生成新 token
新增测试:
- TestAuthService_ValidateToken_ExpiredReturnsClaimsWithError
- TestAuthService_RefreshToken_ExpiredTokenNoPanic
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
* fix(auth): 修复邮件验证服务未配置时可绕过验证的安全漏洞
当邮件验证开启但 emailService 未配置时,原逻辑允许用户绕过验证直接注册。
现在会返回 ErrServiceUnavailable 拒绝注册,确保配置错误不会导致安全问题。
- 在验证码检查前先检查 emailService 是否配置
- 添加日志记录帮助发现配置问题
- 新增单元测试覆盖该场景
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
---------
Co-authored-by: yangjianbo <yangjianbo@leagsoft.com >
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-09 10:37:15 +08:00
shaw
2d83941aaa
feat(antigravity): 添加 URL fallback 机制 (sandbox → daily → prod)
2026-01-09 10:36:56 +08:00
Call White
f6a9a0a45a
Merge pull request #1 from cyhhao/feat/ai-sdk-compatibility
...
feat(openai): add AI SDK content format compatibility for OAuth accounts
2026-01-09 00:47:44 +08:00
cyhhao
5b8d4fb047
feat(openai): add AI SDK content format compatibility for OAuth accounts
...
- Add normalizeInputForCodexAPI function to convert AI SDK multi-part
content format to simplified format expected by ChatGPT Codex API
- AI SDK sends: {"content": [{"type": "input_text", "text": "..."}]}
- Codex API expects: {"content": "..."}
- Only applies to OAuth accounts (ChatGPT internal API)
- API Key accounts remain unchanged (OpenAI Platform API supports both)
2026-01-09 00:34:49 +08:00
IanShaw
afcfbb458d
fix(gemini): Google One 强制使用内置 OAuth client + 自动获取 project_id + UI 优化 ( #212 )
...
* fix(gemini): Google One 强制使用内置 OAuth client + 自动获取 project_id + UI 优化
## 后端改动
### 1. Google One 强制使用内置 Gemini CLI OAuth Client
**问题**:
- Google One 之前允许使用自定义 OAuth client,导致认证流程不稳定
- 与 Code Assist 的行为不一致
**解决方案**:
- 修改 `gemini_oauth_service.go`: Google One 现在与 Code Assist 一样强制使用内置 client (L122-135)
- 更新 `gemini_oauth_client.go`: ExchangeCode 和 RefreshToken 方法支持强制内置 client (L31-44, L77-86)
- 简化 `geminicli/oauth.go`: Google One scope 选择逻辑 (L187-190)
- 标记 `geminicli/constants.go`: DefaultGoogleOneScopes 为 DEPRECATED (L30-33)
- 更新测试用例以反映新行为
**OAuth 类型对比**:
| OAuth类型 | Client来源 | Scopes | Redirect URI |
|-----------|-----------|--------|-----------------|
| code_assist | 内置 Gemini CLI | DefaultCodeAssistScopes | https://codeassist.google.com/authcode |
| google_one | 内置 Gemini CLI (新) | DefaultCodeAssistScopes | https://codeassist.google.com/authcode |
| ai_studio | 必须自定义 | DefaultAIStudioScopes | http://localhost:1455/auth/callback |
### 2. Google One 自动获取 project_id
**问题**:
- Google One 个人账号测试模型时返回 403/404 错误
- 原因:cloudaicompanion API 需要 project_id,但个人账号无需手动创建 GCP 项目
**解决方案**:
- 修改 `gemini_oauth_service.go`: OAuth 流程中自动调用 fetchProjectID
- Google 通过 LoadCodeAssist API 自动分配 project_id
- 与 Gemini CLI 行为保持一致
- 后端根据 project_id 自动选择正确的 API 端点
**影响**:
- Google One 账号现在可以正常使用(需要重新授权)
- Code Assist 和 AI Studio 账号不受影响
### 3. 修复 Gemini 测试账号无内容输出问题
**问题**:
- 测试 Gemini 账号时只显示"测试成功",没有显示 AI 响应内容
- 原因:processGeminiStream 在检查到 finishReason 时立即返回,跳过了内容提取
**解决方案**:
- 修改 `account_test_service.go`: 调整逻辑顺序,先提取内容再检查是否完成
- 确保最后一个 chunk 的内容也能被正确显示
**影响**:
- 所有 Gemini 账号类型(API Key、OAuth)的测试现在都会显示完整响应内容
- 用户可以看到流式输出效果
## 前端改动
### 1. 修复图标宽度压缩问题
**问题**:
- 账户类型选择按钮中的图标在某些情况下会被压缩变形
**解决方案**:
- 修改 `CreateAccountModal.vue`: 为所有平台图标容器添加 `shrink-0` 类
- 确保 Anthropic、OpenAI、Gemini、Antigravity 图标保持固定 8×8 尺寸 (32px × 32px)
### 2. 优化重新授权界面
**问题**:
- 重新授权时显示三个可点击的授权类型选择按钮,可能导致用户误切换到不兼容的授权方式
**解决方案**:
- 修改 `ReAuthAccountModal.vue` (admin 和普通用户版本):
- 将可点击的授权类型选择按钮改为只读信息展示框
- 根据账号的 `credentials.oauth_type` 动态显示对应图标和文本
- 删除 `geminiAIStudioOAuthEnabled` 状态和 `handleSelectGeminiOAuthType` 方法
- 防止用户误操作
## 测试验证
- ✅ 所有后端单元测试通过
- ✅ OAuth client 选择逻辑正确
- ✅ Google One 和 Code Assist 行为一致
- ✅ 测试账号显示完整响应内容
- ✅ UI 图标显示正常
- ✅ 重新授权界面只读展示正确
* fix(lint): 修复 golangci-lint 错误信息格式问题
- 将错误信息改为小写开头以符合 Go 代码规范
- 修复 ST1005: error strings should not be capitalized
2026-01-08 23:47:29 +08:00
Edric Li
b7a29a4bac
fix: update mock interfaces and fix gofmt issues for CI
...
- Update mockGatewayCacheForPlatform and mockGatewayCacheForGemini
to match new GatewayCache interface with groupID parameter
- Fix gofmt formatting in group_handler.go and admin_service.go
2026-01-08 23:13:57 +08:00
Edric Li
a42105881f
feat(groups): add Claude Code client restriction and session isolation
...
- Add claude_code_only field to restrict groups to Claude Code clients only
- Add fallback_group_id for non-Claude Code requests to use alternate group
- Implement ClaudeCodeValidator for User-Agent detection
- Add group-level session binding isolation (groupID in Redis key)
- Prevent cross-group sticky session pollution
- Update frontend with Claude Code restriction controls
2026-01-08 23:07:00 +08:00
Edric Li
958ffe7a8a
test: fix unit tests for user_agent and proxy repo interface
...
- Add user_agent field to API contract test expectation
- Add ListWithFiltersAndAccountCount stub to proxyRepoStub
2026-01-08 21:44:18 +08:00
Edric Li
b46b3c5c3c
Merge remote-tracking branch 'upstream/main'
2026-01-08 21:35:34 +08:00
Edric Li
eb198e5969
feat(proxies): add account count column to proxy list
...
Display the number of accounts bound to each proxy in the admin proxy
management page, similar to the groups list view.
2026-01-08 21:20:12 +08:00