Commit Graph

83 Commits

Author SHA1 Message Date
iRubbish
8a5d4b5d8f feat: 完善AD域控用户系统,增加配置说明
- 完善用户API Key创建流程,移除名称编辑权限
- 清理硬编码敏感信息,改用环境变量配置
- 在README.md和.env.example中添加AD域控配置说明
- 修复ESLint no-shadow错误
- 删除测试文件test-fixed-auto-link.js

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-26 15:55:13 +08:00
iRubbish
82f545c3b0 保存当前API Key管理功能的修改
- 统一用户创建和admin创建API Key的逻辑
- 修复admin更新用户创建的API Key功能
- 用户创建API Key名称改为displayName
- 默认无限制配置

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-26 13:42:02 +08:00
iRubbish
7624c383e8 feat: 完整实现AD域控用户认证系统
主要功能:
- 新增LDAP服务连接AD域控服务器
- 实现多格式AD用户认证(sAMAccountName, UPN, 域\用户名, DN)
- 支持中文显示名和拼音用户名搜索
- 添加用户账户状态检查(禁用账户检测)
- 实现JWT token认证和用户会话管理

新增文件:
- src/services/ldapService.js - LDAP核心服务
- src/routes/ldapRoutes.js - AD认证API路由
- src/services/userMappingService.js - 用户映射服务
- web/admin-spa/src/views/UserDashboardView.vue - 用户控制台
- web/admin-spa/src/components/user/ - 用户组件目录

修改功能:
- ApiStatsView.vue 增加用户登录按钮和模态框
- 路由系统增加用户专用页面
- 安装ldapjs和jsonwebtoken依赖

技术特性:
- 多种认证格式自动尝试
- LDAP referral错误处理
- 详细认证日志和错误码记录
- 前后端完整用户认证流程

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 18:03:55 +08:00
shaw
e56a49d7ed fix: 修复codex 添加账号缺少oauth步骤 2025-08-24 16:47:45 +08:00
shaw
b426a759a8 feat: 支持后台配置webhook 2025-08-23 20:20:32 +08:00
shaw
74bcb99142 feat: 新增支持Azure OpenAI账户 2025-08-23 10:30:29 +08:00
shaw
85c1e84b42 fix: 修复批量编辑组件的 Prettier 格式化问题
- 格式化所有不符合 Prettier 规范的代码
- 修复长标签元素的换行问题
- 确保前端构建成功通过
2025-08-22 22:29:58 +08:00
shaw
47a1b37243 feat: 为批量编辑API Keys组件添加暗黑模式支持
- 为所有文本、背景、边框添加暗黑模式样式
- 更新表单控件(输入框、选择框、按钮)的暗黑模式样式
- 确保与项目其他组件的暗黑模式风格保持一致
2025-08-22 22:24:33 +08:00
shaw
15c8478a96 Merge branch 'pr-272' into dev 2025-08-22 22:19:00 +08:00
shaw
d2f0ac37a9 feat: 支持Dark Mode 2025-08-22 22:09:38 +08:00
iRubbish
ee93018c20 增加 API keys 批量编辑管理 2025-08-22 16:12:04 +08:00
iRubbish
59d013f02f feat: 批量编辑API Keys功能优化和Bug修复
- 添加批量编辑API Keys路由和验证逻辑
- 修复标签操作(添加、移除、替换)功能
- 新增批量编辑前端组件,支持共享账号池选择
- 完善Bedrock账户显示和绑定功能
- 优化账户选择UI,统一所有平台选项
- 修复前端构建错误和代码格式问题
- 添加comprehensive测试场景文档

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-22 13:55:39 +08:00
shaw
4aa562be21 fix: 去除logger自动添加metadata字段 2025-08-20 21:45:48 +08:00
mouyong
54dca0f285 fix(frontend): 修复编辑分组模态框显示问题
WHAT: 修复账户分组管理中编辑分组表单无法显示的问题
WHY: 编辑模态框使用无效的 z-60 类名导致层级冲突,编辑表单被主模态框遮挡
HOW: 将编辑模态框的 z-index 类名从 z-60 改为 z-50,与主模态框同级但利用 DOM 顺序确保正确显示;保持其他样式和功能不变
2025-08-20 21:37:19 +08:00
shaw
812e98355f feat: 实现 OpenAI token 自动刷新功能并优化账户管理界面
主要更改:
1. OpenAI Token 自动刷新
   - 实现 refreshAccessToken 函数,支持 OAuth 2.0 refresh_token grant type
   - 使用 Codex CLI 官方 CLIENT_ID (app_EMoamEEZ73f0CkXaXp7hrann)
   - 支持 SOCKS5 和 HTTP/HTTPS 代理
   - 自动更新 access token、id token 和 refresh token

