fix auth manager
This commit is contained in:
@@ -3,10 +3,10 @@ from typing import Protocol
|
|||||||
from src.repository.users import UsersRepo
|
from src.repository.users import UsersRepo
|
||||||
|
|
||||||
|
|
||||||
class IUnitOfWork(Protocol):
|
class IUOWDB(Protocol):
|
||||||
user: UsersRepo
|
user: UsersRepo
|
||||||
|
|
||||||
async def __aenter__(self) -> "IUnitOfWork": ...
|
async def __aenter__(self) -> "IUOWDB": ...
|
||||||
|
|
||||||
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: ...
|
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: ...
|
||||||
|
|
||||||
|
|||||||
@@ -38,4 +38,3 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
|
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
print(settings.db.url)
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from fastapi import FastAPI
|
|||||||
sys.path.append(str(Path(__file__).parent.parent))
|
sys.path.append(str(Path(__file__).parent.parent))
|
||||||
from src.api import router
|
from src.api import router
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI(title="Task&Coffee")
|
||||||
app.include_router(router=router)
|
app.include_router(router=router)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from src.schemas.users import UserRequestADD, User, UserAdd
|
from src.schemas.users import UserRequestADD, User, UserAdd
|
||||||
from src.services.base import BaseService
|
from src.services.base import BaseService
|
||||||
from src.utils.auth_manager import AuthManger
|
from src.core.auth_manager import AuthManger
|
||||||
|
|
||||||
|
|
||||||
class AuthService(BaseService):
|
class AuthService(BaseService):
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from src.core.interfaces import IUnitOfWork
|
from src.core.interfaces import IUOWDB
|
||||||
|
|
||||||
|
|
||||||
class BaseService:
|
class BaseService:
|
||||||
session: IUnitOfWork | None
|
session: IUOWDB | None
|
||||||
|
|
||||||
def __init__(self, session: "IUnitOfWork"):
|
def __init__(self, session: "IUOWDB"):
|
||||||
self.session = session
|
self.session = session
|
||||||
|
|||||||
Reference in New Issue
Block a user