aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Aquifoliales <103569748+Aquifoliales@users.noreply.github.com> 2022-04-13 12:58:28 +0200
committerGravatar Aquifoliales <103569748+Aquifoliales@users.noreply.github.com> 2022-04-13 12:58:28 +0200
commit22ef21550a817afc5b6388e7d62ed1eedb92f970 (patch)
treeac46dc88a32c229730ed0593109821e5bd5dfe81
parent36293a920cbfcf898256393f9f45aa2223734bdf (diff)
downloadoctodns-custom-provider-22ef21550a817afc5b6388e7d62ed1eedb92f970.tar.gz
Fixed support for CAA-, TXT- and MultiPTR-Records. Added support for SSHFP- and TLSA-Records
-rw-r--r--[-rwxr-xr-x]octodns-custom-providers/provider/zonefile.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/octodns-custom-providers/provider/zonefile.py b/octodns-custom-providers/provider/zonefile.py
index f112cf2..dd36c65 100755..100644
--- a/octodns-custom-providers/provider/zonefile.py
+++ b/octodns-custom-providers/provider/zonefile.py
@@ -14,10 +14,25 @@ class RdataParameterException(Exception):
def _create_rdata( rdclass, rdtype, data ):
if isinstance(data,str):
+ if rdtype == 16: # TXT-Record
+ return dns.rdata.from_text(rdclass, rdtype, '"'+data+'"')
return dns.rdata.from_text(rdclass, rdtype, data)
cls = dns.rdata.get_rdata_class(rdclass, rdtype)
+ if rdtype == 257: # CAA-Record
+ data['tag'] = bytes(data['tag'], 'utf-8')
+ data['value'] = bytes(data['value'], 'utf-8')
+
+ if rdtype == 44: # SSHFP-Record
+ data['fp_type'] = data.pop('fingerprint_type')
+ data['fingerprint'] = bytes.fromhex(data['fingerprint'])
+
+ if rdtype == 52: # TLSA-Record
+ data['usage'] = data.pop('certificate_usage')
+ data['mtype'] = data.pop('matching_type')
+ data['cert'] = bytes.fromhex(data.pop('certificate_association_data'))
+
for slot in cls.__slots__:
if not slot in data:
raise RdataParameterException('{} is missing'.format(slot))
@@ -25,10 +40,10 @@ def _create_rdata( rdclass, rdtype, data ):
return cls(rdclass, rdtype, **data)
class ZoneFileProvider(BaseProvider):
-
+ SUPPORTS_MULTIVALUE_PTR = True
SUPPORTS_GEO = False
SUPPORTS = set(('A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SPF',
- 'SRV', 'TXT'))
+ 'SRV', 'SSHFP', 'TLSA', 'TXT'))
'''
SOA dict