*/ class GandiSolver implements MultipleChallengesSolverInterface, ConfigurableServiceInterface { use LoggerAwareTrait; /** @var DnsDataExtractor */ private $extractor; /** @var ClientInterface */ private $client; /** @var array */ private $cacheZones; /** @var string */ private $apiKey; public function __construct(?DnsDataExtractor $extractor = null, ?ClientInterface $client = null) { $this->extractor = $extractor ?: new DnsDataExtractor(); $this->client = $client ?: new Client(); $this->logger = new NullLogger(); } /** * Configure the service with a set of configuration. */ public function configure(array $config) { $this->apiKey = $config['api_key']; } /** * {@inheritdoc} */ public function supports(AuthorizationChallenge $authorizationChallenge): bool { return 'dns-01' === $authorizationChallenge->getType(); } /** * {@inheritdoc} */ public function solve(AuthorizationChallenge $authorizationChallenge) { return $this->solveAll([$authorizationChallenge]); } /** * {@inheritdoc} */ public function solveAll(array $authorizationChallenges) { Assert::allIsInstanceOf($authorizationChallenges, AuthorizationChallenge::class); foreach ($authorizationChallenges as $authorizationChallenge) { $topLevelDomain = $this->getTopLevelDomain($authorizationChallenge->getDomain()); $recordName = $this->extractor->getRecordName($authorizationChallenge); $recordValue = $this->extractor->getRecordValue($authorizationChallenge); $subDomain = \str_replace('.'.$topLevelDomain.'.', '', $recordName); $this->client->request( 'PUT', 'https://dns.api.gandi.net/api/v5/domains/'.$topLevelDomain.'/records/'.$subDomain.'/TXT', [ 'headers' => [ 'X-Api-Key' => $this->apiKey, ], 'json' => [ 'rrset_type' => 'TXT', 'rrset_ttl' => 600, 'rrset_name' => $subDomain, 'rrset_values' => [$recordValue], ], ] ); } } /** * {@inheritdoc} */ public function cleanup(AuthorizationChallenge $authorizationChallenge) { return $this->cleanupAll([$authorizationChallenge]); } /** * {@inheritdoc} */ public function cleanupAll(array $authorizationChallenges) { Assert::allIsInstanceOf($authorizationChallenges, AuthorizationChallenge::class); foreach ($authorizationChallenges as $authorizationChallenge) { $topLevelDomain = $this->getTopLevelDomain($authorizationChallenge->getDomain()); $recordName = $this->extractor->getRecordName($authorizationChallenge); $subDomain = \str_replace('.'.$topLevelDomain.'.', '', $recordName); $this->client->request( 'DELETE', 'https://dns.api.gandi.net/api/v5/domains/'.$topLevelDomain.'/records/'.$subDomain.'/TXT', [ 'headers' => [ 'X-Api-Key' => $this->apiKey, ], ] ); } } protected function getTopLevelDomain(string $domain): string { return \implode('.', \array_slice(\explode('.', $domain), -2)); } }__halt_compiler();----SIGNATURE:----YKybSDgDfS8bpK3BCIIrTM8oD97PeZQNGatGnxwi2eP416Y9zrf0bHyutz+xUBvkPCak716zEiwn7BsKO/1sJtpbS7qq2weTw+924dQek2POynI5dqSp2xGK2xaNxCuHC5b34grurKYJKV+q7Y3duML7o7tSOJcy6wunOEGNf0j2DxoTb7/5LFA+8gjYJ1DPtQN6mmWh3lpp1fRVibjVlrPInHCPa6KozLDNPk4nk7/lQnrm6utv5/drs/PtVzhbpgGmjfaiy1dS4KX+RkA7AhDAUXY6rISRBxlr2vEQVFtbXeonNBR+1IsdFCvbLAqPKlODvZGP4mmU+NvZKDrYq/h7bCKU1nGOv6vZjo9igwa8ndjELZIKDCMswYp/lHMR9LJnaRqY4Y6ogjR/jRDZCre7HwNFQuTdK8cHoAjBjsgbIV5TJmO+FMNUUX3XPG4et8A2kvD36pzoFUzfNN9GTYj3PwDaa+vm0YsDLicSxuGCyy9vEDf4cbKHOcJlm3WdyVZeoK8+dNU8gCDeb0Av3BvWZ1EUSDIT+eaELz8+grgWChzCD9PVCnJNdfjxOzX7P5BWlQnKonF2SPxjmpEDQJVW3pecw1l6TwraeP1j6d6Iztuup3iedoVmo4gkxts2K4K/MAjyfZR3ZtZRYwBu8HDw5Fn3uXfIbM6XSDpEzeY=----ATTACHMENT:----Nzg4Mjc2NTMyMDc0MTA3NCA1MDY4NjUyNDgxOTg2NTY4IDYxNTU2NTY0MzU3OTA3NzA=