refactor(backend): dify, minio等迁移到integration,清除无效文件

This commit is contained in:
sophie committed 2026-09-21 09:24:45 +08:00
1 parent 7fe7a39384
commit faa554ade4
90 files changed
+7540 -9649

No files matched your search

@@ -2,7 +2,7 @@
backend/app/services/shipping_notice/fulfillment_audit.py
用途:履约关键节点与敏感访问写入统一审计事件的轻量封装。
依赖:audit_service.append_shipping_audit_event、Flask g.request_id / request、AppError、db.session。
依赖:audit_service.append_shipping_audit_event、Flask g.request_id、core.http_context、AppError、db.session。
逻辑:由 candidate / decision / fulfillment_workflow / workspace 读取与导出 / Workflow 写路径调用;
默认 strict=True;审计写入包在 SAVEPOINT 内,失败不污染外层业务事务;
strict=False 时仅记日志(门禁路径用,禁止审计打断匹配等业务结果);
@@ -37,10 +37,11 @@ def _client_request_context() -> tuple[str | None, str | None]:
核心逻辑:优先 X-Forwarded-For 首段;无请求上下文时返回 (None, None)。
"""
try:
from flask import request
forwarded = str(request.headers.get('X-Forwarded-For') or '').split(',')[0].strip()
ip = forwarded or str(request.remote_addr or '').strip() or None
ua = str(request.headers.get('User-Agent') or '').strip() or None
from app.core.http_context import header, remote_addr
forwarded = header('X-Forwarded-For').split(',')[0].strip()
ip = forwarded or remote_addr() or None
ua = header('User-Agent').strip() or None
return ip, ua
except RuntimeError:
return None, None