security/acme-client: add support for Infomaniak domain API, closes #2169

This commit is contained in:
Frank Wall
2021-01-24 21:56:12 +01:00
parent bee2422787
commit 4850414eba
4 changed files with 61 additions and 0 deletions
+3
View File
@@ -10,6 +10,9 @@ Plugin Changelog
2.3
Added:
* add support for Infomaniak domain API (#2169)
Fixed:
* fix "auto renewal" options not working in certificate and plugin settings (#2178)
@@ -1237,4 +1237,14 @@
<label>Password</label>
<type>password</type>
</field>
<field>
<label>Infomaniak DNS API</label>
<type>header</type>
<style>table_dns table_dns_infomaniak</style>
</field>
<field>
<id>validation.dns_infomaniak_token</id>
<label>API Token</label>
<type>password</type>
</field>
</form>
@@ -0,0 +1,44 @@
<?php
/*
* Copyright (C) 2021 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;
/**
* Infomaniak DNS API
* @package OPNsense\AcmeClient
*/
class DnsInfomaniak extends Base implements LeValidationInterface
{
public function prepare()
{
$this->acme_env['INFOMANIAK_API_TOKEN'] = (string)$this->config->dns_infomaniak_token;
}
}
@@ -405,6 +405,7 @@
<dns_hostingde>hosting.de API</dns_hostingde>
<dns_he>Hurricane Electric</dns_he>
<dns_infoblox>Infoblox API</dns_infoblox>
<dns_infomaniak>Infomaniak API</dns_infomaniak>
<dns_inwx>INWX XMLRPC API</dns_inwx>
<dns_ispconfig>ISPConfig 3.1+ API</dns_ispconfig>
<dns_joker>Joker API</dns_joker>
@@ -949,6 +950,9 @@
<dns_desec_name type="TextField">
<Required>N</Required>
</dns_desec_name>
<dns_infomaniak_token type="TextField">
<Required>N</Required>
</dns_infomaniak_token>
</validation>
</validations>
<actions>