From a368230ba5e4c91e5ff332be22c4a6d8073cac81 Mon Sep 17 00:00:00 2001 From: bamling Date: Tue, 6 Jun 2017 17:23:00 +0200 Subject: [PATCH] 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 --- caddytls/tls.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/caddytls/tls.go b/caddytls/tls.go index f7a08435..396c63a3 100644 --- a/caddytls/tls.go +++ b/caddytls/tls.go @@ -140,9 +140,18 @@ func QualifiesForManagedTLS(c ConfigHolder) bool { (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 // 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. var dnsProviders = make(map[string]DNSProviderConstructor)