yangjianbo
ccb8144557
fix(仪表盘): 修复rows.Close错误检查
2026-01-11 18:39:29 +08:00
yangjianbo
1240c78ef6
Merge branch 'test' into dev
2026-01-11 18:22:07 +08:00
程序猿MT
66c8b6f2bc
Merge branch 'Wei-Shaw:main' into main
2026-01-11 18:21:42 +08:00
yangjianbo
6271a33d08
fix(仪表盘): 兼容禁用聚合与回填限制
2026-01-11 18:20:15 +08:00
yangjianbo
5364011a5b
fix(仪表盘): 修正聚合时间桶与清理节流
2026-01-11 17:21:17 +08:00
yangjianbo
d78f42d2fd
chore(注释): 调整仪表盘注释为中文
2026-01-11 16:02:28 +08:00
yangjianbo
1a869547d7
feat(仪表盘): 引入预聚合统计与聚合作业
2026-01-11 16:01:35 +08:00
yangjianbo
ab5839b461
fix(仪表盘): 修复缓存稳定性并补充测试
2026-01-11 15:00:16 +08:00
yangjianbo
d75cd820b0
fix(认证): 订阅兑换失效认证缓存
...
订阅兑换后同步失效认证缓存避免授权快照滞后
补充单测覆盖订阅兑换的失效场景
测试: go test ./... -tags=unit
2026-01-11 10:55:26 +08:00
yangjianbo
cb3e08dda4
fix(认证): 补齐余额与删除场景缓存失效
...
为 Usage/Promo/Redeem 注入认证缓存失效逻辑
删除用户与分组前先失效认证缓存降低窗口
补充回归测试验证失效调用
测试: make test
2026-01-11 10:55:25 +08:00
yangjianbo
44a93c1922
perf(认证): 引入 API Key 认证缓存与轻量删除查询
...
增加 L1/L2 缓存、负缓存与单飞回源
使用 key+owner 轻量查询替代全量加载并清理旧接口
补充缓存失效与余额更新测试,修复随机抖动 lint
测试: make test
2026-01-11 10:55:25 +08:00
Wesley Liddick
9cba595fd0
Merge pull request #233 from cyhhao/main
...
fix(openai): 对齐 OpenCode OAuth instructions,保持 Codex CLI 透明转发
2026-01-11 10:41:57 +08:00
shaw
56fc2764e4
chore: remove accidentally committed test binary
2026-01-11 10:37:09 +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
yangjianbo
c2c865b0cb
perf(仪表盘): 增强统计缓存与隔离配置
...
新增仪表盘缓存开关与 TTL 配置,支持 Redis key 前缀隔离,并补充单测与校验。
测试: make test-backend
2026-01-11 10:07:03 +08:00
程序猿MT
a66d318820
Merge branch 'Wei-Shaw:main' into main
2026-01-10 23:34:23 +08:00
yangjianbo
a16f72f52e
fix(认证): 订阅兑换失效认证缓存
...
订阅兑换后同步失效认证缓存避免授权快照滞后
补充单测覆盖订阅兑换的失效场景
测试: go test ./... -tags=unit
2026-01-10 23:14:20 +08:00
yangjianbo
99e2391b2a
fix(认证): 补齐余额与删除场景缓存失效
...
为 Usage/Promo/Redeem 注入认证缓存失效逻辑
删除用户与分组前先失效认证缓存降低窗口
补充回归测试验证失效调用
测试: make test
2026-01-10 22:52:13 +08:00
cyhhao
80c1cdf024
fix(lint): trim unused codex helpers
2026-01-10 22:45:29 +08:00
Edric Li
0fa5a6015e
feat(settings): add iframe CSP warning for home content
...
Add a warning message to inform admins that some websites may have
X-Frame-Options or CSP policies that prevent iframe embedding.
2026-01-10 22:35:33 +08:00
yangjianbo
9d0a4f3d68
perf(认证): 引入 API Key 认证缓存与轻量删除查询
...
增加 L1/L2 缓存、负缓存与单飞回源
使用 key+owner 轻量查询替代全量加载并清理旧接口
补充缓存失效与余额更新测试,修复随机抖动 lint
测试: make test
2026-01-10 22:23:51 +08:00
cyhhao
1a641392d9
Merge up/main
2026-01-10 21:57:57 +08:00
cyhhao
36b817d008
Align OAuth transform with OpenCode instructions
2026-01-10 20:53:16 +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
0772cdda0f
fix: update API contract test for home_content field and fix gofmt
2026-01-10 19:01:00 +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
shaw
ff0875868e
Merge PR #229 : perf(网关): 粘性会话命中复用候选账号
2026-01-10 15:21:59 +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
shaw
15884f368d
Merge branch 'longgexx/main'
2026-01-10 14:16:13 +08:00
shaw
b03fb9c2f6
fix: remove accidentally committed test binary and restore .gitignore
...
- Remove backend/repository.test (62MB macOS arm64 test binary)
- Restore *.test pattern in .gitignore to prevent future accidents
2026-01-10 14:16:06 +08:00
shaw
3d4984133e
chore: 删除误提交的 Go 测试二进制并更新 .gitignore
2026-01-10 14:03:41 +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
61f556745a
Merge branch 'main' of https://github.com/mt21625457/aicodex2api
2026-01-10 09:28:30 +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
cyhhao
eb06006d6c
Make Codex CLI passthrough
2026-01-10 03:12:56 +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
e83f644c3f
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:37:07 +08:00
Edric Li
6b97a8be28
Merge branch 'main' into feat/api-key-ip-restriction
2026-01-09 21:34:28 +08:00