From ace08608801aa9bcd54de74b8c01fb094b2e22b8 Mon Sep 17 00:00:00 2001 From: Ankur Malik Date: Thu, 21 May 2026 13:31:48 -0400 Subject: [PATCH] Add THX SSN hash parsing --- block.py | 1 + pre_processing.py | 1 + response_schema.json | 4 ++++ test_block.py | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/block.py b/block.py index ba04b80..88b878b 100644 --- a/block.py +++ b/block.py @@ -185,6 +185,7 @@ expressions = { "account_login_first_seen": ["Blob.account_login_first_seen"], "account_telephone_first_seen": ["Blob.account_telephone_first_seen"], "true_ip_first_seen": ["Blob.true_ip_first_seen"], + "ssn_hash": ["Blob.ssn_hash"], "ssn_hash_first_seen": ["Blob.ssn_hash_first_seen"], "fuzzy_device_first_seen": ["Blob.fuzzy_device_first_seen"], "national_id_first_seen": ["Blob.national_id_first_seen"], diff --git a/pre_processing.py b/pre_processing.py index 7c6df03..13f2430 100644 --- a/pre_processing.py +++ b/pre_processing.py @@ -25,6 +25,7 @@ THX_FIELDS = [ "account_login_first_seen", "account_telephone_first_seen", "true_ip_first_seen", + "ssn_hash", "ssn_hash_first_seen", "account_email_attributes", "tps_ip_latitude", diff --git a/response_schema.json b/response_schema.json index 36be650..017a4db 100644 --- a/response_schema.json +++ b/response_schema.json @@ -62,6 +62,10 @@ "type": ["string", "null"], "description": "SSN hash first seen timestamp" }, + "ssn_hash": { + "type": ["string", "null"], + "description": "SSN hash from ThreatMetrix" + }, "account_email_attributes": { "type": ["string", "null"], "description": "Account email attributes" diff --git a/test_block.py b/test_block.py index f894e6e..af9ab2a 100644 --- a/test_block.py +++ b/test_block.py @@ -50,6 +50,7 @@ class TestBlock(unittest.TestCase): "account_login_first_seen", "account_telephone_first_seen", "true_ip_first_seen", + "ssn_hash", "ssn_hash_first_seen", "account_email_attributes", "tps_ip_latitude", @@ -60,6 +61,10 @@ class TestBlock(unittest.TestCase): self.assertEqual(result["input_ip_address"], "2600:387:15:5211::a") self.assertEqual(result["input_ip_connection_type"], "tx") self.assertEqual(result["input_ip_isp"], "at&t enterprises llc") + self.assertEqual( + result["ssn_hash"], + "7aaab71d9a569704e3f7b56748796287a16e473813801612d4755d7e0c7a6069", + ) # self.assertAlmostEqual(float(result["hd_score_m1"]), 1145.0, delta=1.0) # self.assertAlmostEqual(float(result["hd_score_m2"]), 1182.0, delta=1.0) # self.assertAlmostEqual(float(result["hd_score_iso_m2"]), 1061.0, delta=1.0)