Extract shared utilities to aitbc-core package

- Updated aitbc-core pyproject.toml with structlog and starlette dependencies
- Created middleware directory with 4 middleware files:
  - RequestIDMiddleware for request correlation
  - PerformanceLoggingMiddleware for performance tracking
  - RequestValidationMiddleware for size validation
  - ErrorHandlerMiddleware for standardized error responses
- Added structlog logging functions (configure_logging, get_logger) to aitbc-core
- Updated coordinator-api main.py to use aitbc-core middleware and logging
- Removed local middleware files from coordinator-api
- Removed app_logging.py from coordinator-api
- Added aitbc-core as workspace package to root pyproject.toml

This completes Phase 4.1: Extract shared utilities to aitbc-core
This commit is contained in:
aitbc
2026-04-30 11:16:39 +02:00
parent 56d510e75f
commit ac299b19b8
10 changed files with 300 additions and 7 deletions

View File

@@ -91,11 +91,13 @@ except ImportError:
print("WARNING: ML ZK proofs router not available (missing dependencies)")
from aitbc import get_logger
from .app_logging import configure_logging
from .middleware.request_id import RequestIDMiddleware
from .middleware.performance import PerformanceLoggingMiddleware
from .middleware.validation import RequestValidationMiddleware
from .middleware.error_handler import ErrorHandlerMiddleware
from aitbc.logging import configure_logging
from aitbc import (
RequestIDMiddleware,
PerformanceLoggingMiddleware,
RequestValidationMiddleware,
ErrorHandlerMiddleware,
)
from .exceptions import AITBCError, ErrorResponse
# Configure structured logging