1. 01 Mar, 2026 1 commit
    • QTom's avatar
      fix(ci): 修复 golangci-lint 和 API 合约测试失败 · b2141a96
      QTom authored
      - 修复 errcheck: singleflight 返回值类型断言添加 ok 检查
      - 修复 gofmt: 格式化 setting_service.go 和 claude_code_validator_test.go
      - 修复 TestAPIContracts: 在 GET /admin/settings 期望中添加 min_claude_code_version 字段
      b2141a96
  2. 28 Feb, 2026 3 commits
    • QTom's avatar
      fix: sync test constructor calls with new rpmCache parameter · e135435c
      QTom authored
      Add missing nil argument for rpmCache to NewAccountHandler (5 sites)
      and NewGatewayService (2 sites) after RPM feature expanded their
      signatures.
      e135435c
    • QTom's avatar
      feat(admin): 完整实现管理员修改用户 API Key 分组的功能 · 9a91815b
      QTom authored
      ## 核心功能
      - 添加 AdminUpdateAPIKeyGroupID 服务方法,支持绑定/解绑/保持不变三态语义
      - 实现 UserRepository.AddGroupToAllowedGroups 接口,自动同步专属分组权限
      - 添加 HTTP PUT /api-keys/:id handler 端点,支持管理员直接修改 API Key 分组
      
      ## 事务一致性
      - 使用 ent Tx 保证专属分组绑定时「添加权限」和「更新 Key」的原子性
      - Repository 方法支持 clientFromContext,兼容事务内调用
      - 事务失败时自动回滚,避免权限孤立
      
      ## 业务逻辑
      - 订阅类型分组阻断,需通过订阅管理流程
      - 非活跃分组拒绝绑定
      - 负 ID 和非法 ID 验证
      - 自动授权响应,告知管理员成功授权的分组
      
      ## 代码质量
      - 16 个单元测试覆盖所有业务路径和边界用例
      - 7 个 handler 集成测试覆盖 HTTP 层
      - GroupRepo stub 返回克隆副本,防止测试间数据泄漏
      - API 类型安全修复(PaginatedResponse<ApiKey>)
      - 前端 ref 回调类型对齐 Vue 规范
      
      ## 国际化支持
      - 中英文提示信息完整
      - 自动授权成功/失败提示
      9a91815b
    • yangjianbo's avatar
      feat(sync): full code sync from release · bb664d9b
      yangjianbo authored
      bb664d9b
  3. 22 Feb, 2026 1 commit
  4. 17 Feb, 2026 1 commit
  5. 11 Feb, 2026 1 commit
    • kyx236's avatar
      feat(admin): Add group filtering for account listings · fe1d46a8
      kyx236 authored
      - Add groupID parameter to ListAccounts and ListWithFilters methods
      - Implement account filtering by group ID in repository query
      - Add group query parameter parsing in account handler
      - Update all ListAccounts/ListWithFilters call sites with groupID parameter
      - Add group filter UI component to AccountTableFilters
      - Add i18n translations for group filter label in English and Chinese
      - Update API contract and test stubs to reflect new signature
      - Enable filtering accounts by their assigned groups in admin panel
      fe1d46a8
  6. 09 Feb, 2026 2 commits
  7. 08 Feb, 2026 2 commits
    • bayma888's avatar
      feat(admin): add drag-and-drop group sort order · bac9e2bf
      bayma888 authored
      - Add `sort_order` field to groups table with migration
      - Add `PUT /api/v1/admin/groups/sort-order` API for batch update
      - Implement drag-and-drop UI using vue-draggable-plus
      - All queries now order groups by sort_order
      - Add i18n support (en/zh) for sort-related UI text
      - Update test stubs to satisfy new interface methods
      bac9e2bf
    • yangjianbo's avatar
      test: 完善自动化测试体系(7个模块,73个任务) · bb5a5dd6
      yangjianbo authored
      
      
      系统性地修复、补充和强化项目的自动化测试能力:
      
      1. 测试基础设施修复
         - 修复 stubConcurrencyCache 缺失方法和构造函数参数不匹配
         - 创建 testutil 共享包(stubs.go, fixtures.go, httptest.go)
         - 为所有 Stub 添加编译期接口断言
      
      2. 中间件测试补充
         - 新增 JWT 认证中间件测试(有效/过期/篡改/缺失 Token)
         - 补充 rate_limiter 和 recovery 中间件测试场景
      
      3. 网关核心路径测试
         - 新增账户选择、等待队列、流式响应、并发控制、计费、Claude Code 检测测试
         - 覆盖负载均衡、粘性会话、SSE 转发、槽位管理等关键逻辑
      
      4. 前端测试体系(11个新测试文件,163个测试用例)
         - Pinia stores: auth, app, subscriptions
         - API client: 请求拦截器、响应拦截器、401 刷新
         - Router guards: 认证重定向、管理员权限、简易模式限制
         - Composables: useForm, useTableLoader, useClipboard
         - Components: LoginForm, ApiKeyCreate, Dashboard
      
      5. CI/CD 流水线重构
         - 重构 backend-ci.yml 为统一的 ci.yml
         - 前后端 4 个并行 Job + Postgres/Redis services
         - Race 检测、覆盖率收集与门禁、Docker 构建验证
      
      6. E2E 自动化测试
         - e2e-test.sh 自动化脚本(Docker 启动→健康检查→测试→清理)
         - 用户注册→登录→API Key→网关调用完整链路测试
         - Mock 模式和 API Key 脱敏支持
      
      7. 修复预存问题
         - tlsfingerprint dialer_test.go 缺失 build tag 导致集成测试编译冲突
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      bb5a5dd6
  8. 07 Feb, 2026 2 commits
    • yangjianbo's avatar
      fix(audit): 第二批审计修复 — P0 生产 Bug、安全加固、性能优化、缓存一致性、代码质量 · 2588fa6a
      yangjianbo authored
      
      
      基于 backend-code-audit 审计报告,修复剩余 P0/P1/P2 共 34 项问题:
      
      P0 生产 Bug:
      - 修复 time.Since(time.Now()) 计时逻辑错误 (P0-03)
      - generateRandomID 改用 crypto/rand 替代固定索引 (P0-04)
      - IncrementQuotaUsed 重写为 Ent 原子操作消除 TOCTOU 竞态 (P0-05)
      
      安全加固:
      - gateway/openai handler 错误响应替换为泛化消息,防止内部信息泄露 (P1-14)
      - usage_log_repo dateFormat 参数改用白名单映射,防止 SQL 注入 (P1-16)
      - 默认配置安全加固:sslmode=prefer、response_headers=true、mode=release (P1-18/19, P2-15)
      
      性能优化:
      - gateway handler 循环内 defer 替换为显式 releaseWait 闭包 (P1-02)
      - group_repo/promo_code_repo Count 前 Clone 查询避免状态污染 (P1-03)
      - usage_log_repo 四个查询添加 LIMIT 10000 防止 OOM (P1-07)
      - GetBatchUsageStats 添加时间范围参数,默认最近 30 天 (P1-10)
      - ip.go CIDR 预编译为包级变量 (P1-11)
      - BatchUpdateCredentials 重构为先验证后更新 (P1-13)
      
      缓存一致性:
      - billing_cache 添加 jitteredTTL 防止缓存雪崩 (P2-10)
      - DeductUserBalance/UpdateSubscriptionUsage 错误传播修复 (P2-12)
      - UserService.UpdateBalance 成功后异步失效 billingCache (P2-13)
      
      代码质量:
      - search 截断改为按 rune 处理,支持多字节字符 (P2-01)
      - TLS Handshake 改为 HandshakeContext 支持 context 取消 (P2-07)
      - CORS 预检添加 Access-Control-Max-Age: 86400 (P2-16)
      
      测试覆盖:
      - 新增 user_service_test.go(UpdateBalance 缓存失效 6 个用例)
      - 新增 batch_update_credentials_test.go(fail-fast + 类型验证 7 个用例)
      - 新增 response_transformer_test.go、ip_test.go、usage_log_repo_unit_test.go、search_truncate_test.go
      - 集成测试:IncrementQuotaUsed 并发测试、billing_cache 错误传播测试
      - config_test.go 补充 server.mode/sslmode 默认值断言
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      2588fa6a
    • yangjianbo's avatar
      fix(middleware): 管理员JWT增加TokenVersion校验 · 65c0d8b5
      yangjianbo authored
      管理员改密后旧JWT会被拒绝,并补充单元测试覆盖。
      65c0d8b5
  9. 05 Feb, 2026 3 commits
    • LLLLLLiulei's avatar
      perf: batch fetch proxies for account export · 0b45d48e
      LLLLLLiulei authored
      0b45d48e
    • shaw's avatar
      feat: 支持用户专属分组倍率配置 · 2b192f7d
      shaw authored
      2b192f7d
    • JIA-ss's avatar
      feat(gateway): filter /v1/usage stats by API Key instead of UserID · fa3ea5ee
      JIA-ss authored
      
      
      Previously the /v1/usage endpoint aggregated usage stats (today/total
      tokens, cost, RPM/TPM) across all API Keys belonging to the user.
      This made it impossible to distinguish usage from different API Keys
      (e.g. balance vs subscription keys).
      
      Now the usage stats are filtered by the current request's API Key ID,
      so each key only sees its own usage data. The balance/remaining fields
      are unaffected and still reflect the user-level wallet balance.
      
      Changes:
      - Add GetAPIKeyDashboardStats to repository interface and implementation
      - Add getPerformanceStatsByAPIKey helper (also fixes TPM to include
        cache_creation_tokens and cache_read_tokens)
      - Add GetAPIKeyDashboardStats to UsageService
      - Update Usage handler to call GetAPIKeyDashboardStats(apiKey.ID)
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      fa3ea5ee
  10. 03 Feb, 2026 6 commits
  11. 02 Feb, 2026 2 commits
  12. 01 Feb, 2026 1 commit
    • yangjianbo's avatar
      feat(Sora): 直连生成并移除sora2api依赖 · 399dd78b
      yangjianbo authored
      实现直连 Sora 客户端、媒体落地与清理策略\n更新网关与前端配置以支持 Sora 平台\n补齐单元测试与契约测试,新增 curl 测试脚本\n\n测试: go test ./... -tags=unit
      399dd78b
  13. 30 Jan, 2026 1 commit
    • yangjianbo's avatar
      feat(账号): 添加 Sora 账号双表同步与创建 · 99dc3b59
      yangjianbo authored
      - 新增 sora_accounts 表与 accounts.extra GIN 索引\n- OpenAI OAuth 支持同时创建 Sora 账号并同步配置\n- Token 刷新同步关联 Sora 账号凭证与扩展表\n- 增加 Sora 账号连通性测试与前端开关文案
      99dc3b59
  14. 28 Jan, 2026 1 commit
  15. 26 Jan, 2026 1 commit
    • shaw's avatar
      feat(auth): 实现 TOTP 双因素认证功能 · 1245f07a
      shaw authored
      新增功能:
      - 支持 Google Authenticator 等应用进行 TOTP 二次验证
      - 用户可在个人设置中启用/禁用 2FA
      - 登录时支持 TOTP 验证流程
      - 管理后台可全局开关 TOTP 功能
      
      安全增强:
      - TOTP 密钥使用 AES-256-GCM 加密存储
      - 添加 TOTP_ENCRYPTION_KEY 配置项,必须手动配置才能启用功能
      - 防止服务重启导致加密密钥变更使用户无法登录
      - 验证失败次数限制,防止暴力破解
      
      配置说明:
      - Docker 部署:在 .env 中设置 TOTP_ENCRYPTION_KEY
      - 非 Docker 部署:在 config.yaml 中设置 totp.encryption_key
      - 生成密钥命令:openssl rand -hex 32
      1245f07a
  16. 24 Jan, 2026 3 commits
    • shaw's avatar
      feat(auth): 密码重置邮件队列化与限流优化 · 9cc83525
      shaw authored
      - 邮件发送改为异步队列处理,避免并发导致发送失败
      - 新增 Email 维度限流(30秒冷却期),防止邮件轰炸
      - Token 验证使用常量时间比较,防止时序攻击
      - 重构代码消除冗余,提取公共验证逻辑
      9cc83525
    • shaw's avatar
      fix(test): 修复订阅相关测试失败问题 · 43a1031e
      shaw authored
      1. 使用未来日期(2099年)作为测试订阅的过期时间,避免
         normalizeSubscriptionStatus 将测试数据标记为过期
      2. 修复 List 方法调用参数不足的问题(新增 sortBy/sortOrder 参数)
      43a1031e
    • shaw's avatar
      feat(subscription): 订阅过期状态自动更新与服务端排序 · b0aa2354
      shaw authored
      - 新增 SubscriptionExpiryService 定时任务,每分钟更新过期订阅状态
      - 订阅列表支持服务端排序(按过期时间、状态、创建时间)
      - 实时显示正确的过期状态,无需等待定时任务
      - 允许对已过期订阅进行续期操作
      - DataTable 组件支持 serverSideSort 模式
      b0aa2354
  17. 22 Jan, 2026 1 commit
  18. 20 Jan, 2026 2 commits
  19. 19 Jan, 2026 6 commits