-
Notifications
You must be signed in to change notification settings - Fork 207
Add residential proxy data to Anonymizer record #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,9 @@ | |
| * @param providerName The name of the VPN provider (e.g., NordVPN, SurfShark, etc.) associated | ||
| * with the network. This is only available from the GeoIP Insights | ||
| * web service. | ||
| * @param residential Residential proxy data for the network. This may be populated even when | ||
| * none of the other fields on this record are set. This is only available | ||
| * from the GeoIP Insights web service. | ||
| */ | ||
| public record Anonymizer( | ||
| @JsonProperty("confidence") | ||
|
|
@@ -58,14 +61,69 @@ public record Anonymizer( | |
| LocalDate networkLastSeen, | ||
|
|
||
| @JsonProperty("provider_name") | ||
| String providerName | ||
| String providerName, | ||
|
|
||
| @JsonProperty("residential") | ||
| AnonymizerFeed residential | ||
| ) implements JsonSerializable { | ||
|
|
||
| /** | ||
| * Compact canonical constructor that sets a default for a null {@code residential} value. | ||
| */ | ||
| public Anonymizer { | ||
| residential = residential != null ? residential : new AnonymizerFeed(); | ||
| } | ||
|
|
||
| /** | ||
| * Constructs an {@code Anonymizer} record with {@code null} values for all the nullable | ||
| * fields and {@code false} for all boolean fields. | ||
| * fields and {@code false} for all boolean fields. The {@code residential} field defaults | ||
| * to an empty {@code AnonymizerFeed} rather than {@code null}. | ||
| */ | ||
| public Anonymizer() { | ||
| this(null, false, false, false, false, false, false, null, null); | ||
| this(null, false, false, false, false, false, false, null, null, null); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doc (minor): the no-arg constructor's JavaDoc says it "Constructs an — Claude, on behalf of Will
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Claude, on behalf of Greg: Good catch — fixed in c468a20. The no-arg constructor's JavaDoc now notes that |
||
| } | ||
|
|
||
| /** | ||
| * Constructs an {@code Anonymizer} record without the {@code residential} field. | ||
| * | ||
| * @param confidence the confidence that the network is an actively used VPN service | ||
| * @param isAnonymous whether the IP address belongs to any sort of anonymous network | ||
| * @param isAnonymousVpn whether the IP address is registered to an anonymous VPN provider | ||
| * @param isHostingProvider whether the IP address belongs to a hosting or VPN provider | ||
| * @param isPublicProxy whether the IP address belongs to a public proxy | ||
| * @param isResidentialProxy whether the IP address is on a suspected anonymizing network | ||
| * and belongs to a residential ISP | ||
| * @param isTorExitNode whether the IP address is a Tor exit node | ||
| * @param networkLastSeen the last day that the network was sighted in our analysis of | ||
| * anonymized networks | ||
| * @param providerName the name of the VPN provider associated with the network | ||
| * @deprecated Use the canonical constructor that also accepts the {@code residential} | ||
| * field. This constructor is provided for backward compatibility and will be | ||
| * removed in version 6.0.0. | ||
| */ | ||
| @Deprecated(since = "5.2.0", forRemoval = true) | ||
| public Anonymizer( | ||
| Integer confidence, | ||
| boolean isAnonymous, | ||
| boolean isAnonymousVpn, | ||
| boolean isHostingProvider, | ||
| boolean isPublicProxy, | ||
| boolean isResidentialProxy, | ||
| boolean isTorExitNode, | ||
| LocalDate networkLastSeen, | ||
| String providerName | ||
| ) { | ||
| this( | ||
| confidence, | ||
| isAnonymous, | ||
| isAnonymousVpn, | ||
| isHostingProvider, | ||
| isPublicProxy, | ||
| isResidentialProxy, | ||
| isTorExitNode, | ||
| networkLastSeen, | ||
| providerName, | ||
| null | ||
| ); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package com.maxmind.geoip2.record; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.maxmind.geoip2.JsonSerializable; | ||
| import java.time.LocalDate; | ||
|
|
||
| /** | ||
| * <p> | ||
| * Contains data for one type of anonymizer detection, currently residential proxies. Additional | ||
| * feeds, such as VPNs, mobile networks, and hosting or datacenter providers, may be added to the | ||
| * {@link Anonymizer} record in the future using this same record type. | ||
| * </p> | ||
| * <p> | ||
| * This record is returned by the GeoIP Insights web service. | ||
| * </p> | ||
| * | ||
| * @param confidence A score ranging from 1 to 99 that represents our percent confidence that | ||
| * the network is currently part of this anonymizer feed. This is only | ||
| * available from the GeoIP Insights web service. | ||
| * @param networkLastSeen The last day that the network was sighted in our analysis of this | ||
| * anonymizer feed. This is only available from the GeoIP Insights web | ||
| * service. | ||
| * @param providerName The name of the provider associated with the network in this anonymizer | ||
| * feed. This is only available from the GeoIP Insights web service. | ||
| */ | ||
| public record AnonymizerFeed( | ||
| @JsonProperty("confidence") | ||
| Integer confidence, | ||
|
|
||
| @JsonProperty("network_last_seen") | ||
| LocalDate networkLastSeen, | ||
|
|
||
| @JsonProperty("provider_name") | ||
| String providerName | ||
| ) implements JsonSerializable { | ||
|
|
||
| /** | ||
| * Constructs an {@code AnonymizerFeed} record with {@code null} values for all fields. | ||
| */ | ||
| public AnonymizerFeed() { | ||
| this(null, null, null); | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.