Skip to content

Commit a628db5

Browse files
authored
chore: check DNSProvider interface (#2352)
1 parent 5987820 commit a628db5

File tree

144 files changed

+643
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+643
-206
lines changed

providers/dns/acmedns/acmedns.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88

99
"github.com/cpu/goacmedns"
10+
"github.com/go-acme/lego/v4/challenge"
1011
"github.com/go-acme/lego/v4/challenge/dns01"
1112
"github.com/go-acme/lego/v4/platform/config/env"
1213
)
@@ -23,6 +24,8 @@ const (
2324
EnvStoragePath = envNamespace + "STORAGE_PATH"
2425
)
2526

27+
var _ challenge.Provider = (*DNSProvider)(nil)
28+
2629
// acmeDNSClient is an interface describing the goacmedns.Client functions the DNSProvider uses.
2730
// It makes it easier for tests to shim a mock Client into the DNSProvider.
2831
type acmeDNSClient interface {

providers/dns/alidns/alidns.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ import (
1111
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
1212
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
1313
"github.com/aliyun/alibaba-cloud-sdk-go/services/alidns"
14+
"github.com/go-acme/lego/v4/challenge"
1415
"github.com/go-acme/lego/v4/challenge/dns01"
1516
"github.com/go-acme/lego/v4/platform/config/env"
1617
"golang.org/x/net/idna"
1718
)
1819

19-
const defaultRegionID = "cn-hangzhou"
20-
2120
// Environment variables names.
2221
const (
2322
envNamespace = "ALICLOUD_"
@@ -34,6 +33,10 @@ const (
3433
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
3534
)
3635

36+
const defaultRegionID = "cn-hangzhou"
37+
38+
var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
39+
3740
// Config is used to configure the creation of the DNSProvider.
3841
type Config struct {
3942
RAMRole string

providers/dns/allinkl/allinkl.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"sync"
1010
"time"
1111

12+
"github.com/go-acme/lego/v4/challenge"
1213
"github.com/go-acme/lego/v4/challenge/dns01"
1314
"github.com/go-acme/lego/v4/platform/config/env"
1415
"github.com/go-acme/lego/v4/providers/dns/allinkl/internal"
@@ -26,6 +27,8 @@ const (
2627
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
2728
)
2829

30+
var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
31+
2932
// Config is used to configure the creation of the DNSProvider.
3033
type Config struct {
3134
Login string

providers/dns/arvancloud/arvancloud.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ import (
99
"sync"
1010
"time"
1111

12+
"github.com/go-acme/lego/v4/challenge"
1213
"github.com/go-acme/lego/v4/challenge/dns01"
1314
"github.com/go-acme/lego/v4/platform/config/env"
1415
"github.com/go-acme/lego/v4/providers/dns/arvancloud/internal"
1516
)
1617

17-
const minTTL = 600
18-
1918
// Environment variables names.
2019
const (
2120
envNamespace = "ARVANCLOUD_"
@@ -28,6 +27,10 @@ const (
2827
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
2928
)
3029

30+
const minTTL = 600
31+
32+
var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
33+
3134
// Config is used to configure the creation of the DNSProvider.
3235
type Config struct {
3336
APIKey string

providers/dns/auroradns/auroradns.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ import (
77
"sync"
88
"time"
99

10+
"github.com/go-acme/lego/v4/challenge"
1011
"github.com/go-acme/lego/v4/challenge/dns01"
1112
"github.com/go-acme/lego/v4/platform/config/env"
1213
"github.com/nrdcg/auroradns"
1314
)
1415

15-
const defaultBaseURL = "https://api.auroradns.eu"
16-
1716
// Environment variables names.
1817
const (
1918
envNamespace = "AURORA_"
@@ -27,6 +26,10 @@ const (
2726
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
2827
)
2928

29+
const defaultBaseURL = "https://api.auroradns.eu"
30+
31+
var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
32+
3033
// Config is used to configure the creation of the DNSProvider.
3134
type Config struct {
3235
BaseURL string

providers/dns/autodns/autodns.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"net/url"
1010
"time"
1111

12+
"github.com/go-acme/lego/v4/challenge"
1213
"github.com/go-acme/lego/v4/challenge/dns01"
1314
"github.com/go-acme/lego/v4/platform/config/env"
1415
"github.com/go-acme/lego/v4/providers/dns/autodns/internal"
@@ -29,6 +30,8 @@ const (
2930
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
3031
)
3132

33+
var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
34+
3235
// Config is used to configure the creation of the DNSProvider.
3336
type Config struct {
3437
Endpoint *url.URL

providers/dns/azure/azure.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import (
1818
"github.com/go-acme/lego/v4/providers/dns/internal/errutils"
1919
)
2020

21-
const defaultMetadataEndpoint = "http://169.254.169.254"
22-
2321
// Environment variables names.
2422
const (
2523
envNamespace = "AZURE_"
@@ -39,6 +37,10 @@ const (
3937
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
4038
)
4139

40+
const defaultMetadataEndpoint = "http://169.254.169.254"
41+
42+
var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
43+
4244
// Config is used to configure the creation of the DNSProvider.
4345
type Config struct {
4446
ZoneName string

providers/dns/azuredns/azuredns.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const (
5151
EnvGitHubOIDCRequestToken = "ACTIONS_ID_TOKEN_REQUEST_TOKEN"
5252
)
5353

54+
var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
55+
5456
// Config is used to configure the creation of the DNSProvider.
5557
type Config struct {
5658
ZoneName string

providers/dns/azuredns/private.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ import (
1212
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
1313
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
1414
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
15+
"github.com/go-acme/lego/v4/challenge"
1516
"github.com/go-acme/lego/v4/challenge/dns01"
1617
)
1718

19+
var _ challenge.ProviderTimeout = (*DNSProviderPrivate)(nil)
20+
1821
// DNSProviderPrivate implements the challenge.Provider interface for Azure Private Zone DNS.
1922
type DNSProviderPrivate struct {
2023
config *Config

providers/dns/azuredns/public.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ import (
1212
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
1313
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
1414
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
15+
"github.com/go-acme/lego/v4/challenge"
1516
"github.com/go-acme/lego/v4/challenge/dns01"
1617
)
1718

19+
var _ challenge.ProviderTimeout = (*DNSProviderPublic)(nil)
20+
1821
// DNSProviderPublic implements the challenge.Provider interface for Azure Public Zone DNS.
1922
type DNSProviderPublic struct {
2023
config *Config

0 commit comments

Comments
 (0)