 胡绍康andClaude Opus 4.6
|
2aca6d9954
|
fix: 修复安全问题和错误处理改进
P0 安全修复:
- 添加 IP 信任链验证,防止 X-Forwarded-For 伪造攻击
- 导出验证 token 增加 IP 和 User-Agent 绑定校验
- 改用请求头传递导出 token,避免 URL 泄露
P1 改进:
- 错误响应自动使用正确的 HTTP 状态码(400/500)
- 4xx 错误使用 WARNING 日志级别,5xx 使用 ERROR
P2 文档更新:
- 更新 CLAUDE.md 架构说明,体现 controllers 层
- 添加 TRUSTED_PROXIES 和 PROXY_FIX_ENABLED 配置说明
- 修正登录锁定时长为 5 分钟
P3 工程卫生:
- 清理乱码字符
- 删除意外创建的 nul 文件
测试修复:
- 更新测试以适应新的 HTTP 状态码行为
- 添加测试前清理登录限制记录的逻辑
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-25 16:11:33 +08:00 |
|
 胡绍康andClaude Opus 4.6
|
8738bd1fff
|
refactor: 移除 legacy 依赖,迁移调度器到 services
新增文件:
- services/scheduler.py: 定时任务调度器服务
- init_scheduler(): 初始化调度器
- configure_scheduler_jobs(): 配置定时任务
- scheduler_heartbeat_task(): 心跳任务
- scheduled_refresh_task(): 定时刷新任务
- should_autostart_scheduler(): 判断是否自动启动
更新文件:
- app.py: 移除 legacy 导入,使用 middleware 和 services/scheduler
- controllers/settings.py: 使用 services/scheduler 替代 legacy
- web_outlook_app.py: 直接从各模块导出兼容函数,移除 impl 代理
测试修复:
- tests/test_core_features.py: 修复 mock 从 impl 到 graph_service
架构改进:
- 完全移除对 outlook_web.legacy 的运行时依赖
- legacy.py 现仅作为参考保留,不再参与运行时调用
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-25 12:14:16 +08:00 |
|
 胡绍康andClaude Opus 4.6
|
4c1920d7c1
|
feat: 迁移 emails 模块到 controllers 层
- 迁移 4 个 emails 相关 API 到 controllers/emails.py:
- api_get_emails
- api_delete_emails
- api_get_email_detail
- api_extract_verification
- 更新 routes/emails.py 移除 impl 参数
- 更新测试用例以 mock repositories 和 services 模块
- 保持 Graph API → IMAP 回退机制
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-25 08:58:36 +08:00 |
|
 胡绍康andClaude Opus 4.6
|
d7c274e5eb
|
feat: 迁移 temp_emails 模块到 controllers 层
- 迁移 8 个 temp_emails 相关 API 到 controllers/temp_emails.py:
- api_get_temp_emails
- api_generate_temp_email
- api_delete_temp_email
- api_get_temp_email_messages
- api_get_temp_email_message_detail
- api_delete_temp_email_message
- api_clear_temp_email_messages
- api_refresh_temp_email_messages
- 更新 routes/temp_emails.py 移除 impl 参数
- 更新测试用例以 mock outlook_web.services.gptmail 而非 legacy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-25 08:44:55 +08:00 |
|
 胡绍康andClaude Opus 4.6
|
66d9b9749b
|
feat: 批量操作与自动化增强 - 全选/复制验证码/自动轮询
功能实现:
- 全选功能:跨分组保持选中状态,使用全局 Set 存储
- 验证码提取:支持 Graph API → IMAP 回退策略
- 自动轮询:新邮件通知、红点提示、连续错误自动停止
BUG 修复 (BUG-001 ~ BUG-008):
- Toast 通知位置移至右下角
- 切换分组时保持全选状态
- 添加批量删除邮箱功能
- 验证码提取支持 IMAP 回退
- 修复轮询开关类型不一致 (boolean vs string)
- 完善轮询通知内容与红点位置
- 轮询次数校验改为 0-100 (0 表示持续)
- 复制按钮添加加载状态与反馈
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-24 21:03:53 +08:00 |
|
 胡绍康andClaude Opus 4.6
|
a9b3e4254f
|
fix: 修复临时邮箱生成失败的BUG (BUG-00001)
【问题描述】
- 用户生成临时邮箱时返回笼统错误:生成临时邮箱失败,请稍后重试
- 错误码:LEGACY_ERROR,无法定位具体失败原因
- 可能原因:API Key未配置、网络问题、API服务不可用等
【修复内容】
1. 改进 gptmail_request 函数
- 添加 API Key 配置检查
- 区分 10+ 种错误类型(CONFIG_ERROR, AUTH_ERROR, TIMEOUT_ERROR等)
- 返回结构化错误信息
2. 改进 generate_temp_email 函数
- 返回值改为 (email_addr, error_msg) 元组
- 保留详细错误信息
3. 改进 api_generate_temp_email 函数
- 使用详细错误信息返回给前端
- 添加日志记录
4. 更新前端错误提示
- 显示详细的错误信息
5. 编写单元测试
- 新增 11 个单元测试
- 更新 2 个现有测试的 mock
【测试结果】
- 所有测试通过:51/51 ✅
【相关文档】
- BUG文档:docs/BUGS/BUG-00001-临时邮箱生成失败.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-23 20:52:27 +08:00 |
|
 胡绍康andClaude Opus 4.6
|
14b1a7fa09
|
refactor: P1阶段优化 - 收敛全局变量与清理legacy代码
- 收敛前端全局变量:将 window.lastRefreshTime 和 window._lastFetchErrorDetails 改为模块变量
- 将内联 onclick 事件改为事件监听器,消除对全局变量的依赖
- 删除 legacy.py 中已被 re-export 覆盖的旧函数实现(settings 和 groups 相关,约140行)
- 所有测试通过(40/40)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-23 19:30:02 +08:00 |
|
 胡绍康andClaude Opus 4.6
|
192240436d
|
refactor: 模块化架构重构 & 完善测试与文档体系
- 架构重构:拆分为 routes/services/repositories/security 分层结构
- 新增测试:添加完整的单元测试套件(烟雾测试/核心功能/错误处理等)
- 完善文档:添加开发者指南、运行验证、回归清单、性能基线等文档
- 前后端分离:静态资源独立,模板组件化
- CI/CD:添加 GitHub Actions 自动化测试
- Docker 优化:添加健康检查,修复调度器启动问题
- 配置增强:支持 SCHEDULER_AUTOSTART 环境变量
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-23 18:54:16 +08:00 |
|