Skip to content
/ lego Public
forked from go-acme/lego

Commit

Permalink
wip: try a sequential approach
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Aug 28, 2024
1 parent 41d305f commit 82d8cca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions providers/dns/limacity/limacity.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
EnvSequenceInterval = envNamespace + "SEQUENCE_INTERVAL"
)

// Config is used to configure the creation of the DNSProvider.
Expand All @@ -34,6 +35,7 @@ type Config struct {
TTL int
PropagationTimeout time.Duration
PollingInterval time.Duration
SequenceInterval time.Duration
HTTPClient *http.Client
}

Expand All @@ -43,6 +45,7 @@ func NewDefaultConfig() *Config {
TTL: env.GetOrDefaultInt(EnvTTL, 60),
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 3*time.Minute),
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
SequenceInterval: env.GetOrDefaultSecond(EnvSequenceInterval, dns01.DefaultPropagationTimeout),
HTTPClient: &http.Client{
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
},
Expand Down Expand Up @@ -97,6 +100,12 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
return d.config.PropagationTimeout, d.config.PollingInterval
}

// Sequential All DNS challenges for this provider will be resolved sequentially.
// Returns the interval between each iteration.
func (d *DNSProvider) Sequential() time.Duration {
return d.config.SequenceInterval
}

// Present creates a TXT record to fulfill the dns-01 challenge.
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
info := dns01.GetChallengeInfo(domain, keyAuth)
Expand Down

0 comments on commit 82d8cca

Please sign in to comment.