代码提交

This commit is contained in:
董宏凯 committed 2026-08-30 01:25:20 +08:00
1 parent 4ac7bc21cd
commit 17cf849361
110 files changed
+17007 -518

No files matched your search

@@ -0,0 +1,22 @@
"""Structured audit lines for Workflow Studio mutating APIs.
These are operator logs, not a separate audit table: every line is a single
JSON object with a stable ``action`` plus the ids needed to reconstruct who
did what. Secrets never go in.
"""
from __future__ import annotations
import json
import logging
from typing import Any
logger = logging.getLogger("deerflow.workflows.audit")
def audit_workflow(action: str, *, user_id: str, **fields: Any) -> None:
payload = {"action": action, "userId": user_id, **fields}
logger.info("workflow.audit %s", json.dumps(payload, ensure_ascii=False, default=str))
__all__ = ["audit_workflow"]