2. 账户管理界面优化
   - 移除手动刷新 token 按钮(桌面端和移动端)
   - 保留后端自动刷新机制
   - 优化代码结构,删除不再需要的函数和变量

3. 测试和文档
   - 添加 test-openai-refresh.js 测试脚本
   - 创建详细的实现文档

技术细节:
- Token 端点: https://auth.openai.com/oauth/token
- 默认有效期: 1小时
- 加密存储: AES-256-CBC

所有平台现在都支持自动 token 刷新:
 Claude - OAuth 自动刷新
 Gemini - Google OAuth2 自动刷新
 OpenAI - OAuth 自动刷新(新实现)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-15 16:56:44 +08:00
KevinLiao
f1febd320e fix: 去掉Free账号 2025-08-14 16:49:20 +08:00
KevinLiao
0e5f4e03c1 feat: 新增Claude账号订阅类型设置
1. OAuth可自动判断订阅类型,Setup Token请自行选择。无论那种类型都可以自己改
2. 优化调度,Pro账号不再接受opus模型请求的调度
2025-08-14 16:43:58 +08:00
shaw
5428462f55 fix: 修复 OpenAI 账户代理配置保存问题
- 修复 OAuth 方式添加 OpenAI 账户时缺少 priority 字段
- 修复创建 OpenAI 账户时错误检查 proxy.enabled 导致代理未保存
- 添加 OpenAI OAuth token 交换时的 SOCKS5 代理支持
- 添加 OpenAI API 请求转发时的代理支持
- 参考 Claude/Gemini 实现统一代理处理逻辑
2025-08-13 22:44:48 +08:00
Wesley Liddick
ceb1749859 Merge pull request #243 from tanaer/fixed
Fixed: 新增 Claude Console 账户限流机制开关
2025-08-13 17:49:47 +08:00
wt
171d35f33e Fix: Claude Console 账户的限流开关 2025-08-13 10:36:15 +08:00
wt
e338fb0e03 Fix: Claude Console 账户的限流开关 2025-08-13 00:05:03 +08:00
shaw
4ca9674772 feat: 完善多平台账户管理和API Keys页面展示
- 修复OpenAI路由中的gpt-5模型ID处理
- 增强统一调度器的账户选择日志输出
- 优化OAuth流程中的账户类型处理
- 完善API Keys页面的多平台账户信息展示

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 17:55:45 +08:00
wt
6dfaf637aa feat: 新增 Claude Console 账户限流机制开关 2025-08-12 15:48:41 +08:00
shaw
f462684f97 feat: 实现OpenAI账户管理和统一调度系统
- 新增 OpenAI 账户管理服务,支持多账户轮询和负载均衡
- 实现统一的 OpenAI API 调度器,智能选择最优账户
- 优化成本计算器,支持更精确的 token 计算
- 更新模型定价数据,包含最新的 OpenAI 模型价格
- 增强 API Key 管理,支持更灵活的配额控制
- 改进管理界面,添加教程视图和账户分组管理
- 优化限流配置组件,提供更直观的用户体验

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 13:58:43 +08:00
千羽
11fc856999 chore: commit all changes 2025-08-10 17:46:31 +09:00
Wesley Liddick
27ca140fc3 Merge pull request #219 from kevinconan/main
fix: 修复Claude Console账号的模型映射功能
2025-08-08 20:39:18 +08:00
KevinLiao
1ff0824a81 fix: 修复prettier格式化 2025-08-08 15:56:32 +08:00
KevinLiao
33df4bf943 fix: 恢复ClaudeConsole 账号模型映射能力 2025-08-08 15:18:41 +08:00
shaw
7e1a9daa6b feat: 完善管理界面功能和用户体验
- 添加 API Key 窗口倒计时组件 (WindowCountdown)
- 添加自定义下拉菜单组件 (CustomDropdown)
- 优化账户和 API Key 管理界面交互
- 改进教程页面布局和说明文字
- 完善账户状态显示和错误处理

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-08 14:14:46 +08:00
shaw
4adc8d9695 恢复并保存本地修改:仪表盘服务账户分类显示、WindowCountdown组件等功能 2025-08-08 11:56:24 +08:00
shaw
31bdb4aa8c feat: add comprehensive 401 error handling and account status management
- Add 401 error detection and automatic account suspension after 3 consecutive failures
- Implement account status reset functionality for clearing all error states
- Enhance admin interface with status reset controls and improved status display
- Upgrade service management script with backup protection and retry mechanisms
- Add mandatory code formatting requirements using Prettier
- Improve account selector with detailed status information and color coding

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-08 00:35:26 +08:00
千羽
35e16038a5 feat: add Setup Token OAuth flow for simplified Claude account setup
Introduces a streamlined Setup Token authentication method that reduces the required OAuth scopes from 'org:create_api_key user:profile user:inference' to just 'user:inference', simplifying the account setup process for users who only need inference capabilities.

