feat(fingerprint): 引入 per-key 请求指纹系统,替代全局 TLS 指纹开关

为每个 ProviderAPIKey 生成并持久化独立的请求指纹配置,涵盖 TLS impersonate
profile、浏览器 UA、Stainless SDK 头部、Node/Chrome/Electron 版本等维度。
指纹基于 key ID 确定性生成,支持手动编辑和批量重新生成。

- 新增 fingerprint 模块:生成、加载、校验、懒持久化
- 数据库迁移:provider_api_keys 新增 fingerprint JSON 列
- 请求链路注入:handler 基类设置上下文指纹,request_builder 和 envelope 消费
- HTTP Client 支持动态 impersonate profile 选择
- Antigravity 适配器使用指纹覆盖 UA/session/Node 版本
- 前端移除手动 TLS 指纹开关,新增批量 regenerate_fingerprint 操作
- 号池管理 UI 优化:token 缩写格式、blocked 行样式、时间显示改为日期格式
This commit is contained in:
fawney19
2026-03-05 02:07:34 +08:00
parent 1d04c41ae7
commit 32ccf61baa
24 changed files with 782 additions and 84 deletions

View File

@@ -169,7 +169,13 @@ export interface PoolKeysQuery {
export interface PoolBatchAction {
key_ids: string[]
action: 'enable' | 'disable' | 'delete' | 'clear_cooldown' | 'reset_cost'
action:
| 'enable'
| 'disable'
| 'delete'
| 'clear_cooldown'
| 'reset_cost'
| 'regenerate_fingerprint'
}
export async function getPoolOverview(): Promise<PoolOverviewResponse> {

View File

@@ -442,8 +442,6 @@ export interface ClaudeCodeAdvancedConfig {
// 会话数量控制null/undefined 表示不限制
max_sessions?: number | null
session_idle_timeout_minutes?: number | null
// TLS 指纹模拟(模拟 Node.js/Claude Code 客户端指纹)
enable_tls_fingerprint?: boolean
// 会话 ID 伪装(固定 metadata.user_id 中 session 片段)
session_id_masking_enabled?: boolean
// Cache TTL 统一(强制所有 cache_control 使用相同 TTL 类型)