feat(V2): X-Bot-Tag header obbligatorio + endpoint /admin/audit con filtri

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
AdrianoDev
2026-05-01 08:51:40 +02:00
parent bd6b03ce43
commit 69ac878893
10 changed files with 549 additions and 8 deletions
+3
View File
@@ -67,6 +67,7 @@ def _configure_audit_sink() -> None:
def audit_write_op(
*,
actor: str | None = None,
bot_tag: str | None = None,
action: str,
exchange: str,
target: str | None = None,
@@ -78,6 +79,7 @@ def audit_write_op(
actor: identificatore di chi ha invocato (es. "testnet", "mainnet",
oppure None per logging anonimo).
bot_tag: identificatore del bot chiamante (header X-Bot-Tag).
action: nome del tool (es. "place_order", "cancel_order").
exchange: identificatore servizio (deribit, bybit, alpaca, hyperliquid).
target: instrument/symbol/order_id su cui si agisce.
@@ -91,6 +93,7 @@ def audit_write_op(
"action": action,
"exchange": exchange,
"actor": actor,
"bot_tag": bot_tag,
"target": target,
"payload": payload or {},
}