Files
aoc/backend/models/api.py
Tomas Kracmar b0198012eb
Some checks failed
CI / lint-and-test (push) Has been cancelled
feat: implement Phase 3 scaling
- Replace skip-based pagination with cursor-based pagination (timestamp|_id cursors)
- Add Prometheus /metrics endpoint with request latency, fetch volume, and error counters
- Implement incremental fetch watermarking per source (watermarks collection in MongoDB)
- Add Graph change notification webhook endpoint (/api/webhooks/graph)
- Add correlation ID middleware for distributed tracing (x-request-id header)
- Update frontend to use cursor-based pagination with Prev/Next navigation
- Update tests for cursor pagination, metrics, webhooks, and watermark mocking
2026-04-14 14:58:50 +02:00

43 lines
1004 B
Python

from pydantic import BaseModel, ConfigDict
class EventItem(BaseModel):
id: str | None = None
timestamp: str | None = None
service: str | None = None
operation: str | None = None
result: str | None = None
actor_display: str | None = None
target_displays: list[str] | None = None
display_summary: str | None = None
display_category: str | None = None
dedupe_key: str | None = None
actor: dict | None = None
targets: list[dict] | None = None
raw: dict | None = None
raw_text: str | None = None
model_config = ConfigDict(extra="allow")
class PaginatedEventResponse(BaseModel):
items: list[dict]
total: int
page_size: int
next_cursor: str | None = None
class FilterOptionsResponse(BaseModel):
services: list[str]
operations: list[str]
results: list[str]
actors: list[str]
actor_upns: list[str]
devices: list[str]
class FetchAuditLogsResponse(BaseModel):
stored_events: int
errors: list[str]