diff --git a/src/MessageHandler/UpdateDomainHandler.php b/src/MessageHandler/UpdateDomainHandler.php index 277afe5..aa4e70c 100644 --- a/src/MessageHandler/UpdateDomainHandler.php +++ b/src/MessageHandler/UpdateDomainHandler.php @@ -2,6 +2,7 @@ namespace App\MessageHandler; +use App\Entity\Domain; use App\Entity\RdapServer; use App\Entity\Watchlist; use App\Exception\DomainNotFoundException; @@ -23,6 +24,7 @@ use Symfony\Component\Mailer\Exception\TransportExceptionInterface; use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Messenger\Attribute\AsMessageHandler; use Symfony\Component\Messenger\Exception\ExceptionInterface; +use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Messenger\Stamp\TransportNamesStamp; use Symfony\Component\Mime\Address; @@ -61,7 +63,6 @@ final readonly class UpdateDomainHandler * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface * @throws UnsupportedDsnSchemeException * @throws ServerExceptionInterface - * @throws MalformedDomainException * @throws ExceptionInterface * @throws \Exception */ @@ -78,7 +79,7 @@ final readonly class UpdateDomainHandler } if (null === $domain) { - $this->RDAPService->registerDomain($message->ldhName); + $this->registerDomain($message->ldhName); return; } @@ -122,7 +123,7 @@ final readonly class UpdateDomainHandler * Domain name update * We send messages that correspond to the sending of notifications that will not be processed here. */ - $this->RDAPService->registerDomain($domain->getLdhName()); + $this->registerDomain($domain->getLdhName()); /** @var Watchlist $wl */ foreach ($domain->getWatchlists()->getIterator() as $wl) { @@ -150,4 +151,27 @@ final readonly class UpdateDomainHandler */ } } + + /** + * @throws OptimisticLockException + * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface + * @throws ServerExceptionInterface + * @throws RedirectionExceptionInterface + * @throws DecodingExceptionInterface + * @throws ClientExceptionInterface + */ + private function registerDomain(string $ldhName): void + { + try { + $this->RDAPService->registerDomain($ldhName); + } catch ( + DomainNotFoundException| + TldNotSupportedException| + MalformedDomainException| + UnknownRdapServerException + $exception + ) { + throw new UnrecoverableMessageHandlingException($exception->getMessage(), 0, $exception); + } + } } diff --git a/src/State/FindDomainCollectionFromEntityProvider.php b/src/State/FindDomainCollectionFromEntityProvider.php index a954a5c..fcb2d49 100644 --- a/src/State/FindDomainCollectionFromEntityProvider.php +++ b/src/State/FindDomainCollectionFromEntityProvider.php @@ -45,13 +45,13 @@ FROM ( FROM entity e ) sub JOIN domain_entity de ON de.entity_uid = sub.id -WHERE LOWER(org||fn) NOT LIKE '%redacted%' - AND LOWER(org||fn) NOT LIKE '%privacy%' +WHERE LOWER(org||fn) NOT LIKE '%redacted for privacy%' + AND LOWER(org||fn) NOT LIKE '%data protected%' AND LOWER(org||fn) NOT LIKE '%registration private%' AND LOWER(org||fn) NOT LIKE '%domain administrator%' AND LOWER(org||fn) NOT LIKE '%registry super user account%' - AND LOWER(org||fn) NOT LIKE '%ano nymous%' - AND LOWER(org||fn) NOT LIKE '%by proxy%' + AND LOWER(org||fn) not like '%ano nymous%' + AND LOWER(org||fn) not in ('na', 'n/a', '-', 'none', 'not applicable') AND handle NOT IN ($handleBlacklist) AND de.roles @> '["registrant"]' AND sub.tld_id IS NOT NULL