Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
CHANGELOG
=========

4.1.0
4.1.0 (2026-01-20)
------------------

* Added `anonymizer` property to `IpAddress` response model. This contains
information about whether the IP address is an anonymous network, including
confidence score, VPN provider name, and various anonymizer flags.
* Added `BANQUEST`, `SUMMIT_PAYMENTS`, and `YAADPAY` to the
`Payment.Processor` enum.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To do this, add the dependency to your pom.xml:
<dependency>
<groupId>com.maxmind.minfraud</groupId>
<artifactId>minfraud</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
</dependency>
```

Expand All @@ -29,7 +29,7 @@ repositories {
mavenCentral()
}
dependencies {
implementation 'com.maxmind.minfraud:minfraud:4.0.0'
implementation 'com.maxmind.minfraud:minfraud:4.1.0'
}
```

Expand Down Expand Up @@ -300,6 +300,6 @@ This API uses [Semantic Versioning](https://semver.org/).

## Copyright and License ##

This software is Copyright (c) 2015-2025 by MaxMind, Inc.
This software is Copyright (c) 2015-2026 by MaxMind, Inc.

This is free software, licensed under the Apache License, Version 2.0.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.maxmind.minfraud</groupId>
<artifactId>minfraud</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
<name>MaxMind minFraud API</name>
<description>MaxMind minFraud Score, Insights, Factors and Report Transaction API</description>
<url>http://dev.maxmind.com/minfraud</url>
Expand Down Expand Up @@ -53,22 +53,22 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.20.1</version>
<version>2.21.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.20.1</version>
<version>2.21.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.20</version>
<version>2.21</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.20.1</version>
<version>2.21.0</version>
</dependency>
<dependency>
<groupId>com.maxmind.geoip2</groupId>
Expand Down Expand Up @@ -96,7 +96,7 @@
<dependency>
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-objects</artifactId>
<version>2.20.1</version>
<version>2.21.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -252,7 +252,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.20.1</version>
<version>2.21.0</version>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
Expand All @@ -270,7 +270,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Baseline version for API compatibility checking. Update after each release. -->
<japicmp.baselineVersion>4.0.0</japicmp.baselineVersion>
<japicmp.baselineVersion>4.1.0</japicmp.baselineVersion>
</properties>

<distributionManagement>
Expand Down
43 changes: 42 additions & 1 deletion src/main/java/com/maxmind/minfraud/response/IpAddress.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.maxmind.minfraud.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.maxmind.geoip2.record.Anonymizer;
import com.maxmind.geoip2.record.City;
import com.maxmind.geoip2.record.Continent;
import com.maxmind.geoip2.record.Country;
Expand All @@ -14,6 +15,8 @@
/**
* This class contains minFraud response data related to the IP location.
*
* @param anonymizer Anonymizer record for the requested IP address. This contains
* information about whether the IP address is an anonymous network.
* @param city City record for the requested IP address.
* @param continent Continent record for the requested IP address.
* @param country Country record for the requested IP address.
Expand All @@ -29,6 +32,8 @@
* @param traits Traits record for the requested IP address.
*/
public record IpAddress(
@JsonProperty("anonymizer")
Anonymizer anonymizer,
@JsonProperty("city")
City city,

Expand Down Expand Up @@ -67,6 +72,7 @@ public record IpAddress(
* Compact canonical constructor that sets defaults for null values.
*/
public IpAddress {
anonymizer = anonymizer != null ? anonymizer : new Anonymizer();
location = location != null ? location : new GeoIp2Location();
riskReasons = riskReasons != null ? List.copyOf(riskReasons) : List.of();
subdivisions = subdivisions != null ? List.copyOf(subdivisions) : List.of();
Expand All @@ -77,7 +83,42 @@ public record IpAddress(
*/
public IpAddress() {
this(null, null, null, null, null, null,
null, null, null, null, null);
null, null, null, null, null, null);
}

/**
* Constructs an instance of {@code IpAddress}.
*
* @param city City record for the requested IP address.
* @param continent Continent record for the requested IP address.
* @param country Country record for the requested IP address.
* @param location Location record for the requested IP address.
* @param postal Postal record for the requested IP address.
* @param registeredCountry Registered country record for the requested IP address.
* @param representedCountry Represented country record for the requested IP address.
* @param risk The risk associated with the IP address.
* @param riskReasons List of risk reason objects.
* @param subdivisions List of subdivision records for the requested IP address.
* @param traits Traits record for the requested IP address.
* @deprecated Use the canonical constructor instead. This constructor will be removed in 5.0.0.
*/
@Deprecated(since = "4.1.0", forRemoval = true)
public IpAddress(
City city,
Continent continent,
Country country,
GeoIp2Location location,
Postal postal,
Country registeredCountry,
RepresentedCountry representedCountry,
Double risk,
List<IpRiskReason> riskReasons,
List<Subdivision> subdivisions,
Traits traits
) {
this(null, city, continent, country, location, postal,
registeredCountry, representedCountry, risk, riskReasons,
subdivisions, traits);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.fasterxml.jackson.jr.ob.JSON;
Expand All @@ -28,6 +29,17 @@ public void testInsights() throws Exception {
.end()
.end()
.startObjectField("ip_address")
.startObjectField("anonymizer")
.put("confidence", 99)
.put("is_anonymous", true)
.put("is_anonymous_vpn", true)
.put("is_hosting_provider", true)
.put("is_public_proxy", true)
.put("is_residential_proxy", true)
.put("is_tor_exit_node", true)
.put("network_last_seen", "2025-01-15")
.put("provider_name", "TestVPN")
.end()
.startObjectField("country")
.put("iso_code", "US")
.end()
Expand Down Expand Up @@ -120,5 +132,25 @@ public void testInsights() throws Exception {
);
assertEquals("152.216.7.110", insights.ipAddress().traits().ipAddress().getHostAddress());
assertEquals("81.2.69.0/24", insights.ipAddress().traits().network().toString());

// Test anonymizer
assertNotNull(insights.ipAddress().anonymizer(), "anonymizer should not be null");
assertEquals(
Integer.valueOf(99),
insights.ipAddress().anonymizer().confidence(),
"correct anonymizer confidence"
);
assertTrue(insights.ipAddress().anonymizer().isAnonymous(), "correct isAnonymous");
assertTrue(insights.ipAddress().anonymizer().isAnonymousVpn(), "correct isAnonymousVpn");
assertTrue(insights.ipAddress().anonymizer().isHostingProvider(), "correct isHostingProvider");
assertTrue(insights.ipAddress().anonymizer().isPublicProxy(), "correct isPublicProxy");
assertTrue(insights.ipAddress().anonymizer().isResidentialProxy(), "correct isResidentialProxy");
assertTrue(insights.ipAddress().anonymizer().isTorExitNode(), "correct isTorExitNode");
assertEquals(
LocalDate.parse("2025-01-15"),
insights.ipAddress().anonymizer().networkLastSeen(),
"correct networkLastSeen"
);
assertEquals("TestVPN", insights.ipAddress().anonymizer().providerName(), "correct providerName");
}
}
11 changes: 11 additions & 0 deletions src/test/resources/test-data/factors-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
"reason": "Suspicious activity has been seen on this IP address across minFraud customers."
}
],
"anonymizer": {
"confidence": 99,
"is_anonymous": true,
"is_anonymous_vpn": true,
"is_hosting_provider": true,
"is_public_proxy": true,
"is_residential_proxy": true,
"is_tor_exit_node": true,
"network_last_seen": "2025-01-15",
"provider_name": "TestVPN"
},
"city": {
"confidence": 42,
"geoname_id": 2643743,
Expand Down
11 changes: 11 additions & 0 deletions src/test/resources/test-data/insights-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
"reason": "Suspicious activity has been seen on this IP address across minFraud customers."
}
],
"anonymizer": {
"confidence": 99,
"is_anonymous": true,
"is_anonymous_vpn": true,
"is_hosting_provider": true,
"is_public_proxy": true,
"is_residential_proxy": true,
"is_tor_exit_node": true,
"network_last_seen": "2025-01-15",
"provider_name": "TestVPN"
},
"city": {
"confidence": 42,
"geoname_id": 2643743,
Expand Down
Loading