Skip to content

Commit f58e48a

Browse files
committed
Infrastructure -> Outbound
1 parent 9d9f7f6 commit f58e48a

69 files changed

Lines changed: 127 additions & 129 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

alembic.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# this is typically a path given in POSIX (e.g. forward slashes)
66
# format, relative to the token %(here)s which refers to the location of this
77
# ini file
8-
script_location = src/app/infrastructure/persistence_sqla/alembic
8+
script_location = src/app/outbound/persistence_sqla/alembic
99

1010
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
1111
# Uncomment the line below if you want the files to be prepended with date and time

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ containers = ["app"]
9797
layers = [
9898
"(main)",
9999
"presentation",
100-
"infrastructure",
100+
"outbound",
101101
"core",
102102
]
103103
ignore_imports = [
104-
"app.infrastructure.persistence_sqla.alembic.env -> app.main.config.loader",
105-
"app.infrastructure.persistence_sqla.alembic.env -> app.main.config.settings",
104+
"app.outbound.persistence_sqla.alembic.env -> app.main.config.loader",
105+
"app.outbound.persistence_sqla.alembic.env -> app.main.config.settings",
106106
]
107107

108108
[[tool.importlinter.contracts]]
@@ -137,8 +137,8 @@ forbidden_modules = ["app.core.commands"]
137137
id = "auth-ctx"
138138
name = "auth-ctx must use its own adapters"
139139
type = "forbidden"
140-
source_modules = ["app.infrastructure.auth_ctx"]
141-
forbidden_modules = ["app.infrastructure.adapters"]
140+
source_modules = ["app.outbound.auth_ctx"]
141+
forbidden_modules = ["app.outbound.adapters"]
142142

143143
[tool.mypy]
144144
mypy_path = ["src"]
@@ -247,7 +247,7 @@ split-on-trailing-comma = true
247247

