Skip to content

Commit c2fd449

Browse files
authored
otc: sequential challenge (#2023)
1 parent b523518 commit c2fd449

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

cmd/zz_gen_cmd_dnshelp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,6 +2030,7 @@ func displayDNSHelp(w io.Writer, name string) error {
20302030
ew.writeln(` - "OTC_HTTP_TIMEOUT": API request timeout`)
20312031
ew.writeln(` - "OTC_POLLING_INTERVAL": Time between DNS propagation check`)
20322032
ew.writeln(` - "OTC_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`)
2033+
ew.writeln(` - "OTC_SEQUENCE_INTERVAL": Time between sequential requests`)
20332034
ew.writeln(` - "OTC_TTL": The TTL of the TXT record used for the DNS challenge`)
20342035

20352036
ew.writeln()

docs/content/dns/zz_gen_otc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ More information [here]({{< ref "dns#configuration-and-credentials" >}}).
5151
| `OTC_HTTP_TIMEOUT` | API request timeout |
5252
| `OTC_POLLING_INTERVAL` | Time between DNS propagation check |
5353
| `OTC_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation |
54+
| `OTC_SEQUENCE_INTERVAL` | Time between sequential requests |
5455
| `OTC_TTL` | The TTL of the TXT record used for the DNS challenge |
5556

5657
The environment variable names can be suffixed by `_FILE` to reference a file instead of a value.

providers/dns/otc/otc.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const (
3333
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
3434
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
3535
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
36+
EnvSequenceInterval = envNamespace + "SEQUENCE_INTERVAL"
3637
)
3738

3839
// Config is used to configure the creation of the DNSProvider.
@@ -44,6 +45,7 @@ type Config struct {
4445
Password string
4546
PropagationTimeout time.Duration
4647
PollingInterval time.Duration
48+
SequenceInterval time.Duration
4749
TTL int
4850
HTTPClient *http.Client
4951
}
@@ -55,6 +57,7 @@ func NewDefaultConfig() *Config {
5557
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
5658
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
5759
IdentityEndpoint: env.GetOrDefaultString(EnvIdentityEndpoint, defaultIdentityEndpoint),
60+
SequenceInterval: env.GetOrDefaultSecond(EnvSequenceInterval, dns01.DefaultPropagationTimeout),
5861
HTTPClient: &http.Client{
5962
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 10*time.Second),
6063
Transport: &http.Transport{
@@ -202,3 +205,9 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
202205
func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
203206
return d.config.PropagationTimeout, d.config.PollingInterval
204207
}
208+
209+
// Sequential All DNS challenges for this provider will be resolved sequentially.
210+
// Returns the interval between each iteration.
211+
func (d *DNSProvider) Sequential() time.Duration {
212+
return d.config.SequenceInterval
213+
}

providers/dns/otc/otc.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Example = ''''''
1616
[Configuration.Additional]
1717
OTC_POLLING_INTERVAL = "Time between DNS propagation check"
1818
OTC_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
19+
OTC_SEQUENCE_INTERVAL = "Time between sequential requests"
1920
OTC_TTL = "The TTL of the TXT record used for the DNS challenge"
2021
OTC_HTTP_TIMEOUT = "API request timeout"
2122

0 commit comments

Comments
 (0)