Elasticsearch plugin development : Customising existing REST endpoints

Consider a scenario where every request to elasticsearch's HTTP endpoints has additional header information (set by an upstream server). I would like to use the header information in a request and some global configuration to allow or deny the request.

I've been looking at various posts on plugin development for elasticsearch. But, they all seem to concentrate on creating new endpoints and adding new functionality.

In my case, I would like to add some more logic into the handlers of existing endpoints. Looking at elasticsearch's source code, the custom logic would go into handleRequest of each Rest*Action, but, I see no mechanism for hooking into these. Is this possible? What are your suggestions?

1 Like