Skip to content

Commit

Permalink
Bump geoip2 from 2.16.1 to 3.0.1 in /modules/ingest-geoip (#2646) (#2790
Browse files Browse the repository at this point in the history
)

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

Bumps [geoip2](https://github.com/maxmind/GeoIP2-java) from 2.16.1 to 3.0.1.
- [Release notes](https://github.com/maxmind/GeoIP2-java/releases)
- [Changelog](https://github.com/maxmind/GeoIP2-java/blob/main/CHANGELOG.md)
- [Commits](maxmind/GeoIP2-java@v2.16.1...v3.0.1)

---
updated-dependencies:
- dependency-name: com.maxmind.geoip2:geoip2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updating SHAs

Signed-off-by: dependabot[bot] <support@github.com>

* Fix breaking change with geoip2 version 3.0.1.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fix precommit failures caused by ignoreMissingClasses check.

Precommit is failing because forbiddenApis was configured to ignore missing classes
that are present.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Change asn in GeoIpProcessorTests from int to long.

Signed-off-by: Marc Handalian <handalm@amazon.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marc Handalian <handalm@amazon.com>
(cherry picked from commit ce5c55d)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 8bad956 commit 45365e0
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 22 deletions.
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

0 comments on commit 45365e0

Please sign in to comment.