Commit 7504767
CLOUDNS: add registrar support (#3961)
ClouDNS uses the same API for DNS and registrar-related operations.
Following the pattern I saw in other provider/registrar combos (autodns,
cscglobal), I implemented the registry call in the `cloudnsProvider`
object type, and when used as a registry it creates an additional
instance of the Provider.
_Incidentally this causes rate-limiting functionality not to function
optimally because each of the instances—the provider and registrar—have
their own requestLimit object, causing the rate limit to be tracked and
applied within each separately. I'm going to follow up with a PR that
will improve the API rate-limit implementation for ClouDNS._
The ClouDNS nameserver API responds with different structures apparently
depending on the number of name servers that the domain has. I observed
three on the same domain:
1. When there are 2 domain names for non-ClouDNS name servers, the
response is an array of name server strings `["abc.ns.cloudflare.net",
"def.ns.cloudflare.net"]`
2. When there are 4 ClouDNS name servers, the response is an object with
string keys containing the 4 entries
`{"1":"pns1.cloudns.net","2":"pns2.cloudns.net","3":"pns3.cloudns.net","4":"pns4.cloudns.net"}`
3. When there are 5 name servers, the response is an object with string
keys containing 8 entries included 3 blank values
`{"1":"pns1.cloudns.net","2":"pns2.cloudns.net","3":"pns3.cloudns.net","4":"pns4.cloudns.net","5":"abc.ns.cloudflare.net","6":"","7":"","8":""}`
This covers all of those cases, plus the possible case where the array
contains blank strings.
The new `setNameservers` API call needed to send multiple copies of the
same key `nameservers[]` in the query value, which is supported by the
http query values object, but was not possible with the existing call
pattern because the `get` function was built to accept a string map
instead of a query values object. So I refactored `get` into a wrapper
function that converts the map into a query values object, which calls
the new `getWithQuery` function with the query values object.
---------
Co-authored-by: Tom Limoncelli <[email protected]>1 parent d50aef0 commit 7504767
File tree
3 files changed
+107
-10
lines changed- documentation/provider
- providers/cloudns
3 files changed
+107
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
258 | | - | |
| 259 | + | |
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| |||
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
283 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
284 | 347 | | |
285 | 348 | | |
286 | | - | |
287 | 349 | | |
288 | 350 | | |
289 | 351 | | |
290 | 352 | | |
291 | 353 | | |
292 | 354 | | |
293 | 355 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | 356 | | |
299 | 357 | | |
300 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| |||
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
72 | | - | |
| 80 | + | |
73 | 81 | | |
74 | 82 | | |
75 | 83 | | |
| 84 | + | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
| |||
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
271 | 310 | | |
272 | 311 | | |
273 | 312 | | |
| |||
0 commit comments