浏览代码

feat(api): enable SMIMEA record type support, fixes #436

Peter Thomassen 4 年之前
父节点
当前提交
0c63f03ba7
共有 3 个文件被更改,包括 7 次插入7 次删除
  1. 1 1
      api/desecapi/tests/base.py
  2. 3 3
      api/desecapi/tests/test_rrsets.py
  3. 3 3
      test/e2e2/spec/test_api_rr_validation.py

+ 1 - 1
api/desecapi/tests/base.py

@@ -635,7 +635,7 @@ class DesecTestCase(MockPDNSTestCase):
                        'kota.aichi.jp', 's3.amazonaws.com', 'wildcard.ck'}
     SUPPORTED_RR_SET_TYPES = {'A', 'AAAA', 'AFSDB', 'CAA', 'CERT', 'CNAME', 'DHCID', 'DLV', 'DS', 'EUI48', 'EUI64',
                               'HINFO', 'KX', 'LOC', 'MX', 'NAPTR', 'NS', 'OPENPGPKEY', 'PTR', 'RP',
-                              'SPF', 'SRV', 'SSHFP', 'TLSA', 'TXT', 'URI'}
+                              'SMIMEA', 'SPF', 'SRV', 'SSHFP', 'TLSA', 'TXT', 'URI'}
 
     admin = None
     auto_delegation_domains = None

+ 3 - 3
api/desecapi/tests/test_rrsets.py

@@ -369,7 +369,7 @@ class AuthenticatedRRSetTestCase(AuthenticatedRRSetBaseTestCase):
                             'mG8EXtVIsRMFK4EEACIDAwQSZPNqE4tSxLFJYhX+uabSgMrhOqUizJhkLx82')),
             ('PTR', ('EXAMPLE.COM.', 'example.com.')),
             ('RP', ('hostmaster.EXAMPLE.com. .', 'hostmaster.example.com. .')),
-            # ('SMIMEA', ('3 01 0 aaBBccddeeff', '3 1 0 aabbccddeeff')),
+            ('SMIMEA', ('3 01 0 aaBBccddeeff', '3 1 0 aabbccddeeff')),
             ('SPF', ('"v=spf1 ip4:10.1" ".1.1 ip4:127" ".0.0.0/16 ip4:192.168.0.0/27 include:example.com -all"',
                      '"v=spf1 ip4:10.1" ".1.1 ip4:127" ".0.0.0/16 ip4:192.168.0.0/27 include:example.com -all"')),
             ('SPF', ('"foo" "bar"', '"foo" "bar"')),
@@ -436,7 +436,7 @@ class AuthenticatedRRSetTestCase(AuthenticatedRRSetBaseTestCase):
             ],
             'PTR': ['example.com.', '*.example.com.'],
             'RP': ['hostmaster.example.com. .'],
-            # 'SMIMEA': ['3 1 0 aabbccddeeff'],
+            'SMIMEA': ['3 1 0 aabbccddeeff'],
             'SPF': ['"v=spf1 include:example.com ~all"',
                     '"v=spf1 ip4:10.1.1.1 ip4:127.0.0.0/16 ip4:192.168.0.0/27 include:example.com -all"',
                     '"spf2.0/pra,mfrom ip6:2001:558:fe14:76:68:87:28:0/120 -all"'],
@@ -487,7 +487,7 @@ class AuthenticatedRRSetTestCase(AuthenticatedRRSetBaseTestCase):
             'OPENPGPKEY': ['1 2 3'],
             'PTR': ['"example.com."', '10 *.example.com.'],
             'RP': ['hostmaster.example.com.', '10 foo.'],
-            # 'SMIMEA': ['3 1 0 aGVsbG8gd29ybGQh'],
+            'SMIMEA': ['3 1 0 aGVsbG8gd29ybGQh'],
             'SPF': ['"v=spf1', 'v=spf1 include:example.com ~all'],
             'SRV': ['0 0 0 0', '100 5061 example.com.'],
             'SSHFP': ['aabbcceeddff'],

+ 3 - 3
test/e2e2/spec/test_api_rr_validation.py

@@ -97,7 +97,7 @@ VALID_RECORDS_CANONICAL = {
     ],
     'PTR': ['example.com.', '*.example.com.'],
     'RP': ['hostmaster.example.com. .'],
-    # 'SMIMEA': ['3 1 0 aabbccddeeff'],
+    'SMIMEA': ['3 1 0 aabbccddeeff'],
     'SPF': [
         '"v=spf1 ip4:10.1" ".1.1 ip4:127" ".0.0.0/16 ip4:192.168.0.0/27 include:example.com -all"',
         '"v=spf1 include:example.com ~all"',
@@ -204,7 +204,7 @@ VALID_RECORDS_NON_CANONICAL = {
     ],
     'PTR': ['EXAMPLE.TEST.'],
     'RP': ['hostmaster.EXAMPLE.com. .'],
-    # 'SMIMEA': ['3 01 0 aabbccDDeeff'],
+    'SMIMEA': ['3 01 0 aabbccDDeeff'],
     'SPF': [],
     'SRV': ['100 01 5061 example.com.'],
     'SSHFP': ['02 2 aabbcceeddff'],
@@ -243,7 +243,7 @@ INVALID_RECORDS = {
     'OPENPGPKEY': ['1 2 3'],
     'PTR': ['"example.com."', '10 *.example.com.'],
     'RP': ['hostmaster.example.com.', '10 foo.'],
-    # 'SMIMEA': ['3 1 0 aGVsbG8gd29ybGQh', 'x 0 0 aabbccddeeff'],
+    'SMIMEA': ['3 1 0 aGVsbG8gd29ybGQh', 'x 0 0 aabbccddeeff'],
     'SPF': ['"v=spf1', 'v=spf1 include:example.com ~all'],
     'SRV': ['0 0 0 0', '100 5061 example.com.'],
     'SSHFP': ['aabbcceeddff'],