add support for CAA records
[zonemaker.git] / zone.py
diff --git a/zone.py b/zone.py
index a74ee1858361619774a8f12ba8748b279ed18d64..d325915074b943a9ee11aeaddf1aa3fe0417e163 100644 (file)
--- a/zone.py
+++ b/zone.py
@@ -259,6 +259,19 @@ class TLSA:
     def generate_rr(self):
         return RR('_{}._{}'.format(self._port, self._protocol), 'TLSA', '{} {} {} {}'.format(self._usage, self._selector, self._matching_type, self._data))
 
+class CAA:
+    class Tag:
+        Issue = "issue"
+        IssueWild = "issuewild"
+
+    def __init__(self, flag: int, tag: str, value: str) -> None:
+        self._flag = int(flag)
+        self._tag = str(tag)
+        self._value = str(value)
+
+    def generate_rr(self):
+        return RR('@', 'CAA', '{} {} {}'.format(self._flag, self._tag, self._value))
+
 
 class CNAME:
     def __init__(self, name: str) -> None: