Skip to content

Commit d9a779d

Browse files
oschwaldclaude
andcommitted
Add residential property to anonymizer object
Surface the residential sub-object added to the anonymizer object in the underlying GeoIP2 library (since 3.4.0). The IpAddress model already exposes GeoIp2\Record\Anonymizer directly, so this is a test fixture and CHANGELOG update only; no model code changes are needed. STF-997 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent daa5944 commit d9a779d

4 files changed

Lines changed: 44 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ CHANGELOG
44
3.7.0
55
------------------
66

7+
* Added the `residential` property to the `anonymizer` object on
8+
`MaxMind\MinFraud\Model\IpAddress`. This is a `GeoIp2\Record\AnonymizerFeed`
9+
object providing residential proxy data for the network: `confidence`,
10+
`networkLastSeen`, and `providerName`. It may be populated even when no
11+
other anonymizer properties are set. This data is available from the
12+
minFraud Insights and Factors web services. This requires
13+
`geoip2/geoip2` 3.4.0 or greater.
714
* Added `tracking_token` to the `/device` request object. This is the
815
token generated by the
916
[Device Tracking Add-on](https://dev.maxmind.com/minfraud/track-devices)

tests/MaxMind/Test/MinFraud/Model/InsightsTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace MaxMind\Test\MinFraud\Model;
66

7+
use GeoIp2\Record\AnonymizerFeed;
78
use MaxMind\MinFraud\Model\Insights;
89
use MaxMind\MinFraud\Model\Score;
910
use MaxMind\Test\MinFraudData as Data;
@@ -156,6 +157,30 @@ public function testInsightsProperties(): void
156157
'correct anonymizer network last seen'
157158
);
158159

160+
$this->assertInstanceOf(
161+
AnonymizerFeed::class,
162+
$insights->ipAddress->anonymizer->residential,
163+
'anonymizer residential is an AnonymizerFeed'
164+
);
165+
166+
$this->assertSame(
167+
$array['ip_address']['anonymizer']['residential']['confidence'],
168+
$insights->ipAddress->anonymizer->residential->confidence,
169+
'correct anonymizer residential confidence'
170+
);
171+
172+
$this->assertSame(
173+
$array['ip_address']['anonymizer']['residential']['network_last_seen'],
174+
$insights->ipAddress->anonymizer->residential->networkLastSeen,
175+
'correct anonymizer residential network last seen'
176+
);
177+
178+
$this->assertSame(
179+
$array['ip_address']['anonymizer']['residential']['provider_name'],
180+
$insights->ipAddress->anonymizer->residential->providerName,
181+
'correct anonymizer residential provider name'
182+
);
183+
159184
$this->assertSame(
160185
$array['billing_phone']['country'],
161186
$insights->billingPhone->country,

tests/data/minfraud/factors-response.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@
120120
"is_public_proxy": true,
121121
"is_tor_exit_node": true,
122122
"network_last_seen": "2025-01-15",
123-
"provider_name": "TestVPN"
123+
"provider_name": "TestVPN",
124+
"residential": {
125+
"confidence": 82,
126+
"network_last_seen": "2026-05-11",
127+
"provider_name": "quickshift"
128+
}
124129
}
125130
},
126131
"billing_address": {

tests/data/minfraud/insights-response.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@
120120
"is_public_proxy": true,
121121
"is_tor_exit_node": true,
122122
"network_last_seen": "2025-01-15",
123-
"provider_name": "TestVPN"
123+
"provider_name": "TestVPN",
124+
"residential": {
125+
"confidence": 82,
126+
"network_last_seen": "2026-05-11",
127+
"provider_name": "quickshift"
128+
}
124129
}
125130
},
126131
"billing_address": {

0 commit comments

Comments
 (0)