mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: start of EPP implementation
This commit is contained in:
71
src/Service/Connector/EppClientProvider.php
Normal file
71
src/Service/Connector/EppClientProvider.php
Normal 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 [];
|
||||
}
|
||||
}
|
||||
10
src/Service/Connector/EppClientProviderInterface.php
Normal file
10
src/Service/Connector/EppClientProviderInterface.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\Connector;
|
||||
|
||||
use App\Entity\Domain;
|
||||
|
||||
interface EppClientProviderInterface
|
||||
{
|
||||
public function checkDomains(Domain ...$domains): array;
|
||||
}
|
||||
Reference in New Issue
Block a user