feat(api): add POST/GET /v1/files with auth, error envelope, and request-id middleware

Why:
- Wires the ADR-0008 error envelope, per-request correlation id, and the
  /v1/files routes into the app.

Changes:
- Extend AppResources/lifespan with the ingestion CapacityLimiter and
  ObjectStorage adapter.

Impact:
- /v1 now exposes routes for the first time.
This commit is contained in:
2026-08-19 15:00:39 +03:30
parent c9cf7b368b
commit 3bced65926
10 changed files with 355 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
from fastapi import FastAPI
from src.api.errors import register_exception_handlers
from src.api.middleware import RequestIdMiddleware
from src.api.router import router as v1_router
from src.api.routers.health import router as health_router
from src.bootstrap.lifespan import create_lifespan
@@ -8,6 +10,8 @@ from src.config import Settings
def create_app(settings: Settings | None = None) -> FastAPI:
app = FastAPI(lifespan=create_lifespan(settings))
app.add_middleware(RequestIdMiddleware)
register_exception_handlers(app)
app.include_router(health_router)
app.include_router(v1_router, prefix="/v1")
return app