refactor(arch): enforce gateway compliance and remove service-wrapping gateways

This commit is contained in:
2026-03-13 11:31:33 +01:00
parent 082fa4c9a5
commit 892da0048d
96 changed files with 1117 additions and 1060 deletions

View File

@@ -7,6 +7,7 @@ use MintyPHP\Http\SessionStoreInterface;
use MintyPHP\Repository\User\UserReadRepositoryInterface;
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
use MintyPHP\Router;
use MintyPHP\Service\Access\PermissionService;
use MintyPHP\Service\Audit\SystemAuditService;
use MintyPHP\Service\User\UserAccountService;
use MintyPHP\Service\User\UserTenantContextService;
@@ -22,8 +23,8 @@ class AuthService
private readonly UserTenantContextService $userTenantContextService,
private readonly RememberMeService $rememberMeService,
private readonly EmailVerificationService $emailVerificationService,
private readonly AuthPermissionGateway $permissionGateway,
private readonly AuthTenantSsoGateway $tenantSsoGateway,
private readonly PermissionService $permissionService,
private readonly TenantSsoService $tenantSsoService,
private readonly AuthSessionTenantContextService $authSessionTenantContextService,
private readonly SystemAuditService $systemAuditService,
private readonly SessionStoreInterface $sessionStore
@@ -92,7 +93,7 @@ class AuthService
];
}
if ($userId > 0) {
$this->permissionGateway->warmUserPermissions($userId, true);
$this->permissionService->getUserPermissions($userId, true);
$this->loadTenantDataIntoSession($userId);
if ($this->noActiveTenant()) {
Auth::logout();
@@ -135,7 +136,7 @@ class AuthService
if ($tenantId <= 0) {
continue;
}
if ($this->tenantSsoGateway->isLocalPasswordLoginAllowed($tenantId)) {
if ($this->tenantSsoService->isLocalPasswordLoginAllowed($tenantId)) {
return true;
}
}
@@ -184,7 +185,7 @@ class AuthService
}
}
$this->permissionGateway->warmUserPermissions($userId, true);
$this->permissionService->getUserPermissions($userId, true);
$this->loadTenantDataIntoSession($userId);
if ($this->noActiveTenant()) {
Auth::logout();
@@ -336,7 +337,7 @@ class AuthService
}
$this->sessionStore->set('user', $user);
$this->permissionGateway->warmUserPermissions($userId, true);
$this->permissionService->getUserPermissions($userId, true);
$this->loadTenantDataIntoSession($userId);
$refreshed = true;
}