2018-12-10 22:00:34 -05:00
|
|
|
package challenge
|
2017-05-27 14:30:11 -05:00
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
2018-12-10 22:00:34 -05:00
|
|
|
// Provider enables implementing a custom challenge
|
2017-05-27 14:30:11 -05: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-10 22:00:34 -05:00
|
|
|
type Provider interface {
|
2017-05-27 14:30:11 -05:00
|
|
|
Present(domain, token, keyAuth string) error
|
|
|
|
CleanUp(domain, token, keyAuth string) error
|
|
|
|
}
|
|
|
|
|
2018-12-10 22:00:34 -05:00
|
|
|
// ProviderTimeout allows for implementing a
|
|
|
|
// Provider where an unusually long timeout is required when
|
2017-05-27 14:30:11 -05:00
|
|
|
// waiting for an ACME challenge to be satisfied, such as when
|
2018-12-10 22:00:34 -05:00
|
|
|
// checking for DNS record propagation. If an implementor of a
|
|
|
|
// Provider provides a Timeout method, then the return values
|
2017-05-27 14:30:11 -05: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-10 22:00:34 -05:00
|
|
|
// defined for the Provider.
|
|
|
|
type ProviderTimeout interface {
|
|
|
|
Provider
|
2017-05-27 14:30:11 -05:00
|
|
|
Timeout() (timeout, interval time.Duration)
|
|
|
|
}
|