160 Commits
Author SHA1 Message Date
胡绍康 8854966aa7 docs: refine registration machine documentation 2026-03-18 20:48:20 +08:00
胡绍康 47296f80a8 docs: update registration and email pool interface documentation 2026-03-17 23:22:55 +08:00
胡绍康 70d1f4a8e9 docs: restore acknowledgements in readme 2026-03-17 22:00:51 +08:00
胡绍康 d50f01663c feat: finalize pool registration flow and docs 2026-03-17 20:02:21 +08:00
胡绍康 6d95c74272 fix: align external pool POST and stats responses with external API contract 2026-03-17 10:40:14 +08:00
胡绍康 0c0dc40750 test: add end-to-end coverage for external pool flows 2026-03-16 21:39:29 +08:00
胡绍康 8b436a12f5 test: expand external pool coverage for guards and access control 2026-03-16 21:19:41 +08:00
胡绍康 aa01758ad9 feat: add granular release controls and key-based access for external pool 2026-03-16 20:29:35 +08:00
胡绍康 431d6af233 feat: require explicit enablement for external pool endpoints via settings 2026-03-16 20:16:58 +08:00
胡绍康 b6bde5ea18 feat: add protected external pool API endpoints with API key guards and tests 2026-03-16 20:01:45 +08:00
胡绍康 0d92a613f5 feat: implement PRD-00009 MT-1 internal email pool with full P0 contract (claim/release/complete/stats, ownership checks, lease expiry, cooldown recovery, 38 pool tests) 2026-03-16 19:20:02 +08:00
胡绍康 9594cdd443 release: v1.7.0 2026-03-15 18:04:16 +08:00
胡绍康 cb4a119a47 release: v1.6.1 2026-03-15 12:57:01 +08:00
胡绍康 2c9312c737 chore: remove internal docs from release 2026-03-15 09:50:58 +08:00
胡绍康 a26079026b fix: clear release quality gates 2026-03-15 09:41:45 +08:00
胡绍康andCopilot 1dec707ac3 release: v1.6.0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 12:47:21 +08:00
胡绍康andCopilot 6085ddd926 fix: harden external API guard client IP
Use auth.get_client_ip for whitelist/rate-limit decisions to avoid X-Forwarded-For spoofing. Add tests for trusted-proxy behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 12:42:12 +08:00
胡绍康 01d1dc0874 feat: implement external API security architecture (public mode, IP whitelist, rate limit)
- Add ExternalApiGuard for IP whitelisting, rate limiting, and public mode enforcement
- Update wait-message to support async mode
- Fix bugs in verification code extraction (BUG-00014 to BUG-00017)
- Update documentation and architectural diagrams
2026-03-13 11:27:34 +08:00
胡绍康andCopilot 09c3ab3416 fix: gate low-confidence verification extraction results as 404 (BUG-00017)
- Add code_confidence/link_confidence fine-grained fields to extractor
- Service-layer credibility gate: confidence != high -> nullify result -> 404
- Caller-directed extraction (code_regex only) gets high confidence
- Narrow LINK_CONTEXT_PHRASES with object nouns (email/account) prevent false positives
- 31 new tests (21 unit + 10 integration), 376 total passing
- Update docs/api.md with new fields, null semantics, v1.5 gating notes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 23:24:02 +08:00
胡绍康andCopilot 7163b3bc17 docs: OpenAPI YAML 补全 P1 公网守卫响应与 P2 probe 异步探测端点
新增内容:
- Probe tag 与 /api/external/probe/{probe_id} 端点定义
- wait-message 增加 mode 参数与 202 异步响应
- ProbeCreatedData / ProbeStatusData / 对应 Response schema
- CapabilitiesData 增加 public_mode / restricted_features 字段
- Mode 查询参数定义(sync / async)
- P1 错误响应:IpNotAllowed / FeatureDisabled / RateLimitExceeded

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 00:20:16 +08:00
胡绍康andCopilot 7128edeaaa feat: PRD-00008 P2 wait-message 异步探测解耦 — probe 缓存、后台轮询、333 测试全绿
- DB v6→v7:新增 external_probe_cache 表(状态/结果/过期时间)
- external_api.py:create_probe / get_probe_status / poll_pending_probes / cleanup
- wait-message 支持 mode=sync(P0 向下兼容)和 mode=async(P2 异步探测)
- 新增 GET /api/external/probe/<probe_id> 查询探测状态
- scheduler.py:注册 5 秒间隔的 external_probe_poll Job
- 新增 12 个 P2 测试(TC-PROBE-01~12),总计 333 测试全绿
- api.md:新增 probe 端点文档、更新 wait-message 双模式说明
- TODO-00008 P2 勾选完成

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 22:47:19 +08:00
胡绍康andCopilot a01b48a813 feat: PRD-00008 P1 公网模式安全层 — 守卫模块、设置 UI、321 测试全绿
- 新增 external_api_guard.py:IP 白名单、限流(SQLite 分钟桶)、高风险端点禁用
- DB v5→v6:新增 external_api_rate_limits 表 + 5 项 P1 默认设置
- 10 个外部 API 端点集成 @external_api_guards() 装饰器
- capabilities 端点增强:public_mode / restricted_features
- settings 控制器 + 前端 UI:公网模式开关、IP 白名单、限流、功能禁用
- 新增 18 个 P1 守卫测试(TC-GUARD-01~18),总计 321 测试全绿
- 更新 api.md:P1 错误码、配置文档
- 默认 public_mode=false,与 P0 行为完全兼容

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 22:18:40 +08:00
胡绍康andCopilot c79a173c03 docs: api.md 补充 raw/wait-message 独立安全风险说明段落
- /messages/{id}/raw: 原始内容风险、无脱敏、公网应禁用
- /wait-message: 同步轮询线程占用、并发耗尽风险、P2 解耦计划
- TODO-00008 第8节全部勾选完成(6/6)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 21:39:21 +08:00
胡绍康andCopilot a1bc3e0eed docs: TODO-00008 手动验证项全部勾选完成
- 3.1 节:脱敏值不回写、清空返回403、三路径鉴权验证全部实测通过
- 8 节:手动联调、README口径核查、发布确认为P0收口

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 21:27:00 +08:00
胡绍康andCopilot 085796eebe fix: PRD-00008 P0 审查修复 — OpenAPI schema 一致性、审计日志补全、测试覆盖 51→303
- fix(openapi): VerificationCodeData 补齐 verification_link/links/formatted 字段
- fix(openapi): confidence 枚举修正为 [high, low](无 medium)
- fix(openapi): AccountStatusData 补 status 字段
- fix(openapi): VerificationLinkData 补 email 属性
- fix(controllers): verification-code/link/wait-message 异常路径补审计日志
- test: 新增 30 条 P0 测试(auth、param、error、schema、regression)
- test: 新增 11 条 P1 extractor 边界测试(TC-EXT-01~04)
- docs: TODO-00008 更新至 V1.1(P0 已完成)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 17:57:37 +08:00
胡绍康 bd9bafeb83 ci: harden quality gates and clean test warnings 2026-03-10 22:04:18 +08:00
胡绍康 1d4d848702 fix: align external api behavior with PRD-00008 2026-03-10 21:24:55 +08:00
胡绍康 2c4ca1f0cb ci: trigger workflows for diagnostics 2026-03-10 13:17:39 +08:00
胡绍康 eb9027bf57 ci: fix sonarcloud organization key 2026-03-10 13:02:05 +08:00
胡绍康 8f3a259c81 ci: add sonarcloud scan configuration 2026-03-10 12:59:23 +08:00
胡绍康 3ebf9172bf style: format external api changes for quality checks 2026-03-09 15:09:21 +08:00
胡绍康 9673b3524d feat: add external api docs tests and verification updates 2026-03-09 15:07:18 +08:00
胡绍康 8ee73e6572 style: apply latest black formatting for ci 2026-03-09 13:46:45 +08:00
胡绍康 48783387ac style: format tracked python files for ci 2026-03-09 13:42:00 +08:00
胡绍康 3cbc743080 chore: rerun ci after lint verification 2026-03-09 13:25:47 +08:00
胡绍康 98febc798a fix: resolve copy logout and favicon regressions 2026-03-09 12:58:01 +08:00
胡绍康 ea2561580b docs: 修正 README 启动与发布说明 2026-03-08 10:59:42 +08:00
胡绍康 676307bc43 docs: 增加GHCR拉取与发布说明 2026-03-07 22:57:48 +08:00
胡绍康 70e70e296a ci: 修复并增强Docker镜像发布 2026-03-07 22:57:40 +08:00
胡绍康 1f8e09b77e fix: 账号列窄宽度自动紧凑显示 2026-03-07 22:57:27 +08:00
胡绍康 8ad5832a1d release: v1.5.1 — Microsoft Refresh Token 滚动更新 2026-03-07 18:49:10 +08:00
胡绍康andClaude Opus 4.6 34f2125d51 feat: 实现 Microsoft Refresh Token 滚动更新机制
- 新增 test_refresh_token_with_rotation 函数支持返回新 refresh_token
- 在所有刷新场景(单账号/批量/定时任务)中自动保存滚动更新的 token
- 更新调度器、控制器、服务层以支持 token 轮换
- 补充测试用例验证 token 滚动更新逻辑
- 符合 Microsoft Learn 文档建议:每次使用时保存新的 refresh_token

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:08:57 +08:00
XiaoSihui c9e14231b1 release: v1.5.0 — Telegram 实时推送与去重稳定性优化 2026-03-06 23:00:59 +08:00
胡绍康 6cb086b34e 补充感谢 2026-03-06 17:20:51 +08:00
胡绍康andCopilot 721a037c0c docs: 更新 BUG-00011 文档补充 P2 Message-ID 去重章节
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 22:35:11 +08:00
胡绍康andCopilot 71b5cc0293 feat: BUG-00011 P2 Message-ID 去重防止重复推送
- 新增 telegram_push_log 表 (schema v5),UNIQUE(account_id, message_id)
- IMAP fetch 提取 Message-ID header; Graph fetch 提取 internetMessageId
- 推送前查 push_log 跳过已推送邮件,推送后记录
- 每次 Job 结束清理 >7 天的去重记录
- 新增 4 个 TestMessageIdDedup 测试 + 更新 _make_email 含 message_id
- 228 tests passing (游标防重 + Message-ID 去重双保险)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 22:34:16 +08:00
胡绍康andCopilot d6af769401 fix: BUG-00011 游标竞态导致单封邮件重复推送
- cursor 从固定 job_start_time 改为 max(job_start_time, max_received_at)
- 防止邮件服务器时钟偏差 / fetch 窗口期间到达的邮件被重复拉取
- 新增 3 个 TestCursorClockSkew 测试 (时钟偏差 + 端到端防重)
- 224 tests passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 22:03:03 +08:00
胡绍康andCopilot 308494dcc9 feat: add PUSH_RECENCY_HOURS (12h) and TELEGRAM_PUSH_DELAY_SEC (1.5s)
- Skip emails older than 12 hours to prevent flooding on re-enable
- Add 1.5s delay between Telegram sends to avoid rate limiting
- Update tests T-19/T-20/T-22 to use recent timestamps and mock delay
- Add 2 new recency filter tests (old email skipped, recent passes)
- 221 tests passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 20:56:37 +08:00
胡绍康andCopilot c0381f6bf5 test: BUG-00010 新增 8 个测试(并行获取 + 游标策略 + 调度器默认值)
TestFetchAccountEmails: 4 个(首次运行/成功/失败/Outlook vs IMAP)
TestParallelJobBehavior: 4 个(发送失败计数/混合成功失败/全量处理/默认间隔)
总计 50 个 Telegram 测试 + 169 个现有 = 219 全部通过

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 20:33:48 +08:00
胡绍康andCopilot 8dd085b223 docs: BUG-00010 推送性能与滚动优化文档
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 19:56:09 +08:00