agent foundation

This commit is contained in:
2026-03-06 00:44:52 +01:00
parent 9819cba733
commit 9a08f96c11
199 changed files with 8522 additions and 1880 deletions

View File

@@ -2,6 +2,9 @@
namespace MintyPHP\Service\Auth;
use MintyPHP\Http\CookieStoreInterface;
use MintyPHP\Http\RequestRuntimeInterface;
use MintyPHP\Http\SessionStoreInterface;
use MintyPHP\Repository\Support\DatabaseSessionRepository;
use MintyPHP\Service\Audit\AuditServicesFactory;
use MintyPHP\Service\Mail\MailServicesFactory;
@@ -18,6 +21,7 @@ class AuthServicesFactory
private ?RememberMeService $rememberMeService = null;
private ?AuthService $authService = null;
private ?SsoUserLinkService $ssoUserLinkService = null;
private ?AuthSessionTenantContextService $authSessionTenantContextService = null;
public function __construct(
private readonly UserServicesFactory $userServicesFactory,
@@ -25,7 +29,10 @@ class AuthServicesFactory
private readonly MailServicesFactory $mailServicesFactory,
private readonly AuthRepositoryFactory $authRepositoryFactory,
private readonly AuthGatewayFactory $authGatewayFactory,
private readonly DatabaseSessionRepository $databaseSessionRepository
private readonly DatabaseSessionRepository $databaseSessionRepository,
private readonly SessionStoreInterface $sessionStore,
private readonly CookieStoreInterface $cookieStore,
private readonly RequestRuntimeInterface $requestRuntime
) {
}
@@ -36,7 +43,8 @@ class AuthServicesFactory
$this->authRepositoryFactory->createApiTokenRepository(),
$this->authGatewayFactory->createAuthSettingsGateway(),
$this->createAuthScopeGateway(),
$this->databaseSessionRepository
$this->databaseSessionRepository,
$this->requestRuntime
);
}
@@ -67,9 +75,11 @@ class AuthServicesFactory
$this->userServicesFactory->createUserReadRepository(),
$this->userServicesFactory->createUserWriteRepository(),
$this->authRepositoryFactory->createRememberTokenRepository(),
$this->userServicesFactory->createUserTenantContextService(),
$this->authGatewayFactory->createAuthPermissionGateway(),
$this->authGatewayFactory->createAuthSavedFilterGateway()
$this->createAuthSessionTenantContextService(),
$this->sessionStore,
$this->cookieStore,
$this->requestRuntime
);
}
@@ -84,8 +94,9 @@ class AuthServicesFactory
$this->createEmailVerificationService(),
$this->authGatewayFactory->createAuthPermissionGateway(),
$this->createAuthTenantSsoGateway(),
$this->authGatewayFactory->createAuthSavedFilterGateway(),
$this->auditServicesFactory->createSystemAuditService()
$this->createAuthSessionTenantContextService(),
$this->auditServicesFactory->createSystemAuditService(),
$this->sessionStore
);
}
@@ -115,7 +126,7 @@ class AuthServicesFactory
public function createMicrosoftOidcStateStore(): MicrosoftOidcStateStoreService
{
return $this->microsoftOidcStateStoreService ??= new MicrosoftOidcStateStoreService();
return $this->microsoftOidcStateStoreService ??= new MicrosoftOidcStateStoreService($this->sessionStore);
}
public function createMicrosoftOidcService(): MicrosoftOidcService
@@ -142,4 +153,13 @@ class AuthServicesFactory
{
return new OidcHttpGateway();
}
private function createAuthSessionTenantContextService(): AuthSessionTenantContextService
{
return $this->authSessionTenantContextService ??= new AuthSessionTenantContextService(
$this->userServicesFactory->createUserTenantContextService(),
$this->authGatewayFactory->createAuthSavedFilterGateway(),
$this->sessionStore
);
}
}