Key changes:
- Add Setup Token authorization endpoints in admin routes
- Implement Setup Token OAuth flow with PKCE support in oauthHelper
- Update AccountForm to support Setup Token as the default auth method
- Add automatic authorization code extraction from callback URLs
- Maintain full proxy configuration support for Setup Token flow
- Preserve existing OAuth flow for advanced users requiring API key creation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 22:48:48 +09:00
千羽
8a74bf5afe refactor: standardize code formatting and linting configuration
- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility
- Add .prettierrc configuration for consistent code formatting
- Update package.json with new lint and format scripts
- Add nodemon.json for development hot reloading configuration
- Standardize code formatting across all JavaScript and Vue files
- Update web admin SPA with improved linting rules and formatting
- Add prettier configuration to web admin SPA

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 18:19:31 +09:00
KevinLiao
ae7f4e2405 fix: 修改Claude Console 账号的UA默认行为,默认透传客户端UA而非固定的UA值 2025-08-07 12:33:32 +08:00
shaw
e57b98f343 fix: 修复 API Key 创建和编辑时账户绑定冲突问题
- 创建 API Key 时确保 OAuth 和 Console 账户不会同时设置
- 编辑 API Key 时正确清空未使用的账户类型字段
- 使用共享池时清空所有账户绑定

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 00:43:09 +08:00
andersonby
79951920ea fix: update placeholder text in AccountForm.vue to correct model name from hiku to haiku 2025-08-06 20:40:59 +08:00
andersonby
5883a60fba Merge upstream changes and resolve conflicts
- Merged latest changes from Wei-Shaw/claude-relay-service
- Resolved conflict in AccountForm.vue to support both Bedrock and improved platform switching logic
- Maintained Bedrock integration while incorporating Gemini pricing improvements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 19:26:31 +08:00
andersonby
657b7b0a05 feat: Add test scripts for Bedrock models and model mapping functionality 2025-08-06 19:23:36 +08:00
shaw
b1ea32caba feat: 添加Gemini定价功能和界面优化
- 实现Gemini定价查询服务,支持实时计算token成本
- 改进API Key管理界面,添加模型快速选择功能
- 优化账户表单组件的渲染性能
- 更新Gemini账户服务,增强token刷新和错误处理

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 18:09:43 +08:00
andersonby
9a9a82c86f feat: Add comprehensive Amazon Bedrock integration support
Add complete Amazon Bedrock integration to Claude Relay Service with:

## Core Features
-  Bedrock account management with encrypted AWS credential storage
-  Full request routing to AWS Bedrock with streaming support
-  Integration with unified Claude scheduler system
-  Support for Inference Profiles and Application Inference Profiles
-  Configurable default and small-fast model settings

