Skip to content

Commit

Permalink
Allow to add DS RRs
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbertoli committed Jun 4, 2021
1 parent 92b8a5d commit c521b4d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cloudflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c521b4d

Please sign in to comment.