248248
[tool.ruff.lint.per-file-ignores]
249249
"scripts/dishka/plot_dependencies_data.py" = ["T201"] # print
250-
"src/app/infrastructure/persistence_sqla/alembic/**" = ["ALL"]
250+
"src/app/outbound/persistence_sqla/alembic/**" = ["ALL"]
251251
"tests/**" = [
252252
"ARG002", # unused-method-argument
253253
"PLC2801", # unnecessary-dunder-call
@@ -263,7 +263,7 @@ split-on-trailing-comma = true
263263
[tool.slotscheck]
264264
strict-imports = true
265265
exclude-modules = '''
266-
^app\.infrastructure\.persistence_sqla\.alembic
266+
^app\.outbound\.persistence_sqla\.alembic
267267
'''
268268

269269
[tool.typos.files]

src/app/main/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
from pydantic import BaseModel, Field, PostgresDsn
55

6-
from app.infrastructure.auth_ctx.jwt_types import JwtAlgorithm
76
from app.main.config.logging_ import LoggingLevel
7+
from app.outbound.auth_ctx.jwt_types import JwtAlgorithm
88

99

1010
class AppSettings(BaseModel):

src/app/main/ioc/core.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
from app.core.common.services.user import UserService
1919
from app.core.queries.list_users import ListUsers
2020
from app.core.queries.ports.user_reader import UserReader
21-
from app.infrastructure.adapters.auth_session_access_revoker import AuthSessionAccessRevoker
22-
from app.infrastructure.adapters.auth_session_identity_provider import AuthSessionIdentityProvider
23-
from app.infrastructure.adapters.bcrypt_password_hasher import (
21+
from app.main.config.settings import PasswordHasherSettings
22+
from app.outbound.adapters.auth_session_access_revoker import AuthSessionAccessRevoker
23+
from app.outbound.adapters.auth_session_identity_provider import AuthSessionIdentityProvider
24+
from app.outbound.adapters.bcrypt_password_hasher import (
2425
BcryptPasswordHasher,
2526
HasherSemaphore,
2627
HasherThreadPoolExecutor,
2728
)
28-
from app.infrastructure.adapters.sqla_flusher import SqlaFlusher
29-
from app.infrastructure.adapters.sqla_transaction_manager import SqlaTransactionManager
30-
from app.infrastructure.adapters.sqla_user_reader import SqlaUserReader
31-
from app.infrastructure.adapters.sqla_user_tx_storage import SqlaUserTxStorage
32-
from app.infrastructure.adapters.system_utc_timer import SystemUtcTimer
33-
from app.main.config.settings import PasswordHasherSettings
29+
from app.outbound.adapters.sqla_flusher import SqlaFlusher
30+
from app.outbound.adapters.sqla_transaction_manager import SqlaTransactionManager
31+
from app.outbound.adapters.sqla_user_reader import SqlaUserReader
32+
from app.outbound.adapters.sqla_user_tx_storage import SqlaUserTxStorage
33+
from app.outbound.adapters.system_utc_timer import SystemUtcTimer
3434

3535

3636
class CoreProvider(Provider):
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@
88
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, async_sessionmaker, create_async_engine
99
from starlette.requests import Request
1010

11-
from app.infrastructure.adapters.bcrypt_password_hasher import HasherSemaphore, HasherThreadPoolExecutor
12-
from app.infrastructure.auth_ctx.cookie_manager import CookieManager, CookieName
13-
from app.infrastructure.auth_ctx.handlers.change_password import ChangePassword
14-
from app.infrastructure.auth_ctx.handlers.log_in import LogIn
15-
from app.infrastructure.auth_ctx.handlers.log_out import LogOut
16-
from app.infrastructure.auth_ctx.handlers.sign_up import SignUp
17-
from app.infrastructure.auth_ctx.jwt_processor import JwtProcessor
18-
from app.infrastructure.auth_ctx.service import AuthService
19-
from app.infrastructure.auth_ctx.sqla_transaction_manager import AuthSqlaTransactionManager
20-
from app.infrastructure.auth_ctx.sqla_tx_storage import AuthSessionSqlaTxStorage
21-
from app.infrastructure.auth_ctx.sqla_user_tx_storage import AuthSqlaUserTxStorage
22-
from app.infrastructure.auth_ctx.types_ import AuthAsyncSession
23-
from app.infrastructure.auth_ctx.utc_timer import AuthSessionUtcTimer
2411
from app.main.config.settings import (
2512
CookieSettings,
2613
JwtSettings,
@@ -29,6 +16,19 @@
2916
SessionSettings,
3017
SqlaSettings,
3118
)
19+
from app.outbound.adapters.bcrypt_password_hasher import HasherSemaphore, HasherThreadPoolExecutor
20+
from app.outbound.auth_ctx.cookie_manager import CookieManager, CookieName
21+
from app.outbound.auth_ctx.handlers.change_password import ChangePassword
22+
from app.outbound.auth_ctx.handlers.log_in import LogIn
23+
from app.outbound.auth_ctx.handlers.log_out import LogOut
24+
from app.outbound.auth_ctx.handlers.sign_up import SignUp
25+
from app.outbound.auth_ctx.jwt_processor import JwtProcessor
26+
from app.outbound.auth_ctx.service import AuthService
27+
from app.outbound.auth_ctx.sqla_transaction_manager import AuthSqlaTransactionManager
28+
from app.outbound.auth_ctx.sqla_tx_storage import AuthSessionSqlaTxStorage
29+
from app.outbound.auth_ctx.sqla_user_tx_storage import AuthSqlaUserTxStorage
30+
from app.outbound.auth_ctx.types_ import AuthAsyncSession
31+
from app.outbound.auth_ctx.utc_timer import AuthSessionUtcTimer
3232

3333
logger = logging.getLogger(__name__)
3434

@@ -168,7 +168,7 @@ class RequestProvider(Provider):
168168
request = from_context(provides=Request, scope=Scope.REQUEST)
169169

170170

171-
def infrastructure_providers() -> tuple[Provider, ...]:
171+
def outbound_providers() -> tuple[Provider, ...]:
172172
return (
173173
HasherThreadPoolProvider(),
174174
PersistenceSqlaProvider(),

src/app/main/ioc/provider_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from dishka import Provider
44

55
from app.main.ioc.core import CoreProvider
6-
from app.main.ioc.infrastructure import infrastructure_providers
6+
from app.main.ioc.outbound import outbound_providers
77

88

99
def get_providers() -> Iterable[Provider]:
1010
return (
1111
CoreProvider(),
12-
*infrastructure_providers(),
12+
*outbound_providers(),
1313
)

src/app/main/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from dishka.integrations.fastapi import setup_dishka
66
from fastapi import FastAPI
77

8-
from app.infrastructure.persistence_sqla.mappings.all import map_tables
98
from app.main.config.loader import (
109
load_app_settings,
1110
load_cookie_settings,
@@ -26,6 +25,7 @@
2625
)
2726
from app.main.ioc.provider_registry import get_providers
2827
from app.main.setup import setup_global_exception_handlers, setup_logging, setup_middlewares
28+
from app.outbound.persistence_sqla.mappings.all import map_tables
2929
from app.presentation.http.root_router import make_fastapi_root_router
3030

3131

File renamed without changes.

src/app/infrastructure/adapters/auth_session_access_revoker.py renamed to src/app/outbound/adapters/auth_session_access_revoker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from app.core.common.entities.types_ import UserId
22
from app.core.common.ports.access_revoker import AccessRevoker
3-
from app.infrastructure.auth_ctx.service import AuthService
3+
from app.outbound.auth_ctx.service import AuthService
44

55

66
class AuthSessionAccessRevoker(AccessRevoker):

0 commit comments

Comments
 (0)