Closed aimuz closed 8 months ago
Pinging @elastic/kibana-platform (Team:Platform)
Not allowing to override the response body from plugin interceptors is a voluntary, opinionated decision from the kibana platform API.
Can you add more details on the usage you would need this feature for? If you only need to override your own plugin's routing behavior, a simple HOC wrapper around your route handler(s) should be sufficient:
Or expose the interface completely
FYI, the underlying http lib used is now an implementation detail. The platform will now longer expose 'direct' access to HAPI API (or any replacement we might be using in the futur).
In fact, I hope to use this method to customize authentication as a middleware to intercept all requests and verify whether they have been logged in
@aimuz seems that https://github.com/elastic/kibana/pull/75538 might add such functionality
Describe the feature: I'm developing a plug-in, but I don't find support for middleware functionality. The only thing I found was
core.http.registerOnPreResponse
But this interface is too limited to implement the function I wantI want to have an interface that enables you to override the response instead of just adding headers
core.http.registerOnPreResponse
At present, the only function that can be implemented is to add a header. I think this function is incomplete.Describe a specific use case for the feature:
There may be a better way Or expose the interface completely
https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents
Through this interface, you can implement more powerful plug-ins