| 1 |
# Copyright (c) 2021 Felix Fontein <[email protected]> |
| 2 |
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 3 |
# SPDX-License-Identifier: GPL-3.0-or-later |
| 4 |
|
| 5 |
from __future__ import annotations |
| 6 |
|
| 7 |
try: |
| 8 |
import lxml.etree |
| 9 |
except ImportError: # pragma: no cover |
| 10 |
# should be handled in module importing this one |
| 11 |
pass # pragma: no cover |
| 12 |
|
| 13 |
|
| 14 |
HOSTTECH_WSDL_DEFAULT_ENTRIES = [ |
| 15 |
(125, 42, "A", "", "1.2.3.4", 3600, None, None), |
| 16 |
(126, 42, "A", "*", "1.2.3.5", 3600, None, None), |
| 17 |
(127, 42, "AAAA", "", "2001:1:2::3", 3600, None, None), |
| 18 |
(128, 42, "AAAA", "*", "2001:1:2::4", 3600, None, None), |
| 19 |
(129, 42, "MX", "", "example.com", 3600, None, "10"), |
| 20 |
(130, 42, "NS", "", "ns3.hostserv.eu", 10800, None, None), |
| 21 |
(131, 42, "NS", "", "ns2.hostserv.eu", 10800, None, None), |
| 22 |
(132, 42, "NS", "", "ns1.hostserv.eu", 10800, None, None), |
| 23 |
] |
| 24 |
|
| 25 |
HOSTTECH_JSON_DEFAULT_ENTRIES = [ |
| 26 |
# (125, 42, 'A', '', '1.2.3.4', 3600, None, None), |
| 27 |
{ |
| 28 |
"id": 125, |
| 29 |
"type": "A", |
| 30 |
"name": "", |
| 31 |
"ipv4": "1.2.3.4", |
| 32 |
"ttl": 3600, |
| 33 |
"comment": "", |
| 34 |
}, |
| 35 |
# (126, 42, 'A', '*', '1.2.3.5', 3600, None, None), |
| 36 |
{ |
| 37 |
"id": 126, |
| 38 |
"type": "A", |
| 39 |
"name": "*", |
| 40 |
"ipv4": "1.2.3.5", |
| 41 |
"ttl": 3600, |
| 42 |
"comment": "", |
| 43 |
}, |
| 44 |
# (127, 42, 'AAAA', '', '2001:1:2::3', 3600, None, None), |
| 45 |
{ |
| 46 |
"id": 127, |
| 47 |
"type": "AAAA", |
| 48 |
"name": "", |
| 49 |
"ipv6": "2001:1:2::3", |
| 50 |
"ttl": 3600, |
| 51 |
"comment": "", |
| 52 |
}, |
| 53 |
# (128, 42, 'AAAA', '*', '2001:1:2::4', 3600, None, None), |
| 54 |
{ |
| 55 |
"id": 128, |
| 56 |
"type": "AAAA", |
| 57 |
"name": "*", |
| 58 |
"ipv6": "2001:1:2::4", |
| 59 |
"ttl": 3600, |
| 60 |
"comment": "", |
| 61 |
}, |
| 62 |
# (129, 42, 'MX', '', 'example.com', 3600, None, '10'), |
| 63 |
{ |
| 64 |
"id": 129, |
| 65 |
"type": "MX", |
| 66 |
"ownername": "", |
| 67 |
"name": "example.com", |
| 68 |
"pref": 10, |
| 69 |
"ttl": 3600, |
| 70 |
"comment": "", |
| 71 |
}, |
| 72 |
# (130, 42, 'NS', '', 'ns3.hostserv.eu', 10800, None, None), |
| 73 |
{ |
| 74 |
"id": 130, |
| 75 |
"type": "NS", |
| 76 |
"ownername": "", |
| 77 |
"targetname": "ns3.hostserv.eu", |
| 78 |
"ttl": 10800, |
| 79 |
"comment": "", |
| 80 |
}, |
| 81 |
# (131, 42, 'NS', '', 'ns2.hostserv.eu', 10800, None, None), |
| 82 |
{ |
| 83 |
"id": 131, |
| 84 |
"type": "NS", |
| 85 |
"ownername": "", |
| 86 |
"targetname": "ns2.hostserv.eu", |
| 87 |
"ttl": 10800, |
| 88 |
"comment": "", |
| 89 |
}, |
| 90 |
# (132, 42, 'NS', '', 'ns1.hostserv.eu', 10800, None, None), |
| 91 |
{ |
| 92 |
"id": 132, |
| 93 |
"type": "NS", |
| 94 |
"ownername": "", |
| 95 |
"targetname": "ns1.hostserv.eu", |
| 96 |
"ttl": 10800, |
| 97 |
"comment": "", |
| 98 |
}, |
| 99 |
] |
| 100 |
|
| 101 |
|
| 102 |
def validate_wsdl_call(conditions): |
| 103 |
def predicate(content): |
| 104 |
assert content.startswith(b"<?xml version='1.0' encoding='utf-8'?>\n") |
| 105 |
|
| 106 |
root = lxml.etree.fromstring(content) |
| 107 |
header = None |
| 108 |
body = None |
| 109 |
|
| 110 |
for header_ in root.iter( |
| 111 |
lxml.etree.QName("http://schemas.xmlsoap.org/soap/envelope/", "Header").text |
| 112 |
): |
| 113 |
header = header_ |
| 114 |
for body_ in root.iter( |
| 115 |
lxml.etree.QName("http://schemas.xmlsoap.org/soap/envelope/", "Body").text |
| 116 |
): |
| 117 |
body = body_ |
| 118 |
|
| 119 |
return all(condition(content, header, body) for condition in conditions) |
| 120 |
|
| 121 |
return predicate |
| 122 |
|
| 123 |
|
| 124 |
def get_wsdl_value(root, name): |
| 125 |
for auth in root.iter(name): |
| 126 |
return auth |
| 127 |
raise AssertionError( |
| 128 |
f'Cannot find child "{name}" in node {root}: {lxml.etree.tostring(root)}' |
| 129 |
) # pragma: no cover |
| 130 |
|
| 131 |
|
| 132 |
def expect_wsdl_authentication(username, password): |
| 133 |
def predicate(content, header, body): |
| 134 |
auth = get_wsdl_value(header, lxml.etree.QName("auth", "authenticate").text) |
| 135 |
assert get_wsdl_value(auth, "UserName").text == username |
| 136 |
assert get_wsdl_value(auth, "Password").text == password |
| 137 |
return True |
| 138 |
|
| 139 |
return predicate |
| 140 |
|
| 141 |
|
| 142 |
def check_wsdl_nil(node): |
| 143 |
nil_flag = node.get( |
| 144 |
lxml.etree.QName("http://www.w3.org/2001/XMLSchema-instance", "nil") |
| 145 |
) |
| 146 |
if nil_flag != "true": |
| 147 |
print(nil_flag) # pragma: no cover |
| 148 |
assert nil_flag == "true" |
| 149 |
|
| 150 |
|
| 151 |
def check_wsdl_value(node, value, wsdl_type=None): |
| 152 |
if type is not None: |
| 153 |
type_text = node.get( |
| 154 |
lxml.etree.QName("http://www.w3.org/2001/XMLSchema-instance", "type") |
| 155 |
) |
| 156 |
assert ( |
| 157 |
type_text is not None |
| 158 |
), f"Cannot find type in {node}: {lxml.etree.tostring(node)}" |
| 159 |
i = type_text.find(":") |
| 160 |
if i < 0: |
| 161 |
ns = None # pragma: no cover |
| 162 |
else: |
| 163 |
ns = node.nsmap.get(type_text[:i]) |
| 164 |
type_text = type_text[i + 1 :] |
| 165 |
if ns != wsdl_type[0] or type_text != wsdl_type[1]: |
| 166 |
print(ns, wsdl_type[0], type_text, wsdl_type[1]) # pragma: no cover |
| 167 |
assert ns == wsdl_type[0] and type_text == wsdl_type[1] |
| 168 |
else: |
| 169 |
pass # pragma: no cover |
| 170 |
if node.text != value: |
| 171 |
print(node.text, value) # pragma: no cover |
| 172 |
assert node.text == value |
| 173 |
|
| 174 |
|
| 175 |
def find_xml_map_entry(map_root, key_name, allow_non_existing=False): |
| 176 |
for map_entry in map_root.iter("item"): |
| 177 |
key = get_wsdl_value(map_entry, "key") |
| 178 |
value = get_wsdl_value(map_entry, "value") |
| 179 |
if key.text == key_name: |
| 180 |
check_wsdl_value( |
| 181 |
key, key_name, wsdl_type=("http://www.w3.org/2001/XMLSchema", "string") |
| 182 |
) |
| 183 |
return value |
| 184 |
if allow_non_existing: |
| 185 |
return None |
| 186 |
raise AssertionError( # pragma: no cover |
| 187 |
f'Cannot find map entry with key "{key_name}" in node {map_root}: {lxml.etree.tostring(map_root)}' |
| 188 |
) |
| 189 |
|
| 190 |
|
| 191 |
def expect_wsdl_value(path, value, wsdl_type=None): |
| 192 |
def predicate(content, header, body): |
| 193 |
node = body |
| 194 |
for entry in path: |
| 195 |
node = get_wsdl_value(node, entry) |
| 196 |
check_wsdl_value(node, value, wsdl_type=wsdl_type) |
| 197 |
return True |
| 198 |
|
| 199 |
return predicate |
| 200 |
|
| 201 |
|
| 202 |
def add_wsdl_answer_start_lines(lines): |
| 203 |
lines.extend( |
| 204 |
[ |
| 205 |
'<?xml version="1.0" encoding="UTF-8"?>\n', |
| 206 |
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"' |
| 207 |
' xmlns:ns1="https://ns1.hosttech.eu/public/api"' |
| 208 |
' xmlns:xsd="http://www.w3.org/2001/XMLSchema"' |
| 209 |
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' |
| 210 |
' xmlns:ns2="http://xml.apache.org/xml-soap"' |
| 211 |
' xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"' |
| 212 |
' SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">', |
| 213 |
"<SOAP-ENV:Header>", |
| 214 |
"<ns1:authenticateResponse>", |
| 215 |
'<return xsi:type="xsd:boolean">true</return>', |
| 216 |
"</ns1:authenticateResponse>", |
| 217 |
"</SOAP-ENV:Header>", |
| 218 |
"<SOAP-ENV:Body>", |
| 219 |
] |
| 220 |
) |
| 221 |
|
| 222 |
|
| 223 |
def add_wsdl_answer_end_lines(lines): |
| 224 |
lines.extend(["</SOAP-ENV:Body>", "</SOAP-ENV:Envelope>"]) |
| 225 |
|
| 226 |
|
| 227 |
def add_wsdl_dns_record_lines(lines, entry, tag_name): |
| 228 |
lines.extend( |
| 229 |
[ |
| 230 |
f'<{tag_name} xsi:type="ns2:Map">', |
| 231 |
f'<item><key xsi:type="xsd:string">id</key><value xsi:type="xsd:int">{entry[0]}</value></item>', |
| 232 |
f'<item><key xsi:type="xsd:string">zone</key><value xsi:type="xsd:int">{entry[1]}</value></item>', |
| 233 |
f'<item><key xsi:type="xsd:string">type</key><value xsi:type="xsd:string">{entry[2]}</value></item>', |
| 234 |
f'<item><key xsi:type="xsd:string">prefix</key><value xsi:type="xsd:string">{entry[3]}</value></item>', |
| 235 |
f'<item><key xsi:type="xsd:string">target</key><value xsi:type="xsd:string">{entry[4]}</value></item>', |
| 236 |
f'<item><key xsi:type="xsd:string">ttl</key><value xsi:type="xsd:int">{entry[5]}</value></item>', |
| 237 |
] |
| 238 |
) |
| 239 |
if entry[6] is None: |
| 240 |
lines.append( |
| 241 |
'<item><key xsi:type="xsd:string">comment</key><value xsi:nil="true"/></item>' |
| 242 |
) |
| 243 |
else: |
| 244 |
lines.append( # pragma: no cover |
| 245 |
f'<item><key xsi:type="xsd:string">comment</key><value xsi:type="xsd:string">{entry[6]}</value></item>' |
| 246 |
) |
| 247 |
if entry[7] is None: |
| 248 |
lines.append( |
| 249 |
'<item><key xsi:type="xsd:string">priority</key><value xsi:nil="true"/></item>' |
| 250 |
) |
| 251 |
else: |
| 252 |
lines.append( |
| 253 |
f'<item><key xsi:type="xsd:string">priority</key><value xsi:type="xsd:int">{entry[7]}</value></item>' |
| 254 |
) |
| 255 |
lines.append(f"</{tag_name}>") |
| 256 |
|
| 257 |
|
| 258 |
def create_wsdl_zones_answer(zone_id, zone_name, entries): |
| 259 |
lines = [] |
| 260 |
add_wsdl_answer_start_lines(lines) |
| 261 |
lines.extend( |
| 262 |
[ |
| 263 |
"<ns1:getZoneResponse>", |
| 264 |
'<return xsi:type="ns2:Map">', |
| 265 |
f'<item><key xsi:type="xsd:string">id</key><value xsi:type="xsd:int">{zone_id}</value></item>', |
| 266 |
'<item><key xsi:type="xsd:string">user</key><value xsi:type="xsd:int">23</value></item>', |
| 267 |
f'<item><key xsi:type="xsd:string">name</key><value xsi:type="xsd:string">{zone_name}</value></item>', |
| 268 |
'<item><key xsi:type="xsd:string">email</key><value xsi:type="xsd:string">[email protected]</value></item>', |
| 269 |
'<item><key xsi:type="xsd:string">ttl</key><value xsi:type="xsd:int">10800</value></item>', |
| 270 |
'<item><key xsi:type="xsd:string">nameserver</key><value xsi:type="xsd:string">ns1.hostserv.eu</value></item>', |
| 271 |
'<item><key xsi:type="xsd:string">serial</key><value xsi:type="xsd:string">12345</value></item>', |
| 272 |
'<item><key xsi:type="xsd:string">serialLastUpdate</key><value xsi:type="xsd:int">0</value></item>', |
| 273 |
'<item><key xsi:type="xsd:string">refresh</key><value xsi:type="xsd:int">7200</value></item>', |
| 274 |
'<item><key xsi:type="xsd:string">retry</key><value xsi:type="xsd:int">120</value></item>', |
| 275 |
'<item><key xsi:type="xsd:string">expire</key><value xsi:type="xsd:int">1234567</value></item>', |
| 276 |
'<item><key xsi:type="xsd:string">template</key><value xsi:nil="true"/></item>', |
| 277 |
'<item><key xsi:type="xsd:string">ns3</key><value xsi:type="xsd:int">1</value></item>', |
| 278 |
] |
| 279 |
) |
| 280 |
lines.append( |
| 281 |
f'<item><key xsi:type="xsd:string">records</key><value SOAP-ENC:arrayType="ns2:Map[{len(entries)}]" xsi:type="SOAP-ENC:Array">' |
| 282 |
) |
| 283 |
for entry in entries: |
| 284 |
add_wsdl_dns_record_lines(lines, entry, "item") |
| 285 |
lines.extend( |
| 286 |
[ |
| 287 |
"</value>", |
| 288 |
"</item>", |
| 289 |
"</return>", |
| 290 |
"</ns1:getZoneResponse>", |
| 291 |
] |
| 292 |
) |
| 293 |
add_wsdl_answer_end_lines(lines) |
| 294 |
return "".join(lines) |
| 295 |
|
| 296 |
|
| 297 |
def create_wsdl_zone_not_found_answer(): |
| 298 |
lines = [ |
| 299 |
'<?xml version="1.0" encoding="UTF-8"?>\n', |
| 300 |
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"' |
| 301 |
' xmlns:ns1="https://ns1.hosttech.eu/public/api"' |
| 302 |
' xmlns:xsd="http://www.w3.org/2001/XMLSchema"' |
| 303 |
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' |
| 304 |
' xmlns:ns2="http://xml.apache.org/xml-soap"' |
| 305 |
' xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"' |
| 306 |
' SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">', |
| 307 |
"<SOAP-ENV:Header>", |
| 308 |
"<ns1:authenticateResponse>", |
| 309 |
'<return xsi:type="xsd:boolean">true</return>', |
| 310 |
"</ns1:authenticateResponse>", |
| 311 |
"</SOAP-ENV:Header>", |
| 312 |
"<SOAP-ENV:Fault>", |
| 313 |
"<faultstring>zone not found</faultstring>", |
| 314 |
"</SOAP-ENV:Fault>", |
| 315 |
"</SOAP-ENV:Envelope>", |
| 316 |
] |
| 317 |
return "".join(lines) |
| 318 |
|
| 319 |
|
| 320 |
def check_wsdl_record(record_data, entry): |
| 321 |
check_wsdl_value( |
| 322 |
find_xml_map_entry(record_data, "type"), |
| 323 |
entry[2], |
| 324 |
wsdl_type=("http://www.w3.org/2001/XMLSchema", "string"), |
| 325 |
) |
| 326 |
prefix = find_xml_map_entry(record_data, "prefix") |
| 327 |
if entry[3]: |
| 328 |
check_wsdl_value( |
| 329 |
prefix, entry[3], wsdl_type=("http://www.w3.org/2001/XMLSchema", "string") |
| 330 |
) |
| 331 |
elif prefix is not None: |
| 332 |
check_wsdl_nil(prefix) |
| 333 |
else: |
| 334 |
pass # pragma: no cover |
| 335 |
check_wsdl_value( |
| 336 |
find_xml_map_entry(record_data, "target"), |
| 337 |
entry[4], |
| 338 |
wsdl_type=("http://www.w3.org/2001/XMLSchema", "string"), |
| 339 |
) |
| 340 |
check_wsdl_value( |
| 341 |
find_xml_map_entry(record_data, "ttl"), |
| 342 |
str(entry[5]), |
| 343 |
wsdl_type=("http://www.w3.org/2001/XMLSchema", "int"), |
| 344 |
) |
| 345 |
if entry[6] is None: |
| 346 |
comment = find_xml_map_entry(record_data, "comment", allow_non_existing=True) |
| 347 |
if comment is not None: |
| 348 |
check_wsdl_nil(comment) # pragma: no cover |
| 349 |
else: |
| 350 |
check_wsdl_value( |
| 351 |
find_xml_map_entry(record_data, "comment"), |
| 352 |
entry[6], |
| 353 |
wsdl_type=("http://www.w3.org/2001/XMLSchema", "string"), |
| 354 |
) # pragma: no cover |
| 355 |
if entry[7] is None: |
| 356 |
check_wsdl_nil(find_xml_map_entry(record_data, "priority")) |
| 357 |
else: |
| 358 |
check_wsdl_value( |
| 359 |
find_xml_map_entry(record_data, "priority"), |
| 360 |
entry[7], |
| 361 |
wsdl_type=("http://www.w3.org/2001/XMLSchema", "string"), |
| 362 |
) # pragma: no cover |
| 363 |
|
| 364 |
|
| 365 |
def validate_wsdl_add_request(zone, entry): |
| 366 |
def predicate(content, header, body): |
| 367 |
fn_data = get_wsdl_value( |
| 368 |
body, |
| 369 |
lxml.etree.QName("https://ns1.hosttech.eu/public/api", "addRecord").text, |
| 370 |
) |
| 371 |
check_wsdl_value( |
| 372 |
get_wsdl_value(fn_data, "search"), |
| 373 |
zone, |
| 374 |
wsdl_type=("http://www.w3.org/2001/XMLSchema", "string"), |
| 375 |
) |
| 376 |
check_wsdl_record(get_wsdl_value(fn_data, "recorddata"), entry) |
| 377 |
return True |
| 378 |
|
| 379 |
return predicate |
| 380 |
|
| 381 |
|
| 382 |
def validate_wsdl_update_request(entry): |
| 383 |
def predicate(content, header, body): |
| 384 |
fn_data = get_wsdl_value( |
| 385 |
body, |
| 386 |
lxml.etree.QName("https://ns1.hosttech.eu/public/api", "updateRecord").text, |
| 387 |
) |
| 388 |
check_wsdl_value( |
| 389 |
get_wsdl_value(fn_data, "recordId"), |
| 390 |
str(entry[0]), |
| 391 |
wsdl_type=("http://www.w3.org/2001/XMLSchema", "int"), |
| 392 |
) |
| 393 |
check_wsdl_record(get_wsdl_value(fn_data, "recorddata"), entry) |
| 394 |
return True |
| 395 |
|
| 396 |
return predicate |
| 397 |
|
| 398 |
|
| 399 |
def validate_wsdl_del_request(entry): |
| 400 |
def predicate(content, header, body): |
| 401 |
fn_data = get_wsdl_value( |
| 402 |
body, |
| 403 |
lxml.etree.QName("https://ns1.hosttech.eu/public/api", "deleteRecord").text, |
| 404 |
) |
| 405 |
check_wsdl_value( |
| 406 |
get_wsdl_value(fn_data, "recordId"), |
| 407 |
str(entry[0]), |
| 408 |
wsdl_type=("http://www.w3.org/2001/XMLSchema", "int"), |
| 409 |
) |
| 410 |
return True |
| 411 |
|
| 412 |
return predicate |
| 413 |
|
| 414 |
|
| 415 |
def create_wsdl_add_result(entry): |
| 416 |
lines = [] |
| 417 |
add_wsdl_answer_start_lines(lines) |
| 418 |
lines.append("<ns1:addRecordResponse>") |
| 419 |
add_wsdl_dns_record_lines(lines, entry, "return") |
| 420 |
lines.append("</ns1:addRecordResponse>") |
| 421 |
add_wsdl_answer_end_lines(lines) |
| 422 |
return "".join(lines) |
| 423 |
|
| 424 |
|
| 425 |
def create_wsdl_update_result(entry): |
| 426 |
lines = [] |
| 427 |
add_wsdl_answer_start_lines(lines) |
| 428 |
lines.append("<ns1:updateRecordResponse>") |
| 429 |
add_wsdl_dns_record_lines(lines, entry, "return") |
| 430 |
lines.append("</ns1:updateRecordResponse>") |
| 431 |
add_wsdl_answer_end_lines(lines) |
| 432 |
return "".join(lines) |
| 433 |
|
| 434 |
|
| 435 |
def create_wsdl_del_result(success): |
| 436 |
lines = [] |
| 437 |
add_wsdl_answer_start_lines(lines) |
| 438 |
sxs = "true" if success else "false" |
| 439 |
lines.extend( |
| 440 |
[ |
| 441 |
"<ns1:deleteRecordResponse>", |
| 442 |
f'<return xsi:type="xsd:boolean">{sxs}</return>', |
| 443 |
"</ns1:deleteRecordResponse>", |
| 444 |
] |
| 445 |
) |
| 446 |
add_wsdl_answer_end_lines(lines) |
| 447 |
return "".join(lines) |
| 448 |
|
| 449 |
|
| 450 |
HOSTTECH_WSDL_DEFAULT_ZONE_RESULT = create_wsdl_zones_answer( |
| 451 |
42, "example.com", HOSTTECH_WSDL_DEFAULT_ENTRIES |
| 452 |
) |
| 453 |
|
| 454 |
HOSTTECH_WSDL_ZONE_NOT_FOUND = create_wsdl_zone_not_found_answer() |
| 455 |
|
| 456 |
HOSTTECH_JSON_ZONE_LIST_RESULT = { |
| 457 |
"data": [ |
| 458 |
{ |
| 459 |
"id": 42, |
| 460 |
"name": "example.com", |
| 461 |
"email": "[email protected]", |
| 462 |
"ttl": 10800, |
| 463 |
"nameserver": "ns1.hosttech.ch", |
| 464 |
"dnssec": False, |
| 465 |
}, |
| 466 |
{ |
| 467 |
"id": 43, |
| 468 |
"name": "foo.com", |
| 469 |
"email": "[email protected]", |
| 470 |
"ttl": 10800, |
| 471 |
"nameserver": "ns1.hosttech.ch", |
| 472 |
"dnssec": True, |
| 473 |
"dnssec_email": "[email protected]", |
| 474 |
}, |
| 475 |
], |
| 476 |
} |
| 477 |
|
| 478 |
HOSTTECH_JSON_ZONE_GET_RESULT = { |
| 479 |
"data": { |
| 480 |
"id": 42, |
| 481 |
"name": "example.com", |
| 482 |
"email": "[email protected]", |
| 483 |
"ttl": 10800, |
| 484 |
"nameserver": "ns1.hosttech.ch", |
| 485 |
"dnssec": False, |
| 486 |
"records": HOSTTECH_JSON_DEFAULT_ENTRIES, |
| 487 |
} |
| 488 |
} |
| 489 |
|
| 490 |
HOSTTECH_JSON_ZONE_2_GET_RESULT = { |
| 491 |
"data": { |
| 492 |
"id": 43, |
| 493 |
"name": "foo.com", |
| 494 |
"email": "[email protected]", |
| 495 |
"ttl": 10800, |
| 496 |
"nameserver": "ns1.hosttech.ch", |
| 497 |
"dnssec": True, |
| 498 |
"dnssec_email": "[email protected]", |
| 499 |
"ds_records": [ |
| 500 |
{ |
| 501 |
"key_tag": 12345, |
| 502 |
"algorithm": 8, |
| 503 |
"digest_type": 1, |
| 504 |
"digest": "012356789ABCDEF0123456789ABCDEF012345678", |
| 505 |
"flags": 257, |
| 506 |
"protocol": 3, |
| 507 |
"public_key": "MuhdzsQdqEGShwjtJDKZZjdKqUSGluFzTTinpuEeIRzLLcgkwgAPKWFa " |
| 508 |
"eQntNlmcNDeCziGwpdvhJnvKXEMbFcZwsaDIJuWqERxAQNGABWfPlCLh " |
| 509 |
"HQPnbpRPNKipSdBaUhuOubvFvjBpFAwiwSAapRDVsAgKvjXucfXpFfYb " |
| 510 |
"pCundbAXBWhbpHVbqgmGoixXzFSwUsGVYLPpBCiDlLJwzjRKYYaoVYge " |
| 511 |
"kMtKFYUVnWIKbectWkDFdVqXwkKigCUDiuTTJxOBRJRNzGiDNMWBjYSm " |
| 512 |
"bBCAHMaMYaghLbYTwyKXltdHTHwBwtswGNfpnEdSpKFzZJonBZArQfHD " |
| 513 |
"lfceKgmKwEF=", |
| 514 |
}, |
| 515 |
{ |
| 516 |
"key_tag": 12345, |
| 517 |
"algorithm": 8, |
| 518 |
"digest_type": 2, |
| 519 |
"digest": "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", |
| 520 |
"flags": 257, |
| 521 |
"protocol": 3, |
| 522 |
"public_key": "MuhdzsQdqEGShwjtJDKZZjdKqUSGluFzTTinpuEeIRzLLcgkwgAPKWFa " |
| 523 |
"eQntNlmcNDeCziGwpdvhJnvKXEMbFcZwsaDIJuWqERxAQNGABWfPlCLh " |
| 524 |
"HQPnbpRPNKipSdBaUhuOubvFvjBpFAwiwSAapRDVsAgKvjXucfXpFfYb " |
| 525 |
"pCundbAXBWhbpHVbqgmGoixXzFSwUsGVYLPpBCiDlLJwzjRKYYaoVYge " |
| 526 |
"kMtKFYUVnWIKbectWkDFdVqXwkKigCUDiuTTJxOBRJRNzGiDNMWBjYSm " |
| 527 |
"bBCAHMaMYaghLbYTwyKXltdHTHwBwtswGNfpnEdSpKFzZJonBZArQfHD " |
| 528 |
"lfceKgmKwEF=", |
| 529 |
}, |
| 530 |
], |
| 531 |
"records": [], |
| 532 |
} |
| 533 |
} |
| 534 |
|
| 535 |
HOSTTECH_JSON_ZONE_RECORDS_GET_RESULT = { |
| 536 |
"data": HOSTTECH_JSON_DEFAULT_ENTRIES, |
| 537 |
} |