opensearch-project / opensearch-plugins

For all things OpenSearch plugins. You want to install, or develop a plugin? You've come to the right place.
Apache License 2.0
51 stars 61 forks source link

Create proof of concept for removing jackson-databind from plugins #211

Open ryanbogan opened 1 year ago

ryanbogan commented 1 year ago

Following discussion on https://github.com/opensearch-project/OpenSearch/issues/5504, it is clear that jackson-databind is not an ideal long term solution for both core and plugins. The jackson-databind library contains ObjectMapper, which uses a reflective access permission with no way to mitigate the access. On the other hand, the GSON library allows filters to be placed to limit the reflective access permission. Based on the suggestions in the linked issue and my own research, a combination of GSON for JSON functionality and SnakeYAML for YAML functionality appears to be the best way forward. A proof of concept is needed to provide an example of how to perform this change.

So far, I have removed several occurrences of ObjectMapper from the SQL plugin on a local machine. Following further research and exploration, a PR (maybe draft) will be raised to demonstrate different use cases where ObjectMapper from jackson-databind can be replaced by GSON. This issue will track the progress of the proof of concept.