mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
feat: check EPP contact roid
This commit is contained in:
parent
3657442f67
commit
e6a1a275b6
@ -4,6 +4,8 @@ namespace App\Service\Connector;
|
|||||||
|
|
||||||
use App\Dto\Connector\EppClientProviderDto;
|
use App\Dto\Connector\EppClientProviderDto;
|
||||||
use App\Entity\Domain;
|
use App\Entity\Domain;
|
||||||
|
use Metaregistrar\EPP\eppCheckContactRequest;
|
||||||
|
use Metaregistrar\EPP\eppCheckContactResponse;
|
||||||
use Metaregistrar\EPP\eppCheckDomainRequest;
|
use Metaregistrar\EPP\eppCheckDomainRequest;
|
||||||
use Metaregistrar\EPP\eppCheckDomainResponse;
|
use Metaregistrar\EPP\eppCheckDomainResponse;
|
||||||
use Metaregistrar\EPP\eppConnection;
|
use Metaregistrar\EPP\eppConnection;
|
||||||
@ -15,6 +17,7 @@ use Metaregistrar\EPP\eppHelloRequest;
|
|||||||
use Psr\Cache\CacheItemInterface;
|
use Psr\Cache\CacheItemInterface;
|
||||||
use Psr\Cache\CacheItemPoolInterface;
|
use Psr\Cache\CacheItemPoolInterface;
|
||||||
use Psr\Cache\InvalidArgumentException;
|
use Psr\Cache\InvalidArgumentException;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
@ -41,6 +44,17 @@ class EppClientProvider extends AbstractProvider implements CheckDomainProviderI
|
|||||||
|
|
||||||
$this->eppClient->request(new eppHelloRequest());
|
$this->eppClient->request(new eppHelloRequest());
|
||||||
|
|
||||||
|
$contacts = [];
|
||||||
|
foreach ($this->authData['domain']['contacts'] as $role => $roid) {
|
||||||
|
$contacts[] = new eppContactHandle($roid, $role);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var eppCheckContactResponse $resp */
|
||||||
|
$resp = $this->eppClient->request(new eppCheckContactRequest($contacts));
|
||||||
|
if (in_array(true, $resp->getCheckedContacts())) {
|
||||||
|
throw new BadRequestHttpException('At least one of the contacts entered cannot be used because they are indicated as available.');
|
||||||
|
}
|
||||||
|
|
||||||
$this->eppClient->logout();
|
$this->eppClient->logout();
|
||||||
$this->eppClient->disconnect();
|
$this->eppClient->disconnect();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user