update to use Tokener func

This commit is contained in:
AJ ONeal 2020-11-16 18:18:36 -07:00
parent e8f2e8205e
commit d66053efd1
2 changed files with 6 additions and 2 deletions

View File

@ -91,7 +91,9 @@ func main() {
// newAPIDNSProvider is for the sake of demoing the tunnel // newAPIDNSProvider is for the sake of demoing the tunnel
func newAPIDNSProvider(baseURL string, token string) (*dns01.DNSProvider, error) { func newAPIDNSProvider(baseURL string, token string) (*dns01.DNSProvider, error) {
config := dns01.NewDefaultConfig() config := dns01.NewDefaultConfig()
config.Token = token config.Tokener = func() string {
return token
}
endpoint, err := url.Parse(baseURL) endpoint, err := url.Parse(baseURL)
if nil != err { if nil != err {
return nil, err return nil, err

View File

@ -310,7 +310,9 @@ func newGoDaddyDNSProvider(id, secret string) (*godaddy.DNSProvider, error) {
// newAPIDNSProvider is for the sake of demoing the tunnel // newAPIDNSProvider is for the sake of demoing the tunnel
func newAPIDNSProvider(baseURL string, token string) (*tbDns01.DNSProvider, error) { func newAPIDNSProvider(baseURL string, token string) (*tbDns01.DNSProvider, error) {
config := tbDns01.NewDefaultConfig() config := tbDns01.NewDefaultConfig()
config.Token = token config.Tokener = func() string {
return token
}
endpoint, err := url.Parse(baseURL) endpoint, err := url.Parse(baseURL)
if nil != err { if nil != err {
return nil, err return nil, err