Skip to content

Commit

Permalink
chore: update dependencies (#1370)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Mar 10, 2021
1 parent b3be51f commit 773ed46
Show file tree
Hide file tree
Showing 10 changed files with 232 additions and 102 deletions.
2 changes: 1 addition & 1 deletion docs/content/dns/zz_gen_dnspod.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ More information [here](/lego/dns/#configuration-and-credentials).

## More information

- [API documentation](https://www.dnspod.com/docs/index.html)
- [API documentation](https://docs.dnspod.com/api/)
- [Go client](https://github.com/nrdcg/dnspod-go)

<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
Expand Down
37 changes: 18 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,49 @@ go 1.15
require (
cloud.google.com/go v0.54.0
github.com/Azure/azure-sdk-for-go v32.4.0+incompatible
github.com/Azure/go-autorest/autorest v0.5.0
github.com/Azure/go-autorest/autorest v0.9.0
github.com/Azure/go-autorest/autorest/azure/auth v0.1.0
github.com/Azure/go-autorest/autorest/to v0.2.0
github.com/Azure/go-autorest/autorest/validation v0.1.0 // indirect
github.com/BurntSushi/toml v0.3.1
github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87
github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.18
github.com/aliyun/alibaba-cloud-sdk-go v1.61.458
github.com/aws/aws-sdk-go v1.30.20
github.com/cenkalti/backoff/v4 v4.0.2
github.com/cloudflare/cloudflare-go v0.13.2
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.1.0
github.com/aliyun/alibaba-cloud-sdk-go v1.61.976
github.com/aws/aws-sdk-go v1.37.27
github.com/cenkalti/backoff/v4 v4.1.0
github.com/cloudflare/cloudflare-go v0.14.0
github.com/cpu/goacmedns v0.1.1
github.com/dnsimple/dnsimple-go v0.63.0
github.com/exoscale/egoscale v0.23.0
github.com/exoscale/egoscale v1.19.0
github.com/google/go-querystring v1.0.0
github.com/gophercloud/gophercloud v0.16.0
github.com/gophercloud/utils v0.0.0-20210216074907-f6de111f2eae
github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/labbsr0x/bindman-dns-webhook v1.0.2
github.com/linode/linodego v0.21.0
github.com/liquidweb/liquidweb-go v1.6.1
github.com/miekg/dns v1.1.31
github.com/linode/linodego v0.25.3
github.com/liquidweb/liquidweb-go v1.6.3
github.com/miekg/dns v1.1.40
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04
github.com/nrdcg/auroradns v1.0.1
github.com/nrdcg/desec v0.5.0
github.com/nrdcg/dnspod-go v0.4.0
github.com/nrdcg/goinwx v0.8.1
github.com/nrdcg/namesilo v0.2.1
github.com/oracle/oci-go-sdk v24.2.0+incompatible
github.com/oracle/oci-go-sdk v24.3.0+incompatible
github.com/ovh/go-ovh v1.1.0
github.com/pquerna/otp v1.2.0
github.com/pquerna/otp v1.3.0
github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2
github.com/sacloud/libsacloud v1.36.2
github.com/stretchr/testify v1.6.1
github.com/transip/gotransip/v6 v6.2.0
github.com/urfave/cli v1.22.4
github.com/vultr/govultr/v2 v2.0.0
github.com/stretchr/testify v1.7.0
github.com/transip/gotransip/v6 v6.6.0
github.com/urfave/cli v1.22.5
github.com/vultr/govultr/v2 v2.4.0
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/net v0.0.0-20200822124328-c89045814202
golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
google.golang.org/api v0.20.0
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/ns1/ns1-go.v2 v2.4.2
gopkg.in/ns1/ns1-go.v2 v2.4.4
gopkg.in/square/go-jose.v2 v2.5.1
gopkg.in/yaml.v2 v2.4.0
)
246 changes: 191 additions & 55 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions providers/dns/alidns/alidns.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
func (d *DNSProvider) getHostedZone(domain string) (string, error) {
request := alidns.CreateDescribeDomainsRequest()

var domains []alidns.Domain
var domains []alidns.DomainInDescribeDomains
startPage := 1

for {
Expand All @@ -181,7 +181,7 @@ func (d *DNSProvider) getHostedZone(domain string) (string, error) {
return "", err
}

var hostedZone alidns.Domain
var hostedZone alidns.DomainInDescribeDomains
for _, zone := range domains {
if zone.DomainName == dns01.UnFqdn(authZone) || zone.PunyCode == dns01.UnFqdn(authZone) {
hostedZone = zone
Expand Down
13 changes: 7 additions & 6 deletions providers/dns/cloudflare/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cloudflare

import (
"context"
"sync"

"github.com/cloudflare/cloudflare-go"
Expand Down Expand Up @@ -58,16 +59,16 @@ func newClient(config *Config) (*metaClient, error) {
}, nil
}

func (m *metaClient) CreateDNSRecord(zoneID string, rr cloudflare.DNSRecord) (*cloudflare.DNSRecordResponse, error) {
return m.clientEdit.CreateDNSRecord(zoneID, rr)
func (m *metaClient) CreateDNSRecord(ctx context.Context, zoneID string, rr cloudflare.DNSRecord) (*cloudflare.DNSRecordResponse, error) {
return m.clientEdit.CreateDNSRecord(ctx, zoneID, rr)
}

func (m *metaClient) DNSRecords(zoneID string, rr cloudflare.DNSRecord) ([]cloudflare.DNSRecord, error) {
return m.clientEdit.DNSRecords(zoneID, rr)
func (m *metaClient) DNSRecords(ctx context.Context, zoneID string, rr cloudflare.DNSRecord) ([]cloudflare.DNSRecord, error) {
return m.clientEdit.DNSRecords(ctx, zoneID, rr)
}

func (m *metaClient) DeleteDNSRecord(zoneID, recordID string) error {
return m.clientEdit.DeleteDNSRecord(zoneID, recordID)
func (m *metaClient) DeleteDNSRecord(ctx context.Context, zoneID, recordID string) error {
return m.clientEdit.DeleteDNSRecord(ctx, zoneID, recordID)
}

func (m *metaClient) ZoneIDByName(fdqn string) (string, error) {
Expand Down
5 changes: 3 additions & 2 deletions providers/dns/cloudflare/cloudflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package cloudflare

import (
"context"
"errors"
"fmt"
"net/http"
Expand Down Expand Up @@ -140,7 +141,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
TTL: d.config.TTL,
}

response, err := d.client.CreateDNSRecord(zoneID, dnsRecord)
response, err := d.client.CreateDNSRecord(context.Background(), zoneID, dnsRecord)
if err != nil {
return fmt.Errorf("cloudflare: failed to create TXT record: %w", err)
}
Expand Down Expand Up @@ -180,7 +181,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
return fmt.Errorf("cloudflare: unknown record ID for '%s'", fqdn)
}

err = d.client.DeleteDNSRecord(zoneID, recordID)
err = d.client.DeleteDNSRecord(context.Background(), zoneID, recordID)
if err != nil {
log.Printf("cloudflare: failed to delete TXT record: %w", err)
}
Expand Down
9 changes: 4 additions & 5 deletions providers/dns/ionos/internal/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package internal

import (
"context"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -45,7 +44,7 @@ func TestClient_ListZones_error(t *testing.T) {
assert.Nil(t, zones)

var cErr *ClientError
assert.True(t, errors.As(err, &cErr))
assert.ErrorAs(t, err, &cErr)
assert.Equal(t, http.StatusUnauthorized, cErr.StatusCode)
}

Expand Down Expand Up @@ -78,7 +77,7 @@ func TestClient_GetRecords_error(t *testing.T) {
assert.Nil(t, records)

var cErr *ClientError
assert.True(t, errors.As(err, &cErr))
assert.ErrorAs(t, err, &cErr)
assert.Equal(t, http.StatusUnauthorized, cErr.StatusCode)
}

Expand All @@ -100,7 +99,7 @@ func TestClient_RemoveRecord_error(t *testing.T) {
require.Error(t, err)

var cErr *ClientError
assert.True(t, errors.As(err, &cErr))
assert.ErrorAs(t, err, &cErr)
assert.Equal(t, http.StatusInternalServerError, cErr.StatusCode)
}

Expand Down Expand Up @@ -136,7 +135,7 @@ func TestClient_ReplaceRecords_error(t *testing.T) {
require.Error(t, err)

var cErr *ClientError
assert.True(t, errors.As(err, &cErr))
assert.ErrorAs(t, err, &cErr)
assert.Equal(t, http.StatusBadRequest, cErr.StatusCode)
}

Expand Down
4 changes: 2 additions & 2 deletions providers/dns/rfc2136/rfc2136.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Config struct {
// NewDefaultConfig returns a default configuration for the DNSProvider.
func NewDefaultConfig() *Config {
return &Config{
TSIGAlgorithm: env.GetOrDefaultString(EnvTSIGAlgorithm, dns.HmacMD5),
TSIGAlgorithm: env.GetOrDefaultString(EnvTSIGAlgorithm, dns.HmacSHA1),
TTL: env.GetOrDefaultInt(EnvTTL, dns01.DefaultTTL),
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, env.GetOrDefaultSecond("RFC2136_TIMEOUT", 60*time.Second)),
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, 2*time.Second),
Expand Down Expand Up @@ -93,7 +93,7 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
}

if config.TSIGAlgorithm == "" {
config.TSIGAlgorithm = dns.HmacMD5
config.TSIGAlgorithm = dns.HmacSHA1
}

// Append the default DNS port if none is specified.
Expand Down
4 changes: 2 additions & 2 deletions providers/dns/rfc2136/rfc2136_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func serverHandlerReturnSuccess(w dns.ResponseWriter, req *dns.Msg) {
if t := req.IsTsig(); t != nil {
if w.TsigStatus() == nil {
// Validated
m.SetTsig(fakeZone, dns.HmacMD5, 300, time.Now().Unix())
m.SetTsig(fakeZone, dns.HmacSHA1, 300, time.Now().Unix())
}
}

Expand All @@ -239,7 +239,7 @@ func serverHandlerPassBackRequest(reqChan chan *dns.Msg) func(w dns.ResponseWrit
if t := req.IsTsig(); t != nil {
if w.TsigStatus() == nil {
// Validated
m.SetTsig(fakeZone, dns.HmacMD5, 300, time.Now().Unix())
m.SetTsig(fakeZone, dns.HmacSHA1, 300, time.Now().Unix())
}
}

Expand Down
10 changes: 2 additions & 8 deletions providers/dns/transip/transip_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package transip

import (
"errors"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -93,9 +92,7 @@ func TestNewDNSProvider(t *testing.T) {
})

_, err := NewDNSProvider()
if !errors.Is(err, os.ErrNotExist) {
t.Fatalf("Expected an os.ErrNotExists error, actual: %v", err)
}
assert.ErrorIs(t, err, os.ErrNotExist)
})
}

Expand Down Expand Up @@ -154,10 +151,7 @@ func TestNewDNSProviderConfig(t *testing.T) {
config.PrivateKeyPath = "./fixtures/non/existent/private.key"

_, err := NewDNSProviderConfig(config)

if !errors.Is(err, os.ErrNotExist) {
t.Fatalf("Expected an os.ErrNotExists error, actual: %v", err)
}
assert.ErrorIs(t, err, os.ErrNotExist)
})
}

Expand Down

0 comments on commit 773ed46

Please sign in to comment.