diff --git a/packages/application/auth/__init__.py b/packages/application/auth/__init__.py index 2e1cb7054..8a4cc7cf2 100644 --- a/packages/application/auth/__init__.py +++ b/packages/application/auth/__init__.py @@ -1,5 +1,6 @@ """认证相关 Use Cases 和委托处理器""" +from packages.application.auth.password_hasher import password_hasher, password_validator from packages.application.auth.login_use_case import ( LoginRequest, LoginResponse, @@ -58,4 +59,6 @@ __all__ = [ "PasswordHandler", "configure_password_handler", "get_password_handler", + "password_hasher", + "password_validator", ] diff --git a/packages/application/auth/register_user_use_case.py b/packages/application/auth/register_user_use_case.py index 7f17ff2b4..f58079483 100755 --- a/packages/application/auth/register_user_use_case.py +++ b/packages/application/auth/register_user_use_case.py @@ -8,7 +8,7 @@ from typing import Optional from uuid import uuid4 from packages.adapters.smtp import get_email_service -from packages.application.auth import password_hasher, password_validator +from packages.application.auth.password_hasher import password_hasher, password_validator from packages.domain.entities import User diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py index 142918582..27118cc8a 100644 --- a/tests/unit/test_auth.py +++ b/tests/unit/test_auth.py @@ -28,7 +28,7 @@ from app.config import settings from packages.adapters.smtp import NoopEmailService from packages.application.auth.login_use_case import LoginRequest, LoginUseCase from packages.application.auth.register_user_use_case import RegisterUserRequest, RegisterUserUseCase -from packages.application.auth import password_hasher +from packages.application.auth.password_hasher import password_hasher from packages.domain.entities import User diff --git a/tests/unit/test_auth_middleware.py b/tests/unit/test_auth_middleware.py index bf1046bd4..a956cbce8 100644 --- a/tests/unit/test_auth_middleware.py +++ b/tests/unit/test_auth_middleware.py @@ -15,7 +15,7 @@ if str(API_ROOT) not in sys.path: from app.config import settings from app.middleware.auth import get_current_user, get_current_user_optional, require_workspace_access -from packages.application.auth import password_hasher +from packages.application.auth.password_hasher import password_hasher from packages.domain.entities import User diff --git a/tests/unit/test_login_use_case.py b/tests/unit/test_login_use_case.py index 4ef8e0401..8129b5021 100644 --- a/tests/unit/test_login_use_case.py +++ b/tests/unit/test_login_use_case.py @@ -13,7 +13,7 @@ from packages.application.auth import ( LogoutRequest, LogoutUseCase, ) -from packages.application.auth import password_hasher +from packages.application.auth.password_hasher import password_hasher from packages.domain.entities import User diff --git a/tests/unit/test_workspace_sqlalchemy_repositories.py b/tests/unit/test_workspace_sqlalchemy_repositories.py index d611c2ee6..b1853e99e 100644 --- a/tests/unit/test_workspace_sqlalchemy_repositories.py +++ b/tests/unit/test_workspace_sqlalchemy_repositories.py @@ -10,7 +10,7 @@ from packages.application.workspace.create_workspace_use_case import CreateWorks from packages.application.workspace.invite_member_use_case import InviteMemberRequest, InviteMemberUseCase from packages.application.workspace.list_members_use_case import ListMembersRequest, ListMembersUseCase from packages.application.workspace.list_workspaces_use_case import ListWorkspacesRequest, ListWorkspacesUseCase -from packages.application.auth import password_hasher +from packages.application.auth.password_hasher import password_hasher from packages.domain.entities import User