security/acme-client: add support for hexonet.com DNS API, closes #2134

This commit is contained in:
Frank Wall
2020-12-13 13:20:16 +01:00
parent 9c25ef44a5
commit 7bae0539c4
4 changed files with 71 additions and 0 deletions
+3
View File
@@ -10,6 +10,9 @@ Plugin Changelog
2.2
Added:
* add support for hexonet.com DNS API (#2134)
Fixed:
* fix DNS challenge alias mode (#2128, #2130)
@@ -1221,4 +1221,20 @@
<label>deSEC domain</label>
<type>text</type>
</field>
<field>
<label>hexonet.com DNS API</label>
<type>header</type>
<style>table_dns table_dns_hexonet</style>
</field>
<field>
<id>validation.dns_hexonet_login</id>
<label>Login</label>
<type>text</type>
<help>This should be a combination of the username and role ID. For example, when the username is "myuser" and role ID is "testrole", then "myuser!testrole" must be used here.</help>
</field>
<field>
<id>validation.dns_hexonet_password</id>
<label>Password</label>
<type>password</type>
</field>
</form>
@@ -0,0 +1,45 @@
<?php
/*
* Copyright (C) 2020 Frank Wall
* 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;
/**
* Hexonet DNS API
* @package OPNsense\AcmeClient
*/
class DnsHexonet extends Base implements LeValidationInterface
{
public function prepare()
{
$this->acme_env['Hexonet_Login'] = (string)$this->config->dns_hexonet_login;
$this->acme_env['Hexonet_Password'] = (string)$this->config->dns_hexonet_password;
}
}
@@ -401,6 +401,7 @@
<dns_gcloud>Google Cloud DNS API</dns_gcloud>
<dns_gdnsdk>GratisDNS.dk</dns_gdnsdk>
<dns_hetzner>Hetzner DNS API</dns_hetzner>
<dns_hexonet>hexonet.com DNS API</dns_hexonet>
<dns_hostingde>hosting.de API</dns_hostingde>
<dns_he>Hurricane Electric</dns_he>
<dns_infoblox>Infoblox API</dns_infoblox>
@@ -917,6 +918,12 @@
<dns_hetzner_token type="TextField">
<Required>N</Required>
</dns_hetzner_token>
<dns_hexonet_login type="TextField">
<Required>N</Required>
</dns_hexonet_login>
<dns_hexonet_password type="TextField">
<Required>N</Required>
</dns_hexonet_password>
<dns_1984hosting_user type="TextField">
<Required>N</Required>
</dns_1984hosting_user>