I made an attempt and it somehow worked but if another filter do the same the handler will end up with a request proxying a request proxying a request etc and I am not sure how to retrieve the right level containing my data.
Here's my sample in memory session filter. The filter creates a RequestWithSession and pass it to the service.
An implicit is used to retrieve the RequestWithSession from the Request (I had to climb two levels in my test but may be it could end with request.request.request if another filter is involved, I am not sure?).
The usage is:
Trying to cast to RequestWithSession and climbing up the hierarchy until it work may be a workaround but it feels wrong :)
I know it's not recommended by Finagle but since a user cannot easily modify the whole framework signature, maybe a request context could do the trick ?
I am quite new to finagle and finatra and still a beginner with scala so there must be a nicer way of doing this, any info is very much appreciated :)