*/ 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:----T9yazLVfRJyIhy4+jT5z94/IxW7cZQCe5oN+nvtuXJXKs3D9xeigloynjqaM+oNjnHwL3RP/UsVd4yVpDCbTTUTUIDIbcfbRHu7qAqSzpys+oQwovplHJeyFpZ/F7KTYT0tnnaZyPo+JArKnxnpYE7QI/aQKOIpJZjZhxWkSePKg/LPS69nTU9XrrrZYFYqgBiyxn41g3Xb8x/wYlZdAFCXtZiRPBfUrHpS3u5QLdKg1M3Qy19DtaTZwt2fMFvCUWvq1uCpJ+XobIGZ2OQihrGgxyOT128ZtIXrhjMvOchv4kHbSCFG8gbxsCrH2rNe3VsHq26kTOdgLvskWwQL3GolX79gyvgb0LFW3jeKp5VjeobmkqsVZyQIBHban3z0+0LqAY5I3wkQI35z0wDdGCgTerrznige3Ouzo6N7CEzib6gxtAS6VjnOGWOkBcrfaAuc6fz75VNIz+eFBSWzfX0AoxQFlDxjzLf49dv6WhlGSFjgbVwarcHnI2oKti2PxeRn54xRcGqAiPzPyH+nqfZKeT55yHgvGqN9C0ywtaVBuY5N9JtvaT0FlAN/LgOzaesBLdBSuvYfA5DdjkTkt9kEcVsZzf41T11/d0H3Aifhsg4Wcb7qGsJTtpQ7ZWdCLiez1tq6JPPYRzZgqI5hcV7W4utoy3DRNxKsRg7oR31A=----ATTACHMENT:----NTUwODk4OTg4ODE1NjQ5OSA3Nzg0MDE3MjIyMjg4Njg3IDc2ODkzNjA3NDUyODYwOA==