Skip to content
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

Bump geoip2 from 2.16.1 to 3.0.1 in /modules/ingest-geoip #2646

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
20 changes: 1 addition & 19 deletions modules/ingest-geoip/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ opensearchplugin {
}

dependencies {
api('com.maxmind.geoip2:geoip2:2.16.1')
api('com.maxmind.geoip2:geoip2:3.0.1')
// geoip2 dependencies:
api("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
api("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}")
Expand Down Expand Up @@ -67,24 +67,6 @@ tasks.named("bundlePlugin").configure {
}
}

tasks.named("thirdPartyAudit").configure {
ignoreMissingClasses(
// geoip WebServiceClient needs apache http client, but we're not using WebServiceClient:
'org.apache.http.HttpEntity',
'org.apache.http.HttpResponse',
'org.apache.http.StatusLine',
'org.apache.http.client.config.RequestConfig$Builder',
'org.apache.http.client.config.RequestConfig',
'org.apache.http.client.methods.CloseableHttpResponse',
'org.apache.http.client.methods.HttpGet',
'org.apache.http.client.utils.URIBuilder',
'org.apache.http.impl.auth.BasicScheme',
'org.apache.http.impl.client.CloseableHttpClient',
'org.apache.http.impl.client.HttpClientBuilder',
'org.apache.http.util.EntityUtils'
)
}

if (Os.isFamily(Os.FAMILY_WINDOWS)) {
tasks.named("test").configure {
// Windows cannot cleanup database files properly unless it loads everything on heap.
Expand Down
1 change: 0 additions & 1 deletion modules/ingest-geoip/licenses/geoip2-2.16.1.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions modules/ingest-geoip/licenses/geoip2-3.0.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8a814ae92a1d8c35f82d0ff76d86927c191b7916
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ private Map<String, Object> retrieveAsnGeoData(InetAddress ipAddress) {
})
);

Integer asn = response.getAutonomousSystemNumber();
Long asn = response.getAutonomousSystemNumber();
String organization_name = response.getAutonomousSystemOrganization();
Network network = response.getNetwork();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void testAsn() throws Exception {
Map<String, Object> geoData = (Map<String, Object>) ingestDocument.getSourceAndMetadata().get("target_field");
assertThat(geoData.size(), equalTo(4));
assertThat(geoData.get("ip"), equalTo(ip));
assertThat(geoData.get("asn"), equalTo(1136));
assertThat(geoData.get("asn"), equalTo(1136L));
assertThat(geoData.get("organization_name"), equalTo("KPN B.V."));
assertThat(geoData.get("network"), equalTo("82.168.0.0/14"));
}
Expand Down