From 4e3d9f9620c9f8c15effea95756257fd06834768 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 10 Sep 2026 16:41:57 +0200 Subject: feat: add the destination table, transcribed from vendor docs Names what each report destination accepts (misp: any type, abusedb: ipv4/ipv6, urlhaus: url), read from each vendor's own API documentation on 2026-09-10. Nothing consumes it yet. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_0176FYdVfpzUq8S9jecqQqL6 --- tests/test_report.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/test_report.py') diff --git a/tests/test_report.py b/tests/test_report.py index c8c39f8..6d1f845 100644 --- a/tests/test_report.py +++ b/tests/test_report.py @@ -2029,3 +2029,23 @@ class PersonalisedSubject(unittest.TestCase): # the fix is a redaction rule with its own tests, not a passthrough # quietly turned into a filter. self.assertIn("alicejones", self._headers()["Subject"]) + + +class DestinationTable(unittest.TestCase): + def test_every_destination_names_the_types_it_accepts(self): + self.assertEqual(report.DESTINATIONS["abusedb"]["accepts"], + ("ipv4", "ipv6")) + self.assertEqual(report.DESTINATIONS["urlhaus"]["accepts"], ("url",)) + self.assertEqual(report.DESTINATIONS["misp"]["accepts"], report.ALL_TYPES) + + def test_misp_is_its_own_kind_and_the_vendors_are_api(self): + self.assertEqual(report.DESTINATIONS["misp"]["kind"], "misp") + self.assertEqual(report.DESTINATIONS["abusedb"]["kind"], "api") + self.assertEqual(report.DESTINATIONS["urlhaus"]["kind"], "api") + + def test_all_types_covers_what_parse_emits(self): + # The five type strings parse.py writes. A sixth arriving without a + # decision about which destinations accept it would silently reach + # MISP only, so this test names them rather than deriving them. + self.assertEqual(report.ALL_TYPES, + ("ipv4", "ipv6", "domain", "url", "sha256")) -- cgit v1.2.3