forked from TrueCloudLab/lego
Merge pull request #164 from xi2/unexport-gandi-endpoint
Gandi DNS: Unexport Endpoint variable
This commit is contained in:
commit
c006c65436
2 changed files with 6 additions and 8 deletions
|
@ -179,10 +179,8 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
|
||||||
return 40 * time.Minute, 60 * time.Second
|
return 40 * time.Minute, 60 * time.Second
|
||||||
}
|
}
|
||||||
|
|
||||||
// Endpoint is the Gandi XML-RPC endpoint used by Present and
|
// endpoint is the Gandi XML-RPC endpoint used by Present and CleanUp.
|
||||||
// CleanUp. It is exported only so it may be overridden during package
|
var endpoint = "https://rpc.gandi.net/xmlrpc/"
|
||||||
// tests.
|
|
||||||
var Endpoint = "https://rpc.gandi.net/xmlrpc/"
|
|
||||||
|
|
||||||
// types for XML-RPC method calls and parameters
|
// types for XML-RPC method calls and parameters
|
||||||
|
|
||||||
|
@ -297,7 +295,7 @@ func rpcCall(call *methodCall, resp response) error {
|
||||||
}
|
}
|
||||||
// post
|
// post
|
||||||
b = append([]byte(`<?xml version="1.0"?>`+"\n"), b...)
|
b = append([]byte(`<?xml version="1.0"?>`+"\n"), b...)
|
||||||
respBody, err := httpPost(Endpoint, "text/xml", bytes.NewReader(b))
|
respBody, err := httpPost(endpoint, "text/xml", bytes.NewReader(b))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,11 +45,11 @@ func TestDNSProvider(t *testing.T) {
|
||||||
}))
|
}))
|
||||||
defer fakeServer.Close()
|
defer fakeServer.Close()
|
||||||
// override gandi endpoint to point to fake server
|
// override gandi endpoint to point to fake server
|
||||||
savedEndpoint := Endpoint
|
savedEndpoint := endpoint
|
||||||
defer func() {
|
defer func() {
|
||||||
Endpoint = savedEndpoint
|
endpoint = savedEndpoint
|
||||||
}()
|
}()
|
||||||
Endpoint = fakeServer.URL + "/"
|
endpoint = fakeServer.URL + "/"
|
||||||
// run Present
|
// run Present
|
||||||
err = provider.Present("abc.def.example.com", "", fakeKeyAuth)
|
err = provider.Present("abc.def.example.com", "", fakeKeyAuth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue