1
0
mirror of https://github.com/go-acme/lego.git synced 2024-11-24 16:53:52 +02:00

feat: removes AddPreCheck function.

This commit is contained in:
Fernandez Ludovic 2020-09-02 02:47:48 +02:00 committed by Ludovic Fernandez
parent 53c02b6d5e
commit 1bdab236ea

View File

@ -1,7 +1,6 @@
package dns01
import (
"errors"
"fmt"
"net"
"strings"
@ -24,22 +23,6 @@ func WrapPreCheck(wrap WrapPreCheckFunc) ChallengeOption {
}
}
// AddPreCheck Allow to define checks before notifying ACME that the DNS challenge is ready.
// Deprecated: use WrapPreCheck instead.
func AddPreCheck(preCheck PreCheckFunc) ChallengeOption {
// Prevent race condition
check := preCheck
return func(chlg *Challenge) error {
chlg.preCheck.checkFunc = func(_, fqdn, value string, _ PreCheckFunc) (bool, error) {
if check == nil {
return false, errors.New("invalid preCheck: preCheck is nil")
}
return check(fqdn, value)
}
return nil
}
}
func DisableCompletePropagationRequirement() ChallengeOption {
return func(chlg *Challenge) error {
chlg.preCheck.requireCompletePropagation = false