mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-09-20 14:56:20 +08:00
add BaseURL option to namecheap creds to allow setting sandbox endpoint (#97)
This commit is contained in:
parent
32fedd8b5f
commit
426c2ed38d
|
@ -22,6 +22,22 @@ username and key:
|
|||
}
|
||||
{% endhighlight %}
|
||||
|
||||
You can optionally specify BaseURL to use a different endpoint - typically the
|
||||
sandbox:
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"namecheap.com":{
|
||||
"apikey": "yourApiKeyFromNameCheap",
|
||||
"apiuser": "yourUsername"
|
||||
"BaseURL": "https://api.sandbox.namecheap.com/xml.response"
|
||||
}
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
if BaseURL is omitted, the production namecheap url is used.
|
||||
|
||||
|
||||
## Metadata
|
||||
|
||||
This provider does not recognize any special metadata fields unique to
|
||||
|
|
|
@ -27,6 +27,13 @@ func newReg(m map[string]string) (providers.Registrar, error) {
|
|||
return nil, fmt.Errorf("Namecheap apikey and apiuser must be provided.")
|
||||
}
|
||||
api.client = nc.NewClient(api.ApiUser, api.ApiKey, api.ApiUser)
|
||||
|
||||
// if BaseURL is specified in creds, use that url
|
||||
BaseURL, ok := m["BaseURL"]
|
||||
if ok {
|
||||
api.client.BaseURL = BaseURL
|
||||
}
|
||||
|
||||
return api, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue