Implement Deprecation Warning System and Router Registry Cleanup

- Added DeprecationParams dependency to log warnings when legacy routes are accessed.
- Updated setup_routers to apply deprecation warnings to non-V3 legacy endpoints.
- Exempted core infrastructure, special routers, and routers currently in use from deprecation warnings.
- Cleaned up 24 unused router imports from the registry.
This commit is contained in:
Scott Idem
2026-01-28 10:55:03 -05:00
parent b37108e5dd
commit a97e80baab
2 changed files with 37 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
from fastapi import Depends, Header, HTTPException, Query, Response, status
from fastapi import Depends, Header, HTTPException, Query, Request, Response, status
from typing import Optional, Union
import logging
import asyncio
@@ -7,6 +7,13 @@ from app.models.auth_models import AccountContext
log = logging.getLogger(__name__)
# --- Deprecation Dependency ---
class DeprecationParams:
"""Logs a warning when a legacy/deprecated route is accessed."""
def __init__(self, request: Request):
log.warning(f"!!! DEPRECATED ROUTE ACCESSED: [{request.method}] {request.url.path} from {request.client.host if request.client else 'Unknown'}")
# --- Account Context Dependencies ---
def get_account_context_optional(