0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

caddytls: introduced own ChallengeProvider type to fix imports related to vendor (#1700)

* introduced own ChallengeProvider type, based on acme.ChallengeProvider to avoid vendoring/version mismatches in Caddy plugins; see Caddy issue #1697

* fixed up comments for ChallengeProvider

* moved ChallengeProvider to caddytls/tls.go
This commit is contained in:
bamling 2017-06-06 17:23:00 +02:00 committed by Matt Holt
parent 8a058828a3
commit a368230ba5

View file

@ -140,9 +140,18 @@ func QualifiesForManagedTLS(c ConfigHolder) bool {
(HostQualifies(c.Host()) || tlsConfig.OnDemand) (HostQualifies(c.Host()) || tlsConfig.OnDemand)
} }
// ChallengeProvider defines an own type that should be used in Caddy plugins
// over acme.ChallengeProvider. Using acme.ChallengeProvider causes version mismatches
// with vendored dependencies (see https://github.com/mattfarina/golang-broken-vendor)
//
// acme.ChallengeProvider is an interface that allows the implementation of custom
// challenge providers. For more details, see:
// https://godoc.org/github.com/xenolf/lego/acme#ChallengeProvider
type ChallengeProvider acme.ChallengeProvider
// DNSProviderConstructor is a function that takes credentials and // DNSProviderConstructor is a function that takes credentials and
// returns a type that can solve the ACME DNS challenges. // returns a type that can solve the ACME DNS challenges.
type DNSProviderConstructor func(credentials ...string) (acme.ChallengeProvider, error) type DNSProviderConstructor func(credentials ...string) (ChallengeProvider, error)
// dnsProviders is the list of DNS providers that have been plugged in. // dnsProviders is the list of DNS providers that have been plugged in.
var dnsProviders = make(map[string]DNSProviderConstructor) var dnsProviders = make(map[string]DNSProviderConstructor)