security/acme-client: Add nic API dns challenge type (#3684)

This commit is contained in:
Mihail
2024-01-11 00:24:09 +01:00
committed by GitHub
parent 192b9fa185
commit 7f8612f800
3 changed files with 86 additions and 1 deletions
@@ -1662,6 +1662,31 @@
<label>Password</label>
<type>password</type>
</field>
<field>
<label>nic.ru</label>
<type>header</type>
<style>table_dns table_dns_nic</style>
</field>
<field>
<id>validation.dns_nic_username</id>
<label>User</label>
<type>text</type>
</field>
<field>
<id>validation.dns_nic_password</id>
<label>Password</label>
<type>password</type>
</field>
<field>
<id>validation.dns_nic_client</id>
<label>ClientId</label>
<type>text</type>
</field>
<field>
<id>validation.dns_nic_secret</id>
<label>ClientSecret</label>
<type>password</type>
</field>
<field>
<label>World4You</label>
<type>header</type>
@@ -1677,4 +1702,4 @@
<label>Password</label>
<type>password</type>
</field>
</form>
</form>
@@ -0,0 +1,47 @@
<?php
/*
* Copyright (C) 2023 Mikhail Kharisov
* 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;
/**
* Nic DNS API
* @package OPNsense\AcmeClient
*/
class DnsNic extends Base implements LeValidationInterface
{
public function prepare()
{
$this->acme_env['NIC_Username'] = (string)$this->config->dns_nic_username;
$this->acme_env['NIC_Password'] = (string)$this->config->dns_nic_password;
$this->acme_env['NIC_ClientID'] = (string)$this->config->dns_nic_client;
$this->acme_env['NIC_ClientSecret'] = (string)$this->config->dns_nic_secret;
}
}
@@ -488,6 +488,7 @@
<dns_namesilo>Namesilo.com</dns_namesilo>
<dns_nederhost>Nederhost</dns_nederhost>
<dns_netcup>netcup</dns_netcup>
<dns_nic>nic.ru</dns_nic>
<dns_njalla>Njalla</dns_njalla>
<dns_nsone>NS1.com</dns_nsone>
<dns_nsupdate>nsupdate (RFC 2136)</dns_nsupdate>
@@ -1176,6 +1177,18 @@
<dns_regru_password type="TextField">
<Required>N</Required>
</dns_regru_password>
<dns_nic_username type="TextField">
<Required>N</Required>
</dns_nic_username>
<dns_nic_password type="TextField">
<Required>N</Required>
</dns_nic_password>
<dns_nic_client type="TextField">
<Required>N</Required>
</dns_nic_client>
<dns_nic_secret type="TextField">
<Required>N</Required>
</dns_nic_secret>
<dns_world4you_username type="TextField">
<Required>N</Required>
</dns_world4you_username>