mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Secure websocket endpoints
This commit is contained in:
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:
|
||||
|
||||
Reference in new issue
Block a user