From 3f4b0783293c3c3c9262ea66ec9d65ee1172e5bc Mon Sep 17 00:00:00 2001 From: Simone Carletti Date: Tue, 26 Jan 2016 12:14:10 +0100 Subject: [PATCH] Basic DNSimple implementation for DNSProvider --- acme/dns_challenge_dnsimple.go | 26 ++++++++++++++++++++++++++ acme/dns_challenge_dnsimple_test.go | 13 +++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 acme/dns_challenge_dnsimple.go create mode 100644 acme/dns_challenge_dnsimple_test.go diff --git a/acme/dns_challenge_dnsimple.go b/acme/dns_challenge_dnsimple.go new file mode 100644 index 00000000..4cd862a8 --- /dev/null +++ b/acme/dns_challenge_dnsimple.go @@ -0,0 +1,26 @@ +package acme + +import ( + "github.com/weppos/go-dnsimple/dnsimple" +) + +// DNSProviderDNSimple is an implementation of the DNSProvider interface. +type DNSProviderDNSimple struct { + client *dnsimple.Client +} + +// NewDNSProviderDNSimple returns a DNSProviderDNSimple instance with a configured dnsimple client. +// Authentication is either done using the passed credentials. +func NewDNSProviderDNSimple(dnsimpleEmail, dnsimpleApiKey string) (*DNSProviderDNSimple, error) { + return nil, nil +} + +// Present creates a TXT record to fulfil the dns-01 challenge. +func (c *DNSProviderDNSimple) Present(domain, token, keyAuth string) error { + return nil +} + +// CleanUp removes the TXT record matching the specified parameters. +func (c *DNSProviderDNSimple) CleanUp(domain, token, keyAuth string) error { + return nil +} diff --git a/acme/dns_challenge_dnsimple_test.go b/acme/dns_challenge_dnsimple_test.go new file mode 100644 index 00000000..9e7e4d9b --- /dev/null +++ b/acme/dns_challenge_dnsimple_test.go @@ -0,0 +1,13 @@ +package acme + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + + +func TestNewDNSProviderDNSimpleValid(t *testing.T) { + _, err := NewDNSProviderDNSimple("example@example.com", "123") + assert.NoError(t, err) +}