*/ 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:----AA817EDeAtidM6zMK066LN6ZPxFbNtogNao3HAcNf05AmTF8kN1gcPSExCZAWil+1YJDvL66DBo2rd3fQdpkXhrKGVLt7IOUWYhgGswwUuQ9wyt7xM5+Hx4v4M7bXSdM0MwuolzZWhiFHY3yXuRxG5nmCpbZoNY60u7Jt6i008ez8quTP7l5AQXLBFGyaYGntq5ImBbYnidOh7CKwc+MIfHze1i/OUvCE4hN8TNv0b8fKy48NJhj+BT7oBoS7Pi0Hwf++4kEzczFjFcQWaCHPdOZHA1w+FSYnSdkoImZqCri44anWBOT94B6UX3uxrBGXLV4gqmdBWlvcf45qKbOylR3xQZhSgFUp1K+z2/6XFQbK1mWPPWMbHmwClLjtLjWAS/j8iVSQzJAhqIMLeBNMHXlyzzgXLfo8m7g8crNVEl/8w7QxXLKsmK9vNPs+RDgcP0W4xVBQyjv921KJyPKoanh8dNX6Ov8JGgVPGLqzFmDb12y0oseglzoTUAzBQyap1mN7nK41ZNIInzk59BPH1zLLV9a2c9nOPMXJXXqVFOOwnzWsimNu+iBsoM1KJN8sJE/uq8J/763gr+3JlUa+tlX56f8rAInMOH+Cdzj5iz2YLEy/eD381L5SP3PuRfl21br+wJzkXgxjM0yvhdyn9CnYWh1i32gV0EUDU+2ZO4=----ATTACHMENT:----MTI0ODIwMjQwODUxMDc0MiA3MTc2NzY1MTIwNjQ3NDk4IDM2MTMwNDM4NTEzOTIzMzY=