diff --git a/fastapi_auth/dependencies.py b/fastapi_auth/dependencies.py index 2e837da..372f3ee 100644 --- a/fastapi_auth/dependencies.py +++ b/fastapi_auth/dependencies.py @@ -10,6 +10,9 @@ from .permissions import Permission from .logger import LOG +class Unauthorized(Exception): + """ """ + def get_user(request: Request) -> User: """This dependency return either an authenticated user depending on the diff --git a/fastapi_auth/user_management_sqlobject.py b/fastapi_auth/user_management_sqlobject.py index 9cd3291..39c01ca 100644 --- a/fastapi_auth/user_management_sqlobject.py +++ b/fastapi_auth/user_management_sqlobject.py @@ -9,6 +9,7 @@ from .auth_config import AUTH_SETTINGS from .roles import ROLES_REGISTRY +from .logger import LOG # AuthUser is an alias in order to avoid name clash with the SQLModel User class below from .users import User as AuthUser @@ -32,6 +33,7 @@ class UserManagement: @typechecked def __init__(self, db_uri: str) -> None: + LOG.info(f"Connecting to database {db_uri}") self.engine = create_engine(db_uri) SQLModel.metadata.create_all(self.engine) diff --git a/pyproject.toml b/pyproject.toml index 409d74e..bb2efcf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "zopyx-fastapi-auth" description = "FastAPI authentication and authorization" -version = "0.2.2.3" +version = "0.2.2.4" readme = "README.md" authors = [ { name = "Andreas Jung", email = "info@zopyx.com" }