2019-03-11 18:56:48 +02:00
|
|
|
package challenge
|
2016-01-15 06:06:25 +02:00
|
|
|
|
2016-03-12 16:58:44 +02:00
|
|
|
import "time"
|
|
|
|
|
2018-12-06 23:50:17 +02:00
|
|
|
// Provider enables implementing a custom challenge
|
2016-03-15 14:46:48 +02:00
|
|
|
// provider. Present presents the solution to a challenge available to
|
|
|
|
// be solved. CleanUp will be called by the challenge if Present ends
|
|
|
|
// in a non-error state.
|
2018-12-06 23:50:17 +02:00
|
|
|
type Provider interface {
|
2016-01-15 06:06:25 +02:00
|
|
|
Present(domain, token, keyAuth string) error
|
|
|
|
CleanUp(domain, token, keyAuth string) error
|
|
|
|
}
|
2016-03-12 16:58:44 +02:00
|
|
|
|
2018-12-06 23:50:17 +02:00
|
|
|
// ProviderTimeout allows for implementing a
|
|
|
|
// Provider where an unusually long timeout is required when
|
2016-03-12 16:58:44 +02:00
|
|
|
// waiting for an ACME challenge to be satisfied, such as when
|
2018-12-06 23:50:17 +02:00
|
|
|
// checking for DNS record propagation. If an implementor of a
|
|
|
|
// Provider provides a Timeout method, then the return values
|
2016-03-12 16:58:44 +02:00
|
|
|
// of the Timeout method will be used when appropriate by the acme
|
|
|
|
// package. The interval value is the time between checks.
|
|
|
|
//
|
|
|
|
// The default values used for timeout and interval are 60 seconds and
|
|
|
|
// 2 seconds respectively. These are used when no Timeout method is
|
2018-12-06 23:50:17 +02:00
|
|
|
// defined for the Provider.
|
|
|
|
type ProviderTimeout interface {
|
|
|
|
Provider
|
2016-03-12 16:58:44 +02:00
|
|
|
Timeout() (timeout, interval time.Duration)
|
|
|
|
}
|