deerflow2/backend/app/channels
zhongli-sz 3ae82dc663
fix(mcp): add auth interceptor with channel user_id and keep header propagation to mcp tools (#3294)
* 修复channel中的user_id传递到interceptor中的bug, mcp可通过header传递user_id到mcp工具

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(channel,mcp,gateway): normalize channel user_id and add regression tests

Normalize external channel user ids into filesystem-safe runtime context while preserving raw channel_user_id, and document gateway user_id propagation semantics. Add regression coverage for channel user_id context mapping, gateway user_id precedence/internal-role behavior, and MCP interceptor header forwarding via meta.headers.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(auth,mcp): harden user id normalization and header handling

Increase sanitized user-id digest suffix to 16 hex chars, replace internal system role magic string with a shared constant, and harden MCP header forwarding with Mapping type checks. Add regression tests for empty channel user_id handling, unsupported header types, and updated digest length behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: zhongli <335302680@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 15:48:19 +08:00
..
__init__.py Refactor DeerFlow to use Gateway's LangGraph-compatible API 2026-04-26 20:38:34 +08:00
base.py feat(channels): add DingTalk channel integration (#2628) 2026-04-30 11:25:33 +08:00
commands.py fix: avoid treating Feishu file paths as commands (#1654) 2026-04-01 23:23:00 +08:00
dingtalk.py feat(channels): add DingTalk channel integration (#2628) 2026-04-30 11:25:33 +08:00
discord.py feat(channels): enhance Discord with mention-only mode, thread routing, and typing indicators (#2842) 2026-05-15 22:30:05 +08:00
feishu.py fix(channels): preserve Feishu clarification thread continuity (#3285) 2026-05-31 22:43:07 +08:00
manager.py fix(mcp): add auth interceptor with channel user_id and keep header propagation to mcp tools (#3294) 2026-06-03 15:48:19 +08:00
message_bus.py fix(channels): preserve Feishu clarification thread continuity (#3285) 2026-05-31 22:43:07 +08:00
service.py feat(channels): enhance Discord with mention-only mode, thread routing, and typing indicators (#2842) 2026-05-15 22:30:05 +08:00
slack.py fix(channels): accept single slack allowed user (#2481) 2026-04-25 19:40:52 +08:00
store.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
telegram.py Improve Python reliability in channel retries and thread typing (#1776) 2026-04-03 07:50:11 +08:00
wechat.py feat: add WeChat channel integration (#1869) 2026-04-10 20:49:28 +08:00
wecom.py feat(channels): add DingTalk channel integration (#2628) 2026-04-30 11:25:33 +08:00