## Backend Services
- Add bedrockAccountService.js for account management
- Add bedrockRelayService.js for request forwarding
- Integrate Bedrock accounts into unifiedClaudeScheduler.js
- Update admin and API routes to support Bedrock endpoints
- Add comprehensive configuration options to config.example.js

## Frontend Integration
- Complete Vue.js Web UI for Bedrock account management
- Account creation form with AWS credentials and model configuration
- Real-time account status monitoring and statistics
- Edit/update capabilities for existing accounts

## CLI Support
- Interactive CLI commands for Bedrock account operations
- Account creation, listing, updating, and testing
- Status monitoring and connection validation

## Security & Performance
- AES encrypted storage of AWS credentials in Redis
- Support for temporary credentials (session tokens)
- Region-specific configuration support
- Rate limiting and error handling

This integration enables the relay service to support three AI platforms:
1. Claude (OAuth) - Original Claude.ai integration
2. Gemini - Google AI integration
3. Amazon Bedrock - New AWS Bedrock integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 17:41:16 +08:00
Wesley Liddick
e9844c4a86 Merge pull request #191 from JinFanZheng/feature/api-key-quick-add-models
feat: add quick add buttons for model restrictions in API Key editor
2025-08-06 10:30:00 +08:00
Yuhan Jian
828a8e1c0d fix: change password 404 error
fix: change password 404 error
2025-08-06 10:22:03 +08:00
Van Zheng
9781a39e09 feat: add quick add buttons for model restrictions in API Key editor
- Add quick add buttons for common Claude models including claude-opus-4-1-20250805
- Implement dynamic filtering to hide models already in restriction list
- Add mobile-responsive design with proper text sizing and layout
- Show helpful message when all common models are restricted

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 09:44:26 +08:00
shaw
4ebe6abd96 fix: 修复编辑账户时分组调度选择不生效的问题
- 为 Claude Console 和 Gemini 账户的更新接口添加分组处理逻辑
- 处理账户类型变更时的分组关系(从旧分组移除,添加到新分组)
- 修复前端编辑账户时分组 ID 的初始化问题
- 优化删除账户时自动从分组中移除的逻辑

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 19:02:27 +08:00
Wesley Liddick
5b0c02d8ce Merge pull request #181 from wbchn/main
fix: 🐛 修复续期 endpoint
2025-08-05 17:34:41 +08:00
shaw
7fa75df1fd fix: 修复分组调度功能和API Keys统计弹窗UI问题
1. 分组调度功能修复:
   - 统一使用 unifiedClaudeScheduler 和 unifiedGeminiScheduler
   - 修复 schedulable 字段数据类型不一致问题(布尔值/字符串)
   - 添加 _isSchedulable() 辅助方法确保兼容性
   - 修复所有路由文件中的调度器调用

2. API Keys 统计弹窗UI优化:
   - 统一弹窗样式与系统UI风格
   - 添加右上角关闭按钮
   - 修复移动端宽度问题(设置为95%屏幕宽度)
   - 使用 Teleport 组件和项目通用样式

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 17:06:52 +08:00
wbchn
e6e5a2d53e fix: 🐛 修复续期 endpoint 2025-08-05 14:19:38 +08:00
mouyong
c36ae32928 Merge branch 'main' of github.com:Wei-Shaw/claude-relay-service
* 'main' of github.com:Wei-Shaw/claude-relay-service:
  chore: sync VERSION file with release v1.1.72 [skip ci]
  fix: 修复账户管理和API Key管理的多个问题
  fix: 修复 GitHub Actions 版本检测对合并提交的处理
2025-08-04 20:34:38 +08:00
mouyong
54ad8452c3 feat: gemini 流式响应 2025-08-04 20:34:17 +08:00
shaw
a69d1ae1dd fix: 修复账户管理和API Key管理的多个问题
- 修复 Claude Console 账号 supportedModels 导致的 be.join 错误
- 添加专属账号选择器组件,支持搜索和按创建时间倒序排序
- 修复搜索框图标与placeholder文字重叠的问题
- 修复选择共享账号池后显示文字不正确的问题
- 优化下拉框定位逻辑,解决超出视窗无法滚动的问题

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 18:44:36 +08:00