Skip to content

chore: check DNSProvider interface #2352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions providers/dns/acmedns/acmedns.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"

"github.com/cpu/goacmedns"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
)
Expand All @@ -23,6 +24,8 @@ const (
EnvStoragePath = envNamespace + "STORAGE_PATH"
)

var _ challenge.Provider = (*DNSProvider)(nil)

// acmeDNSClient is an interface describing the goacmedns.Client functions the DNSProvider uses.
// It makes it easier for tests to shim a mock Client into the DNSProvider.
type acmeDNSClient interface {
Expand Down
7 changes: 5 additions & 2 deletions providers/dns/alidns/alidns.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/services/alidns"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"golang.org/x/net/idna"
)

const defaultRegionID = "cn-hangzhou"

// Environment variables names.
const (
envNamespace = "ALICLOUD_"
Expand All @@ -34,6 +33,10 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

const defaultRegionID = "cn-hangzhou"

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
RAMRole string
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/allinkl/allinkl.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"sync"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/go-acme/lego/v4/providers/dns/allinkl/internal"
Expand All @@ -26,6 +27,8 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
Login string
Expand Down
7 changes: 5 additions & 2 deletions providers/dns/arvancloud/arvancloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import (
"sync"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/go-acme/lego/v4/providers/dns/arvancloud/internal"
)

const minTTL = 600

// Environment variables names.
const (
envNamespace = "ARVANCLOUD_"
Expand All @@ -28,6 +27,10 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

const minTTL = 600

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
APIKey string
Expand Down
7 changes: 5 additions & 2 deletions providers/dns/auroradns/auroradns.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"sync"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/nrdcg/auroradns"
)

const defaultBaseURL = "https://api.auroradns.eu"

// Environment variables names.
const (
envNamespace = "AURORA_"
Expand All @@ -27,6 +26,10 @@ const (
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
)

const defaultBaseURL = "https://api.auroradns.eu"

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
BaseURL string
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/autodns/autodns.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/url"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/go-acme/lego/v4/providers/dns/autodns/internal"
Expand All @@ -29,6 +30,8 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
Endpoint *url.URL
Expand Down
6 changes: 4 additions & 2 deletions providers/dns/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"github.com/go-acme/lego/v4/providers/dns/internal/errutils"
)

const defaultMetadataEndpoint = "http://169.254.169.254"

// Environment variables names.
const (
envNamespace = "AZURE_"
Expand All @@ -39,6 +37,10 @@ const (
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
)

const defaultMetadataEndpoint = "http://169.254.169.254"

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
ZoneName string
Expand Down
2 changes: 2 additions & 0 deletions providers/dns/azuredns/azuredns.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const (
EnvGitHubOIDCRequestToken = "ACTIONS_ID_TOKEN_REQUEST_TOKEN"
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
ZoneName string
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/azuredns/private.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
)

var _ challenge.ProviderTimeout = (*DNSProviderPrivate)(nil)

// DNSProviderPrivate implements the challenge.Provider interface for Azure Private Zone DNS.
type DNSProviderPrivate struct {
config *Config
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/azuredns/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
)

var _ challenge.ProviderTimeout = (*DNSProviderPublic)(nil)

// DNSProviderPublic implements the challenge.Provider interface for Azure Public Zone DNS.
type DNSProviderPublic struct {
config *Config
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/bindman/bindman.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/labbsr0x/bindman-dns-webhook/src/client"
Expand All @@ -23,6 +24,8 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
PropagationTimeout time.Duration
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/bluecat/bluecat.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/log"
"github.com/go-acme/lego/v4/platform/config/env"
Expand All @@ -32,6 +33,8 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
BaseURL string
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/brandit/brandit.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"sync"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/go-acme/lego/v4/providers/dns/brandit/internal"
Expand All @@ -27,6 +28,8 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
APIKey string
Expand Down
7 changes: 5 additions & 2 deletions providers/dns/bunny/bunny.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"fmt"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/nrdcg/bunny-go"
)

const minTTL = 60

// Environment variables names.
const (
envNamespace = "BUNNY_"
Expand All @@ -25,6 +24,10 @@ const (
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
)

const minTTL = 60

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
APIKey string
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/checkdomain/checkdomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/url"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/go-acme/lego/v4/providers/dns/checkdomain/internal"
Expand All @@ -27,6 +28,8 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
Endpoint *url.URL
Expand Down
15 changes: 9 additions & 6 deletions providers/dns/civo/civo.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ import (
"time"

"github.com/civo/civogo"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
)

const (
minTTL = 600
defaultPollingInterval = 30 * time.Second
defaultPropagationTimeout = 300 * time.Second
)

// Environment variables names.
const (
envNamespace = "CIVO_"
Expand All @@ -28,6 +23,14 @@ const (
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
)

const (
minTTL = 600
defaultPollingInterval = 30 * time.Second
defaultPropagationTimeout = 300 * time.Second
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the creation of the DNSProvider.
type Config struct {
ProjectID string
Expand Down
3 changes: 3 additions & 0 deletions providers/dns/clouddns/clouddns.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"time"

"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/go-acme/lego/v4/providers/dns/clouddns/internal"
Expand All @@ -27,6 +28,8 @@ const (
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)

var _ challenge.ProviderTimeout = (*DNSProvider)(nil)

// Config is used to configure the DNSProvider.
type Config struct {
ClientID string
Expand Down
Loading