1. 08 Apr, 2026 1 commit
  2. 05 Apr, 2026 2 commits
  3. 31 Mar, 2026 1 commit
  4. 26 Mar, 2026 1 commit
    • shaw's avatar
      feat: 网关请求头 wire casing 保持、转发行为开关、调试日志增强及 accept-encoding 恢复 · b20e1422
      shaw authored
      - 新增 header_util.go,通过 setHeaderRaw/getHeaderRaw/addHeaderRaw 绕过
        Go 的 canonical-case 规范化,保持真实 Claude CLI 抓包的请求头大小写
        (如 "x-app" 而非 "X-App","X-Stainless-OS" 而非 "X-Stainless-Os")
      - 新增管理后台开关:指纹统一化(默认开启)和 metadata 透传(默认关闭),
        使用 atomic.Value + singleflight 缓存模式,60s TTL
      - 调试日志从控制台 body 打印升级为文件级完整快照
        (按真实 wire 顺序输出 headers + 格式化 JSON body + 上下文元数据)
      - 恢复 accept-encoding 到白名单,在 http_upstream.go 新增 decompressResponseBody
        处理 gzip/brotli/deflate 解压(Go 显式设置 Accept-Encoding 时不会自动解压)
      - OAuth 服务 axios UA 从 1.8.4 更新至 1.13.6
      - 测试断言改用 getHeaderRaw 适配 raw header 存储方式
      b20e1422
  5. 24 Mar, 2026 1 commit
  6. 23 Mar, 2026 1 commit
  7. 20 Mar, 2026 1 commit
  8. 19 Mar, 2026 1 commit
    • QTom's avatar
      feat(admin): 用户管理新增分组列、分组筛选与专属分组一键替换 · ba7d2aec
      QTom authored
      - 新增分组列:展示用户的专属/公开分组,支持 hover 查看详情
      - 新增分组筛选:下拉选择或模糊搜索分组名过滤用户
      - 专属分组替换:点击专属分组弹出操作菜单,选择目标分组后
        自动授予新分组权限、迁移绑定的 Key、移除旧分组权限
      - 后端新增 POST /admin/users/:id/replace-group 端点,事务内
        完成分组替换并失效认证缓存
      ba7d2aec
  9. 18 Mar, 2026 2 commits
  10. 16 Mar, 2026 1 commit
    • erio's avatar
      feat(dashboard): add per-user drill-down for group, model, and endpoint distributions · 4b41e898
      erio authored
      Click on a group name, model name, or endpoint name in the distribution
      tables to expand and show per-user usage breakdown (requests, tokens,
      actual cost, standard cost).
      
      Backend: new GET /admin/dashboard/user-breakdown API with group_id,
      model, endpoint, endpoint_type filters.
      Frontend: clickable rows with expand/collapse sub-table in all three
      distribution charts.
      4b41e898
  11. 15 Mar, 2026 2 commits
  12. 12 Mar, 2026 2 commits
  13. 11 Mar, 2026 1 commit
    • John Doe's avatar
      feat: add Backend Mode toggle to disable user self-service · 6826149a
      John Doe authored
      
      
      Add a system-wide "Backend Mode" that disables user self-registration
      and self-service while keeping admin panel and API gateway fully
      functional. When enabled, only admin can log in; all user-facing
      routes return 403.
      
      Backend:
      - New setting key `backend_mode_enabled` with atomic cached reads (60s TTL)
      - BackendModeUserGuard middleware blocks non-admin authenticated routes
      - BackendModeAuthGuard middleware blocks registration/password-reset auth routes
      - Login/Login2FA/RefreshToken handlers reject non-admin when enabled
      - TokenPairWithUser struct for role-aware token refresh
      - 20 unit tests (middleware + service layer)
      
      Frontend:
      - Router guards redirect unauthenticated users to /login
      - Admin toggle in Settings page
      - Login page hides register link and footer in backend mode
      - 9 unit tests for router guard logic
      - i18n support (en/zh)
      
      27 files changed, 833 insertions(+), 17 deletions(-)
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      6826149a
  14. 09 Mar, 2026 2 commits
    • ischanx's avatar
      feat: 允许管理员为持有有效订阅的用户绑定订阅类型分组 · 767a41e2
      ischanx authored
      
      
      之前管理员无法通过 API 密钥管理将用户绑定到订阅类型分组(直接返回错误)。
      现在改为检查用户是否持有该分组的有效订阅,有则允许绑定,无则拒绝。
      
      - admin_service: 新增 userSubRepo 依赖,替换硬拒绝为订阅校验
      - admin_service: 区分 ErrSubscriptionNotFound 和内部错误,避免 DB 故障被误报
      - wire_gen/api_contract_test: 同步新增参数
      - UserApiKeysModal: 管理员分组下拉不再过滤订阅类型分组
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      767a41e2
    • yangjianbo's avatar
      fix(billing): 修复 OpenAI fast 档位计费并补齐展示 · 87f4ed59
      yangjianbo authored
      
      
      - 打通 service_tier 在 OpenAI HTTP、WS、passthrough 与 usage 记录中的传递
      - 修正 priority/flex 计费逻辑,并将 fast 归一化为 priority
      - 在用户端和管理端补齐服务档位与计费明细展示
      - 补齐前后端测试,并修复 WS 限流信号重复持久化导致的全量回归失败
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      87f4ed59
  15. 07 Mar, 2026 4 commits
  16. 05 Mar, 2026 2 commits
  17. 04 Mar, 2026 2 commits
  18. 03 Mar, 2026 3 commits
    • QTom's avatar
      feat(gateway): 系统设置控制未分组 Key 调度 — Handler 层中间件拦截 · 0c7cbe35
      QTom authored
      新增系统设置 allow_ungrouped_key_scheduling(默认关闭),
      未分组的 API Key 在网关请求时直接返回 403,
      由 RequireGroupAssignment 中间件统一拦截,
      支持 Anthropic / Google 两种错误格式响应。
      
      全栈实现:常量 → 结构体 → 解析/更新/初始化 → DTO → 管理接口 →
      中间件 → 路由注册 → 前端设置界面 + i18n。
      0c7cbe35
    • shaw's avatar
      fix: resolve CI lint errors and test compilation failures for rate limit feature · b8b5cec3
      shaw authored
      - Fix errcheck: properly handle rows.Close() error via named return + defer closure
      - Fix gofmt: auto-format billing_cache.go, api_key_service.go, billing_cache_service.go
      - Add missing rate limit interface methods to 4 test stubs (GetRateLimitData, IncrementRateLimitUsage, ResetRateLimitWindows)
      - Fix NewBillingCacheService calls missing the new apiKeyRepo parameter
      b8b5cec3
    • QTom's avatar
      fix(gateway): 分组隔离 — 禁止未分组账号被跨组调度 · 530a1629
      QTom authored
      当 API Key 无分组时,调度仅从未分组账号池中选取。
      修复 isAccountInGroup 在 groupID==nil 时的逻辑,
      同时补全 scheduler_snapshot_service 和 gemini_compat_service
      中的 SimpleMode 保护,确保分组隔离在所有调度路径生效。
      
      新增 ListSchedulableUngroupedByPlatform/s 方法,
      使用 Ent 的 Not(HasAccountGroups()) 谓词实现未分组账号隔离。
      新增 17 个单元和端到端隔离测试,覆盖所有分支和边界条件。
      530a1629
  19. 02 Mar, 2026 1 commit
    • erio's avatar
      fix: custom menu security hardening and code quality improvements · bf6fe5e9
      erio authored
      
      
      - Add admin menu permission check in CustomPageView (visibility + role)
      - Sanitize SVG content with DOMPurify before v-html rendering (XSS prevention)
      - Decouple router.go from dto package using anonymous struct
      - Consolidate duplicate parseCustomMenuItems into dto.ParseCustomMenuItems
      - Enhance menu item validation (count, length, ID uniqueness limits)
      - Add audit logging for purchase_subscription and custom_menu_items changes
      - Update API contract test to include custom_menu_items field
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      bf6fe5e9
  20. 01 Mar, 2026 3 commits
    • PMExtra's avatar
      feat(settings): add default subscriptions for new users · 7e020822
      PMExtra authored
      - add default subscriptions to admin settings
      
      - auto-assign subscriptions on register and admin user creation
      
      - add validation/tests and align settings UI with subscription selector patterns
      7e020822
    • erio's avatar
      feat(dashboard): add group usage distribution chart to usage page · 65459a99
      erio authored
      Add a doughnut chart showing usage statistics broken down by group on
      the admin usage records page. The chart appears alongside the existing
      model distribution chart (2-column grid), with the token usage trend
      chart moved to a separate full-width row below.
      
      Changes:
      - backend/pkg/usagestats: add GroupStat type
      - backend/service: add GetGroupStatsWithFilters interface method and implementation
      - backend/repository: implement GetGroupStatsWithFilters with LEFT JOIN groups
      - backend/handler: add GetGroupStats handler with full filter support
      - backend/routes: register GET /admin/dashboard/groups route
      - backend/tests: add GetGroupStatsWithFilters stubs to contract/sora tests
      - frontend/types: add GroupStat interface
      - frontend/api: add getGroupStats API function and types
      - frontend/components: add GroupDistributionChart.vue doughnut chart
      - frontend/views: update UsageView layout and load group stats in parallel
      - frontend/i18n: add groupDistribution, group, noGroup keys (zh + en)
      65459a99
    • 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
  21. 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
  22. 22 Feb, 2026 1 commit
  23. 17 Feb, 2026 1 commit
  24. 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