*/ 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:----eQIu01UNU4AIK8/bZe2BvPP3SUMLTHUbUcpbKv2bzf9qeusir9K5NO3kUZdBRg0I+VkU0cZlXlICkWDXN687Kd/6frmfZxDcmdbw7kD3zCx/1gZTFDgYxHfQR6ieKSOzmxfh2AnFlQFlXHD1pYU73X2VCLLyKAoB9HmlYP9QWmm35s0J6rEisTEuEOk68gRLnofjvUrXapo0lVYz3PLYspheWs61gdL0OLsGMWQW9FUVGcGqKwIRPCOwluepiNR1Bktw+NeQ5QGp+ZKptCrPD3cDL8djcS9LYg0SZLAlt/3MFTy7kzqGi5UkDyjZmiNJ2KcfzLs7JQaYxKL7DyJ6tkElUXdEQBRiM+oPqw9Hx9tJ4FG9NJbKF9sQviAVUoVUfY2sBFTRi7oS1T3dKMRq2O60S33EJhmjmLGMiNbSrL87kNk5m0GdwrdXufyQrp4IZJkdpV1srnjVHc26EhKtm/qyi3jWV/0ZA2V9qaGv8nSduCSi9dPvaCxWk4fm/35xDQ60lSeOOp+MCBoUzWhDslGzisY5SY3Da3nwUokPY5HsvCR8IY9bga8Tp+eJIG1qKzyhRKaKG6JdkBQPsm5L8j+Q3se0NLRbbBUY4yNlrFUVWPoDRIqd1JqpmdvtecYWQxndneUFdV1+8nOxh97I8S0u9Ol4K2eUDvBFl56vDUU=----ATTACHMENT:----NDc4MDgyNjE4NTc0MzU3OCA1MDIzNDIwMjAyOTAzODA4IDk0OTQ3NjUyNTc2MjU4NTI=