2016-03-17 20:59:15 +00:00
|
|
|
package gandi
|
2016-03-12 16:13:24 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"io/ioutil"
|
|
|
|
"net/http"
|
|
|
|
"net/http/httptest"
|
|
|
|
"regexp"
|
|
|
|
"strings"
|
|
|
|
"testing"
|
2018-06-11 15:32:50 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
2018-10-16 15:52:57 +00:00
|
|
|
"github.com/xenolf/lego/platform/tester"
|
2016-03-12 16:13:24 +00:00
|
|
|
)
|
|
|
|
|
2018-10-16 15:52:57 +00:00
|
|
|
var envTest = tester.NewEnvTest("GANDI_API_KEY")
|
2018-10-12 17:29:18 +00:00
|
|
|
|
|
|
|
func TestNewDNSProvider(t *testing.T) {
|
|
|
|
testCases := []struct {
|
|
|
|
desc string
|
|
|
|
envVars map[string]string
|
|
|
|
expected string
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
desc: "success",
|
|
|
|
envVars: map[string]string{
|
|
|
|
"GANDI_API_KEY": "123",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
desc: "missing api key",
|
|
|
|
envVars: map[string]string{
|
|
|
|
"GANDI_API_KEY": "",
|
|
|
|
},
|
|
|
|
expected: "gandi: some credentials information are missing: GANDI_API_KEY",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, test := range testCases {
|
|
|
|
t.Run(test.desc, func(t *testing.T) {
|
2018-10-16 15:52:57 +00:00
|
|
|
defer envTest.RestoreEnv()
|
|
|
|
envTest.ClearEnv()
|
|
|
|
|
|
|
|
envTest.Apply(test.envVars)
|
2018-10-12 17:29:18 +00:00
|
|
|
|
|
|
|
p, err := NewDNSProvider()
|
|
|
|
|
|
|
|
if len(test.expected) == 0 {
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.NotNil(t, p)
|
|
|
|
require.NotNil(t, p.config)
|
|
|
|
require.NotNil(t, p.inProgressFQDNs)
|
|
|
|
require.NotNil(t, p.inProgressAuthZones)
|
|
|
|
} else {
|
|
|
|
require.EqualError(t, err, test.expected)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestNewDNSProviderConfig(t *testing.T) {
|
|
|
|
testCases := []struct {
|
|
|
|
desc string
|
|
|
|
apiKey string
|
|
|
|
expected string
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
desc: "success",
|
|
|
|
apiKey: "123",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
desc: "missing credentials",
|
|
|
|
expected: "gandi: no API Key given",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, test := range testCases {
|
|
|
|
t.Run(test.desc, func(t *testing.T) {
|
|
|
|
config := NewDefaultConfig()
|
|
|
|
config.APIKey = test.apiKey
|
|
|
|
|
|
|
|
p, err := NewDNSProviderConfig(config)
|
|
|
|
|
|
|
|
if len(test.expected) == 0 {
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.NotNil(t, p)
|
|
|
|
require.NotNil(t, p.config)
|
|
|
|
require.NotNil(t, p.inProgressFQDNs)
|
|
|
|
require.NotNil(t, p.inProgressAuthZones)
|
|
|
|
} else {
|
|
|
|
require.EqualError(t, err, test.expected)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-12 16:13:24 +00:00
|
|
|
// TestDNSProvider runs Present and CleanUp against a fake Gandi RPC
|
|
|
|
// Server, whose responses are predetermined for particular requests.
|
|
|
|
func TestDNSProvider(t *testing.T) {
|
|
|
|
fakeKeyAuth := "XXXX"
|
2018-06-11 15:32:50 +00:00
|
|
|
|
2016-03-12 16:13:24 +00:00
|
|
|
regexpDate, err := regexp.Compile(`\[ACME Challenge [^\]:]*:[^\]]*\]`)
|
2018-06-11 15:32:50 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
|
2016-03-12 16:13:24 +00:00
|
|
|
// start fake RPC server
|
|
|
|
fakeServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
2018-06-11 15:32:50 +00:00
|
|
|
require.Equal(t, "text/xml", r.Header.Get("Content-Type"), "invalid content type")
|
|
|
|
|
2018-09-24 19:07:20 +00:00
|
|
|
req, errS := ioutil.ReadAll(r.Body)
|
|
|
|
require.NoError(t, errS)
|
2018-06-11 15:32:50 +00:00
|
|
|
|
|
|
|
req = regexpDate.ReplaceAllLiteral(req, []byte(`[ACME Challenge 01 Jan 16 00:00 +0000]`))
|
2016-03-12 16:13:24 +00:00
|
|
|
resp, ok := serverResponses[string(req)]
|
2018-06-11 15:32:50 +00:00
|
|
|
require.True(t, ok, "Server response for request not found")
|
|
|
|
|
2018-09-24 19:07:20 +00:00
|
|
|
_, errS = io.Copy(w, strings.NewReader(resp))
|
|
|
|
require.NoError(t, errS)
|
2016-03-12 16:13:24 +00:00
|
|
|
}))
|
|
|
|
defer fakeServer.Close()
|
2018-06-11 15:32:50 +00:00
|
|
|
|
2016-03-24 17:13:18 +00:00
|
|
|
// define function to override findZoneByFqdn with
|
2016-04-11 22:59:59 +00:00
|
|
|
fakeFindZoneByFqdn := func(fqdn string, nameserver []string) (string, error) {
|
2016-03-24 17:13:18 +00:00
|
|
|
return "example.com.", nil
|
|
|
|
}
|
2018-06-11 15:32:50 +00:00
|
|
|
|
2018-09-15 17:07:24 +00:00
|
|
|
config := NewDefaultConfig()
|
|
|
|
config.BaseURL = fakeServer.URL + "/"
|
|
|
|
config.APIKey = "123412341234123412341234"
|
|
|
|
|
|
|
|
provider, err := NewDNSProviderConfig(config)
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
// override findZoneByFqdn function
|
|
|
|
savedFindZoneByFqdn := findZoneByFqdn
|
2016-03-12 16:13:24 +00:00
|
|
|
defer func() {
|
2018-09-15 17:07:24 +00:00
|
|
|
findZoneByFqdn = savedFindZoneByFqdn
|
2016-03-12 16:13:24 +00:00
|
|
|
}()
|
2018-09-15 17:07:24 +00:00
|
|
|
findZoneByFqdn = fakeFindZoneByFqdn
|
2018-06-11 15:32:50 +00:00
|
|
|
|
2016-03-12 16:13:24 +00:00
|
|
|
// run Present
|
|
|
|
err = provider.Present("abc.def.example.com", "", fakeKeyAuth)
|
2018-06-11 15:32:50 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
|
2016-03-12 16:13:24 +00:00
|
|
|
// run CleanUp
|
|
|
|
err = provider.CleanUp("abc.def.example.com", "", fakeKeyAuth)
|
2018-06-11 15:32:50 +00:00
|
|
|
require.NoError(t, err)
|
2016-03-12 16:13:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// serverResponses is the XML-RPC Request->Response map used by the
|
|
|
|
// fake RPC server. It was generated by recording a real RPC session
|
|
|
|
// which resulted in the successful issue of a cert, and then
|
|
|
|
// anonymizing the RPC data.
|
|
|
|
var serverResponses = map[string]string{
|
|
|
|
// Present Request->Response 1 (getZoneID)
|
|
|
|
`<?xml version="1.0"?>
|
|
|
|
<methodCall>
|
|
|
|
<methodName>domain.info</methodName>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>123412341234123412341234</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>example.com.</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
</methodCall>`: `<?xml version='1.0'?>
|
|
|
|
<methodResponse>
|
|
|
|
<params>
|
|
|
|
<param>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>date_updated</name>
|
|
|
|
<value><dateTime.iso8601>20160216T16:14:23</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_delete</name>
|
|
|
|
<value><dateTime.iso8601>20170331T16:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>is_premium</name>
|
|
|
|
<value><boolean>0</boolean></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_hold_begin</name>
|
|
|
|
<value><dateTime.iso8601>20170215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_registry_end</name>
|
|
|
|
<value><dateTime.iso8601>20170215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>authinfo_expiration_date</name>
|
|
|
|
<value><dateTime.iso8601>20161211T21:31:20</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>contacts</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>owner</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>admin</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>bill</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tech</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>reseller</name>
|
|
|
|
<value><nil/></value></member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>nameservers</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>a.dns.gandi.net</string></value>
|
|
|
|
<value><string>b.dns.gandi.net</string></value>
|
|
|
|
<value><string>c.dns.gandi.net</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_restore_end</name>
|
|
|
|
<value><dateTime.iso8601>20170501T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>2222222</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>authinfo</name>
|
|
|
|
<value><string>ABCDABCDAB</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>status</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>clientTransferProhibited</string></value>
|
|
|
|
<value><string>serverTransferProhibited</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tags</name>
|
|
|
|
<value><array><data>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_hold_end</name>
|
|
|
|
<value><dateTime.iso8601>20170401T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>services</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>gandidns</string></value>
|
|
|
|
<value><string>gandimail</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_pending_delete_end</name>
|
|
|
|
<value><dateTime.iso8601>20170506T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>zone_id</name>
|
|
|
|
<value><int>1234567</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_renew_begin</name>
|
|
|
|
<value><dateTime.iso8601>20120101T00:00:00</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>fqdn</name>
|
|
|
|
<value><string>example.com</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>autorenew</name>
|
|
|
|
<value><nil/></value></member>
|
|
|
|
<member>
|
|
|
|
<name>date_registry_creation</name>
|
|
|
|
<value><dateTime.iso8601>20150215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tld</name>
|
|
|
|
<value><string>org</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_created</name>
|
|
|
|
<value><dateTime.iso8601>20150215T03:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</param>
|
|
|
|
</params>
|
|
|
|
</methodResponse>
|
|
|
|
`,
|
2016-03-24 17:13:18 +00:00
|
|
|
// Present Request->Response 2 (cloneZone)
|
2016-03-12 16:13:24 +00:00
|
|
|
`<?xml version="1.0"?>
|
|
|
|
<methodCall>
|
|
|
|
<methodName>domain.zone.clone</methodName>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>123412341234123412341234</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>1234567</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>0</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<struct>
|
|
|
|
<member>
|
|
|
|
<name>name</name>
|
|
|
|
<value>
|
|
|
|
<string>example.com [ACME Challenge 01 Jan 16 00:00 +0000]</string>
|
|
|
|
</value>
|
|
|
|
</member>
|
|
|
|
</struct>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
</methodCall>`: `<?xml version='1.0'?>
|
|
|
|
<methodResponse>
|
|
|
|
<params>
|
|
|
|
<param>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>name</name>
|
|
|
|
<value><string>example.com [ACME Challenge 01 Jan 16 00:00 +0000]</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>versions</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><int>1</int></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_updated</name>
|
|
|
|
<value><dateTime.iso8601>20160216T16:24:29</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>7654321</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>owner</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>version</name>
|
|
|
|
<value><int>1</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>domains</name>
|
|
|
|
<value><int>0</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>public</name>
|
|
|
|
<value><boolean>0</boolean></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</param>
|
|
|
|
</params>
|
|
|
|
</methodResponse>
|
|
|
|
`,
|
2016-03-24 17:13:18 +00:00
|
|
|
// Present Request->Response 3 (newZoneVersion)
|
2016-03-12 16:13:24 +00:00
|
|
|
`<?xml version="1.0"?>
|
|
|
|
<methodCall>
|
|
|
|
<methodName>domain.zone.version.new</methodName>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>123412341234123412341234</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>7654321</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
</methodCall>`: `<?xml version='1.0'?>
|
|
|
|
<methodResponse>
|
|
|
|
<params>
|
|
|
|
<param>
|
|
|
|
<value><int>2</int></value>
|
|
|
|
</param>
|
|
|
|
</params>
|
|
|
|
</methodResponse>
|
|
|
|
`,
|
2016-03-24 17:13:18 +00:00
|
|
|
// Present Request->Response 4 (addTXTRecord)
|
2016-03-12 16:13:24 +00:00
|
|
|
`<?xml version="1.0"?>
|
|
|
|
<methodCall>
|
|
|
|
<methodName>domain.zone.record.add</methodName>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>123412341234123412341234</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>7654321</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>2</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<struct>
|
|
|
|
<member>
|
|
|
|
<name>type</name>
|
|
|
|
<value>
|
|
|
|
<string>TXT</string>
|
|
|
|
</value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>name</name>
|
|
|
|
<value>
|
|
|
|
<string>_acme-challenge.abc.def</string>
|
|
|
|
</value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>value</name>
|
|
|
|
<value>
|
|
|
|
<string>ezRpBPY8wH8djMLYjX2uCKPwiKDkFZ1SFMJ6ZXGlHrQ</string>
|
|
|
|
</value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>ttl</name>
|
|
|
|
<value>
|
|
|
|
<int>300</int>
|
|
|
|
</value>
|
|
|
|
</member>
|
|
|
|
</struct>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
</methodCall>`: `<?xml version='1.0'?>
|
|
|
|
<methodResponse>
|
|
|
|
<params>
|
|
|
|
<param>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>name</name>
|
|
|
|
<value><string>_acme-challenge.abc.def</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>type</name>
|
|
|
|
<value><string>TXT</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
2016-10-04 21:08:24 +00:00
|
|
|
<value><int>333333333</int></value>
|
2016-03-12 16:13:24 +00:00
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>value</name>
|
|
|
|
<value><string>"ezRpBPY8wH8djMLYjX2uCKPwiKDkFZ1SFMJ6ZXGlHrQ"</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>ttl</name>
|
|
|
|
<value><int>300</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</param>
|
|
|
|
</params>
|
|
|
|
</methodResponse>
|
|
|
|
`,
|
2016-03-24 17:13:18 +00:00
|
|
|
// Present Request->Response 5 (setZoneVersion)
|
2016-03-12 16:13:24 +00:00
|
|
|
`<?xml version="1.0"?>
|
|
|
|
<methodCall>
|
|
|
|
<methodName>domain.zone.version.set</methodName>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>123412341234123412341234</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>7654321</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>2</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
</methodCall>`: `<?xml version='1.0'?>
|
|
|
|
<methodResponse>
|
|
|
|
<params>
|
|
|
|
<param>
|
|
|
|
<value><boolean>1</boolean></value>
|
|
|
|
</param>
|
|
|
|
</params>
|
|
|
|
</methodResponse>
|
|
|
|
`,
|
2016-03-24 17:13:18 +00:00
|
|
|
// Present Request->Response 6 (setZone)
|
2016-03-12 16:13:24 +00:00
|
|
|
`<?xml version="1.0"?>
|
|
|
|
<methodCall>
|
|
|
|
<methodName>domain.zone.set</methodName>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>123412341234123412341234</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>example.com.</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>7654321</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
</methodCall>`: `<?xml version='1.0'?>
|
|
|
|
<methodResponse>
|
|
|
|
<params>
|
|
|
|
<param>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>date_updated</name>
|
|
|
|
<value><dateTime.iso8601>20160216T16:14:23</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_delete</name>
|
|
|
|
<value><dateTime.iso8601>20170331T16:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>is_premium</name>
|
|
|
|
<value><boolean>0</boolean></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_hold_begin</name>
|
|
|
|
<value><dateTime.iso8601>20170215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_registry_end</name>
|
|
|
|
<value><dateTime.iso8601>20170215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>authinfo_expiration_date</name>
|
|
|
|
<value><dateTime.iso8601>20161211T21:31:20</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>contacts</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>owner</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>admin</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>bill</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tech</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>reseller</name>
|
|
|
|
<value><nil/></value></member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>nameservers</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>a.dns.gandi.net</string></value>
|
|
|
|
<value><string>b.dns.gandi.net</string></value>
|
|
|
|
<value><string>c.dns.gandi.net</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_restore_end</name>
|
|
|
|
<value><dateTime.iso8601>20170501T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>2222222</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>authinfo</name>
|
|
|
|
<value><string>ABCDABCDAB</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>status</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>clientTransferProhibited</string></value>
|
|
|
|
<value><string>serverTransferProhibited</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tags</name>
|
|
|
|
<value><array><data>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_hold_end</name>
|
|
|
|
<value><dateTime.iso8601>20170401T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>services</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>gandidns</string></value>
|
|
|
|
<value><string>gandimail</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_pending_delete_end</name>
|
|
|
|
<value><dateTime.iso8601>20170506T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>zone_id</name>
|
|
|
|
<value><int>7654321</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_renew_begin</name>
|
|
|
|
<value><dateTime.iso8601>20120101T00:00:00</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>fqdn</name>
|
|
|
|
<value><string>example.com</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>autorenew</name>
|
|
|
|
<value><nil/></value></member>
|
|
|
|
<member>
|
|
|
|
<name>date_registry_creation</name>
|
|
|
|
<value><dateTime.iso8601>20150215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tld</name>
|
|
|
|
<value><string>org</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_created</name>
|
|
|
|
<value><dateTime.iso8601>20150215T03:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</param>
|
|
|
|
</params>
|
|
|
|
</methodResponse>
|
|
|
|
`,
|
|
|
|
// CleanUp Request->Response 1 (setZone)
|
|
|
|
`<?xml version="1.0"?>
|
|
|
|
<methodCall>
|
|
|
|
<methodName>domain.zone.set</methodName>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>123412341234123412341234</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>example.com.</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>1234567</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
</methodCall>`: `<?xml version='1.0'?>
|
|
|
|
<methodResponse>
|
|
|
|
<params>
|
|
|
|
<param>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>date_updated</name>
|
|
|
|
<value><dateTime.iso8601>20160216T16:24:38</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_delete</name>
|
|
|
|
<value><dateTime.iso8601>20170331T16:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>is_premium</name>
|
|
|
|
<value><boolean>0</boolean></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_hold_begin</name>
|
|
|
|
<value><dateTime.iso8601>20170215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_registry_end</name>
|
|
|
|
<value><dateTime.iso8601>20170215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>authinfo_expiration_date</name>
|
|
|
|
<value><dateTime.iso8601>20161211T21:31:20</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>contacts</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>owner</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>admin</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>bill</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tech</name>
|
|
|
|
<value><struct>
|
|
|
|
<member>
|
|
|
|
<name>handle</name>
|
|
|
|
<value><string>LEGO-GANDI</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>111111</int></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>reseller</name>
|
|
|
|
<value><nil/></value></member>
|
|
|
|
</struct></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>nameservers</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>a.dns.gandi.net</string></value>
|
|
|
|
<value><string>b.dns.gandi.net</string></value>
|
|
|
|
<value><string>c.dns.gandi.net</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_restore_end</name>
|
|
|
|
<value><dateTime.iso8601>20170501T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>id</name>
|
|
|
|
<value><int>2222222</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>authinfo</name>
|
|
|
|
<value><string>ABCDABCDAB</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>status</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>clientTransferProhibited</string></value>
|
|
|
|
<value><string>serverTransferProhibited</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tags</name>
|
|
|
|
<value><array><data>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_hold_end</name>
|
|
|
|
<value><dateTime.iso8601>20170401T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>services</name>
|
|
|
|
<value><array><data>
|
|
|
|
<value><string>gandidns</string></value>
|
|
|
|
<value><string>gandimail</string></value>
|
|
|
|
</data></array></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_pending_delete_end</name>
|
|
|
|
<value><dateTime.iso8601>20170506T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>zone_id</name>
|
|
|
|
<value><int>1234567</int></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_renew_begin</name>
|
|
|
|
<value><dateTime.iso8601>20120101T00:00:00</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>fqdn</name>
|
|
|
|
<value><string>example.com</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>autorenew</name>
|
|
|
|
<value><nil/></value></member>
|
|
|
|
<member>
|
|
|
|
<name>date_registry_creation</name>
|
|
|
|
<value><dateTime.iso8601>20150215T02:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>tld</name>
|
|
|
|
<value><string>org</string></value>
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
<name>date_created</name>
|
|
|
|
<value><dateTime.iso8601>20150215T03:04:06</dateTime.iso8601></value>
|
|
|
|
</member>
|
|
|
|
</struct></value>
|
|
|
|
</param>
|
|
|
|
</params>
|
|
|
|
</methodResponse>
|
|
|
|
`,
|
|
|
|
// CleanUp Request->Response 2 (deleteZone)
|
|
|
|
`<?xml version="1.0"?>
|
|
|
|
<methodCall>
|
|
|
|
<methodName>domain.zone.delete</methodName>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<string>123412341234123412341234</string>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
<param>
|
|
|
|
<value>
|
|
|
|
<int>7654321</int>
|
|
|
|
</value>
|
|
|
|
</param>
|
|
|
|
</methodCall>`: `<?xml version='1.0'?>
|
|
|
|
<methodResponse>
|
|
|
|
<params>
|
|
|
|
<param>
|
|
|
|
<value><boolean>1</boolean></value>
|
|
|
|
</param>
|
|
|
|
</params>
|
|
|
|
</methodResponse>
|
|
|
|
`,
|
|
|
|
}
|