2019-03-11 15:54:35 +00:00
|
|
|
package challenge // import "github.com/xenolf/lego/challenge"
|
2016-01-15 04:06:25 +00:00
|
|
|
|
2016-03-12 14:58:44 +00:00
|
|
|
import "time"
|
|
|
|
|
2018-12-06 21:50:17 +00:00
|
|
|
// Provider enables implementing a custom challenge
|
2016-03-15 12:46:48 +00: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 21:50:17 +00:00
|
|
|
type Provider interface {
|
2016-01-15 04:06:25 +00:00
|
|
|
Present(domain, token, keyAuth string) error
|
|
|
|
CleanUp(domain, token, keyAuth string) error
|
|
|
|
}
|
2016-03-12 14:58:44 +00:00
|
|
|
|
2018-12-06 21:50:17 +00:00
|
|
|
// ProviderTimeout allows for implementing a
|
|
|
|
// Provider where an unusually long timeout is required when
|
2016-03-12 14:58:44 +00:00
|
|
|
// waiting for an ACME challenge to be satisfied, such as when
|
2018-12-06 21:50:17 +00:00
|
|
|
// checking for DNS record propagation. If an implementor of a
|
|
|
|
// Provider provides a Timeout method, then the return values
|
2016-03-12 14:58:44 +00: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 21:50:17 +00:00
|
|
|
// defined for the Provider.
|
|
|
|
type ProviderTimeout interface {
|
|
|
|
Provider
|
2016-03-12 14:58:44 +00:00
|
|
|
Timeout() (timeout, interval time.Duration)
|
|
|
|
}
|