Performance: - SSE dashboard streaming endpoint (GET /v1/admin/status/stream) - Web Worker for markdown rendering (offload from main thread) - IndexedDB chat persistence (replace localStorage, 500msg support) Security: - CSRF protection middleware (Origin/Referer validation) - Content Security Policy + security headers middleware - API key rotation endpoint (POST /v1/admin/keys/rotate) Observability: - OpenTelemetry tracing with graceful NoOp fallback - Structured error codes (FAGI-xxxx taxonomy with ErrorResponse schema) - Audit log export (CSV + JSON at /v1/admin/audit/export/*) Features: - Multi-session management hook (parallel conversations) - Conversation export (markdown/JSON/text download + clipboard) - Head customization UI (enable/disable + weight sliders for 12 heads) Infrastructure: - Kubernetes Helm chart (Deployment, Service, HPA, Ingress) - Database migration versioning (generate, verify commands) - Blue-green deployment manifests (color-based traffic switching) Tests: 598 Python + 56 frontend = 654 total, 0 ruff errors Co-Authored-By: Nakamoto, S <defi@defi-oracle.io>
23 lines
629 B
Python
23 lines
629 B
Python
"""Tests for audit log export functionality."""
|
|
|
|
from fusionagi.api.routes.audit_export import _get_audit_records
|
|
|
|
|
|
def test_get_audit_records_empty():
|
|
"""Should return empty list when no tracer is available."""
|
|
records = _get_audit_records()
|
|
assert isinstance(records, list)
|
|
|
|
|
|
def test_get_audit_records_with_limit():
|
|
"""Should respect limit parameter."""
|
|
records = _get_audit_records(limit=5)
|
|
assert len(records) <= 5
|
|
|
|
|
|
def test_get_audit_records_with_since():
|
|
"""Should filter by timestamp."""
|
|
import time
|
|
records = _get_audit_records(since=time.time() + 1000)
|
|
assert len(records) == 0
|