Files
aoc/backend/models/api.py
Tomas Kracmar 9271b4e461
Some checks failed
CI / lint-and-test (push) Has been cancelled
feat: implement Phase 2 stabilization
- Cache Graph API tokens with expiry-aware reuse in graph/auth.py
- Add tenacity-based retry/backoff wrapper (utils/http.py) and apply to all Graph/source API calls
- Add Pydantic request/response models (models/api.py) and FastAPI query constraints
- Add unit tests for event_model, auth and integration tests for API endpoints
- Configure ruff linter/formatter in pyproject.toml
- Add GitHub Actions CI pipeline (.github/workflows/ci.yml)
- Add requirements-dev.txt with pytest, mongomock, httpx, ruff
- Clean up typing imports and fix ruff linting across codebase
2026-04-14 12:02:28 +02:00

42 lines
982 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: int
page_size: int
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]