New provider from dnscontrol: GCORE

This commit is contained in:
nemunaire 2022-11-25 17:13:46 +01:00
parent cac5d1760c
commit 51f9a7447a
5 changed files with 69 additions and 0 deletions

2
go.mod
View File

@ -25,6 +25,7 @@ require (
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect
github.com/G-Core/gcore-dns-sdk-go v0.2.3 // indirect
github.com/PuerkitoBio/goquery v1.8.0 // indirect
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.1 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect
@ -100,6 +101,7 @@ require (
golang.org/x/mod v0.6.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/oauth2 v0.2.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect

3
go.sum
View File

@ -20,6 +20,8 @@ github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcP
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM=
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/G-Core/gcore-dns-sdk-go v0.2.3 h1:WODi+qWlZyF7E7SH8rq/DCACa/Zhsuhu1h0DuFJc2Yg=
github.com/G-Core/gcore-dns-sdk-go v0.2.3/go.mod h1:TM+VaDvBPObF+x085lS3i0kc2OPAkuW2c4Leg7Pe6jI=
github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U=
github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.1 h1:5BIsppVPdWJA29Yb5cYawQYeh5geN413WxAgBZvEtdA=
@ -346,6 +348,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

BIN
providers/GcoreAPI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

63
providers/gcore.go Normal file
View File

@ -0,0 +1,63 @@
// Copyright or © or Copr. happyDNS (2021)
//
// contact@happydomain.org
//
// This software is a computer program whose purpose is to provide a modern
// interface to interact with DNS systems.
//
// This software is governed by the CeCILL license under French law and abiding
// by the rules of distribution of free software. You can use, modify and/or
// redistribute the software under the terms of the CeCILL license as
// circulated by CEA, CNRS and INRIA at the following URL
// "http://www.cecill.info".
//
// As a counterpart to the access to the provider code and rights to copy, modify
// and redistribute granted by the license, users are provided only with a
// limited warranty and the software's author, the holder of the economic
// rights, and the successive licensors have only limited liability.
//
// In this respect, the user's attention is drawn to the risks associated with
// loading, using, modifying and/or developing or reproducing the software by
// the user in light of its specific status of free software, that may mean
// that it is complicated to manipulate, and that also therefore means that it
// is reserved for developers and experienced professionals having in-depth
// computer knowledge. Users are therefore encouraged to load and test the
// software's suitability as regards their requirements in conditions enabling
// the security of their systems and/or data to be ensured and, more generally,
// to use and operate it in the same conditions as regards security.
//
// The fact that you are presently reading this means that you have had
// knowledge of the CeCILL license and that you accept its terms.
package providers // import "happydns.org/providers"
import (
"github.com/StackExchange/dnscontrol/v3/providers"
_ "github.com/StackExchange/dnscontrol/v3/providers/gcore"
"git.happydns.org/happydomain/model"
)
type GcoreAPI struct {
ApiKey string `json:"api_key,omitempty" happydomain:"label=API key,placeholder=xxxxxxxx,required,description=Your GCORE API Token."`
}
func (s *GcoreAPI) NewDNSServiceProvider() (providers.DNSServiceProvider, error) {
config := map[string]string{
"api-key": s.ApiKey,
}
return providers.CreateDNSProvider(s.DNSControlName(), config, nil)
}
func (s *GcoreAPI) DNSControlName() string {
return "GCORE"
}
func init() {
RegisterProvider(func() happydns.Provider {
return &GcoreAPI{}
}, ProviderInfos{
Name: "Gcore",
Description: "Luxembourg cloud provider",
})
}

1
providers/gcore.svg Normal file
View File

@ -0,0 +1 @@
<svg _ngcontent-cqq-c42="" width="119" height="34" viewBox="0 0 119 34" fill="none" xmlns="http://www.w3.org/2000/svg" class="logo-variant-dark"><path _ngcontent-cqq-c42="" fill-rule="evenodd" clip-rule="evenodd" d="M34.899 16.8932C34.899 26.2175 27.3957 33.7764 18.1398 33.7764C14.4012 33.7764 10.9486 32.5433 8.16079 30.4584C8.63795 30.7281 9.13036 30.9728 9.63624 31.1912C11.5536 32.0239 13.6195 32.4539 15.7075 32.4548C19.5964 32.4533 23.3414 30.9734 26.194 28.3107C29.0467 25.6481 30.7966 21.9991 31.0942 18.093C31.1361 17.7249 31.1591 17.355 31.1632 16.9846C31.1632 16.5138 31.1242 15.9666 31.0768 15.4704C31.0724 15.4231 31.071 15.375 31.0695 15.3269C31.0678 15.2714 31.066 15.2158 31.0599 15.1614L31.0465 15.1749C30.9779 14.5278 30.9042 14.0279 30.9042 14.0279H18.742L17.7972 15.8088L15.6255 19.9414H24.8149C24.4749 20.9656 23.9668 21.9252 23.3118 22.7802C22.4187 23.9579 21.268 24.9122 19.9491 25.5689C18.6302 26.2256 17.1787 26.567 15.7075 26.5665C14.5811 26.5643 13.4639 26.3616 12.4075 25.9678C10.5608 25.2878 8.96591 24.0527 7.83876 22.4296C6.71158 20.8066 6.10651 18.874 6.10535 16.8931C6.10535 15.6228 6.35368 14.3649 6.83622 13.1913C7.31877 12.0177 8.02605 10.9513 8.9177 10.053C9.80933 9.15473 10.8679 8.44217 12.0329 7.95603C13.1979 7.46989 14.4465 7.21967 15.7075 7.21964C17.7426 7.21659 19.7256 7.86786 21.3678 9.07867L22.6285 6.70266L24.1297 3.84575C21.6248 2.20037 18.6979 1.32659 15.7075 1.33142C13.0642 1.33227 10.4869 2.01613 8.21098 3.2905C10.99 1.22851 14.4236 0.0100555 18.1398 0.0100555C27.3957 0.0100555 34.899 7.5689 34.899 16.8932Z" fill="#FF5700"></path><path _ngcontent-cqq-c42="" d="M57.8913 20.6204C57.2931 21.3446 56.5404 21.9231 55.6888 22.3128C54.9279 22.6497 54.1045 22.8204 53.2733 22.8136C52.211 22.8326 51.1621 22.573 50.2296 22.0602C50.1959 22.0413 50.1673 22.0172 50.1342 21.9977C49.2991 21.5127 48.611 20.8078 48.1435 19.9588C47.6346 19.0193 47.3768 17.9628 47.3957 16.8927C47.3771 15.8226 47.6349 14.7661 48.1435 13.8266C48.611 12.9777 49.2988 12.2729 50.1339 11.7879C50.1671 11.7683 50.1959 11.7442 50.2296 11.7252C51.1624 11.2128 52.211 10.9532 53.2733 10.9718C54.1051 10.9649 54.9288 11.1339 55.6917 11.4681L57.4214 8.19072C57.4071 8.18427 57.3943 8.17589 57.3798 8.1695C56.0143 7.5903 54.5447 7.30253 53.0635 7.32433C51.428 7.3073 49.8103 7.66861 48.3352 8.38044C48.2116 8.44085 48.0812 8.48713 47.9599 8.55288C46.4824 9.33813 45.2476 10.518 44.3916 11.9632C43.5156 13.4542 43.066 15.1602 43.0928 16.8926C43.066 18.6253 43.5156 20.3316 44.3916 21.823C45.2479 23.2677 46.4824 24.4472 47.9599 25.2324C48.0815 25.2982 48.2116 25.3446 48.3355 25.4052C49.8019 26.1155 51.4103 26.4771 53.0373 26.4619C54.5229 26.4829 55.9969 26.1948 57.367 25.6157C57.3847 25.6079 57.4007 25.5976 57.4185 25.5897C58.6629 25.0475 59.7604 24.2137 60.6201 23.1577L57.8913 20.6204Z" fill="#27333F"></path><path _ngcontent-cqq-c42="" d="M66.8256 25.2191C65.338 24.4325 64.0944 23.2483 63.2312 21.7964C62.3574 20.3138 61.9079 18.6167 61.9323 16.8927C61.9079 15.1688 62.3574 13.4717 63.2312 11.9891C64.0947 10.5376 65.3385 9.35349 66.8256 8.56636C68.4139 7.72419 70.187 7.29716 71.9819 7.32445C73.7724 7.29611 75.5414 7.72328 77.1248 8.56636C78.608 9.35862 79.8504 10.5416 80.7192 11.9891C81.6008 13.4689 82.0553 15.167 82.0311 16.8927C82.0553 18.6184 81.6008 20.3166 80.7192 21.7964C79.851 23.2443 78.6086 24.4274 77.1248 25.2191C75.5417 26.0629 73.7727 26.4904 71.9819 26.462C70.1867 26.4894 68.4139 26.062 66.8256 25.2191ZM74.9205 22.0602C75.7875 21.5659 76.5007 20.8383 76.9805 19.9588C77.489 19.0193 77.7468 17.9628 77.7282 16.8927C77.7468 15.8227 77.489 14.7662 76.9805 13.8266C76.5007 12.9471 75.7875 12.2195 74.9205 11.7252C74.0241 11.2175 73.0101 10.9576 71.9819 10.9718C70.9534 10.9574 69.9394 11.2174 69.043 11.7252C68.1759 12.2194 67.4628 12.947 66.983 13.8266C66.4744 14.7661 66.2166 15.8227 66.2353 16.8927C66.2163 17.9628 66.4741 19.0194 66.983 19.9588C67.4628 20.8384 68.1759 21.5661 69.043 22.0602C69.9394 22.5685 70.9534 22.8285 71.9819 22.8136C73.0101 22.8284 74.0241 22.5684 74.9205 22.0602Z" fill="#27333F"></path><path _ngcontent-cqq-c42="" d="M96.9355 26.1445L93.3932 20.9903H89.4836V26.1445H85.2328V7.64083H93.1831C94.6376 7.60671 96.0824 7.88604 97.4208 8.46017C98.5489 8.94775 99.511 9.75654 100.189 10.7872C100.854 11.8545 101.192 13.0956 101.16 14.3553C101.193 15.613 100.85 16.8517 100.176 17.9109C99.4878 18.9328 98.5157 19.7278 97.3816 20.1968L101.501 26.1445H96.9355ZM95.8593 11.9632C95.0146 11.3522 93.9847 11.0577 92.9471 11.1305H89.4836V17.5801H92.9471C93.9867 17.6531 95.0181 17.3534 95.8593 16.734C96.1945 16.4402 96.4586 16.0731 96.6315 15.6609C96.8043 15.2486 96.8814 14.8021 96.8567 14.3553C96.884 13.9062 96.8081 13.4568 96.6353 13.0419C96.4621 12.6271 96.1968 12.258 95.8593 11.9632Z" fill="#27333F"></path><path _ngcontent-cqq-c42="" d="M118.74 22.7084V26.1445H104.518V7.64085H118.398V11.0779H108.742V15.0953H117.27V18.4262H108.742V22.7084L118.74 22.7084Z" fill="#27333F"></path></svg>

After

Width:  |  Height:  |  Size: 4.8 KiB