fix(security): isolate allowlisted execution broker
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m9s
CD Pipeline / build-and-deploy (push) Successful in 4m35s
CD Pipeline / post-deploy-checks (push) Successful in 1m49s
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m9s
CD Pipeline / build-and-deploy (push) Successful in 4m35s
CD Pipeline / post-deploy-checks (push) Successful in 1m49s
This commit is contained in:
@@ -29,6 +29,7 @@ from sqlalchemy.ext.asyncio import (
|
||||
create_async_engine,
|
||||
)
|
||||
from sqlalchemy.orm import DeclarativeBase
|
||||
from sqlalchemy.pool import NullPool
|
||||
|
||||
from src.core.config import settings
|
||||
from src.core.context import get_current_project_context
|
||||
@@ -87,14 +88,21 @@ def get_engine() -> AsyncEngine:
|
||||
"Set DATABASE_URL to PostgreSQL: postgresql+asyncpg://user:pass@host:5432/db"
|
||||
)
|
||||
|
||||
_engine = create_async_engine(
|
||||
database_url,
|
||||
echo=settings.DEBUG,
|
||||
pool_size=settings.DATABASE_POOL_SIZE,
|
||||
max_overflow=settings.DATABASE_MAX_OVERFLOW,
|
||||
pool_timeout=settings.DATABASE_POOL_TIMEOUT_SECONDS,
|
||||
pool_pre_ping=True,
|
||||
)
|
||||
engine_kwargs: dict[str, object] = {
|
||||
"echo": settings.DEBUG,
|
||||
"pool_pre_ping": True,
|
||||
}
|
||||
if settings.DATABASE_NULL_POOL:
|
||||
engine_kwargs["poolclass"] = NullPool
|
||||
else:
|
||||
engine_kwargs.update(
|
||||
{
|
||||
"pool_size": settings.DATABASE_POOL_SIZE,
|
||||
"max_overflow": settings.DATABASE_MAX_OVERFLOW,
|
||||
"pool_timeout": settings.DATABASE_POOL_TIMEOUT_SECONDS,
|
||||
}
|
||||
)
|
||||
_engine = create_async_engine(database_url, **engine_kwargs)
|
||||
return _engine
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user