feat: 完成 issue #48 DLP 敏感数据拦截(目标 100% 拦截)

This commit is contained in:
2026-08-04 17:15:02 +08:00
parent 4c3a9fdbe6
commit fa5523a37d
6 changed files with 838 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
"""测试引导:把 `core/llm-gateway` 以包名 `llm_gateway` 挂载到 sys.modules。
目录名 `llm-gateway` 含连字符,无法直接以包名 import;挂载后模块内相对导入
(`from .dlp import ...`)在 unittest 发现机制下可正常解析。
"""
import os
import sys
import types
LLM_GW_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, LLM_GW_DIR)
if "llm_gateway" not in sys.modules:
pkg = types.ModuleType("llm_gateway")
pkg.__path__ = [LLM_GW_DIR]
sys.modules["llm_gateway"] = pkg