```
chore: refactor logging module, update genesis timestamp, remove model relationships, and reorganize routers - Rename logging.py to logger.py and update import paths in poa.py and main.py - Update devnet genesis timestamp to 1766828620 - Remove SQLModel Relationship declarations from Block, Transaction, and Receipt models - Add SessionDep type alias and get_session dependency in coordinator-api deps - Reorganize coordinator-api routers: replace explorer/registry with exchange, users, marketplace
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
from typing import Callable
|
||||
from typing import Callable, Generator, Annotated
|
||||
from fastapi import Depends, Header, HTTPException
|
||||
from sqlmodel import Session
|
||||
|
||||
from .config import settings
|
||||
|
||||
|
||||
def get_session() -> Generator[Session, None, None]:
|
||||
"""Get database session"""
|
||||
from .database import engine
|
||||
with Session(engine) as session:
|
||||
yield session
|
||||
|
||||
|
||||
# Type alias for session dependency
|
||||
SessionDep = Annotated[Session, Depends(get_session)]
|
||||
|
||||
|
||||
class APIKeyValidator:
|
||||
def __init__(self, allowed_keys: list[str]):
|
||||
self.allowed_keys = {key.strip() for key in allowed_keys if key}
|
||||
|
||||
Reference in New Issue
Block a user