From c521b4d3ef152945abc78f17b603f51bc8ed692b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20B=C3=A9rtoli?= Date: Fri, 4 Jun 2021 17:05:26 -0300 Subject: [PATCH] Allow to add DS RRs Fixes #14 --- cloudflare.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cloudflare.py b/cloudflare.py index 94d1db5..2f82bc3 100644 --- a/cloudflare.py +++ b/cloudflare.py @@ -195,6 +195,21 @@ def data(self): "tag": tag, "value": value[1:-1], } + if self.type == "DS": + # See https://api.cloudflare.com/#dns-records-for-a-zone-properties + # DS record / data + # key_tag = 0-65535 + # algorithm = 0-255 + # digest_type = 0-255 + # digest = string + parts = self.content.split(" ") + key_tag, algorithm, digest_type, digest = parts + return { + "key_tag": int(key_tag), + "algorithm": int(algorithm), + "digest_type": int(digest_type), + "digest": digest, + } def __str__(self): ttl_str = 'auto' if self.ttl == 1 else '{0}s'.format(self.ttl)