feat: start of EPP implementation

This commit is contained in:
Maël Gangloff
2025-02-21 16:20:19 +01:00
parent 1db47dfa34
commit 8a46bb76bc
6 changed files with 541 additions and 500 deletions

View File

@@ -0,0 +1,71 @@
<?php
namespace App\Service\Connector;
use App\Entity\Domain;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Cache\InvalidArgumentException;
class EppClientProvider extends AbstractProvider implements EppClientProviderInterface
{
public function __construct(
CacheItemPoolInterface $cacheItemPool,
)
{
parent::__construct($cacheItemPool);
}
protected function verifySpecificAuthData(array $authData): array
{
// TODO: Create DTO for each authData schema
return $authData;
}
protected function assertAuthentication(): void
{
//TODO: implementation
}
public function orderDomain(Domain $domain, bool $dryRun): void
{
//TODO: implementation
}
/**
* @throws InvalidArgumentException
*/
protected function getCachedTldList(): CacheItemInterface
{
return $this->cacheItemPool->getItem('app.provider.epp.supported-tld');
}
protected function getSupportedTldList(): array
{
return [];
}
public function isSupported(Domain ...$domainList): bool
{
if (0 === count($domainList)) {
return true;
}
$tld = $domainList[0]->getTld();
foreach ($domainList as $domain) {
if ($domain->getTld() !== $tld) {
return false;
}
}
return true;
}
public function checkDomains(Domain ...$domains): array
{
//TODO : implementation
return [];
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Service\Connector;
use App\Entity\Domain;
interface EppClientProviderInterface
{
public function checkDomains(Domain ...$domains): array;
}