security/acme-client: Added support for ZONE DNS API (#2417)

* Added support for ZONE DNS API
This commit is contained in:
manhofmann
2021-07-09 11:23:55 +02:00
committed by GitHub
parent 00bbd32bb8
commit c4ae96d6a5
3 changed files with 68 additions and 0 deletions
@@ -1272,6 +1272,22 @@
<label>API Token</label>
<type>password</type>
</field>
<field>
<label>Zone.eu API</label>
<type>header</type>
<style>table_dns table_dns_zone</style>
</field>
<field>
<id>validation.dns_zone_username</id>
<label>Zone Username</label>
<type>text</type>
</field>
<field>
<id>validation.dns_zone_key</id>
<label>API Key</label>
<type>text</type>
<help>Can be generated under ZoneID account management</help>
</field>
<field>
<label>Nederhost API</label>
<type>header</type>
@@ -0,0 +1,45 @@
<?php
/*
* Copyright (C) 2021 Manuel Hofmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\AcmeClient\LeValidation;
use OPNsense\AcmeClient\LeValidationInterface;
use OPNsense\Core\Config;
/**
* Zone DNS API
* @package OPNsense\AcmeClient
*/
class DnsZone extends Base implements LeValidationInterface
{
public function prepare()
{
$this->acme_env['ZONE_Username'] = (string)$this->config->dns_zone_username;
$this->acme_env['ZONE_Key'] = (string)$this->config->dns_zone_key;
}
}
@@ -439,6 +439,7 @@
<dns_vultr>Vultr API</dns_vultr>
<dns_yandex>Yandex PDD API</dns_yandex>
<dns_zilore>Zilore DNS API</dns_zilore>
<dns_zone>Zone.eu API</dns_zone>
<dns_zonomi>zonomi.com domain API</dns_zonomi>
</OptionValues>
</dns_service>
@@ -965,6 +966,12 @@
<dns_infomaniak_token type="TextField">
<Required>N</Required>
</dns_infomaniak_token>
<dns_zone_username type="TextField">
<Required>N</Required>
</dns_zone_username>
<dns_zone_key type="TextField">
<Required>N</Required>
</dns_zone_key>
</validation>
</validations>
<actions>