Secure websocket endpoints

This commit is contained in:
grossmj committed 2021-11-01 16:45:14 +10:30
1 parent 7ce5e19a6e
commit 741fc4a557
5 files changed
+82 -21

No files matched your search

@@ -15,13 +15,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from typing import Callable, Type
from fastapi import Depends, Request
from fastapi import Depends
from starlette.requests import HTTPConnection
from sqlalchemy.ext.asyncio import AsyncSession
from gns3server.db.repositories.base import BaseRepository
async def get_db_session(request: Request) -> AsyncSession:
async def get_db_session(request: HTTPConnection) -> AsyncSession:
session = AsyncSession(request.app.state._db_engine, expire_on_commit=False)
try: