chore: enhance security configuration across applications
- Add root-level *.json to .gitignore to prevent wallet backup leaks - Replace wildcard CORS origins with explicit localhost URLs across all apps - Add OPTIONS method to CORS allowed methods for preflight requests - Update coordinator database to use absolute path in data/ directory to prevent duplicates - Add JWT secret validation in coordinator config (must be set via environment) - Replace deprecated get_session dependency with Session
This commit is contained in:
@@ -1,21 +1,9 @@
|
||||
from typing import Callable, Generator, Annotated
|
||||
from typing import Callable, 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