Context propagation from interceptor to serverLogic

Hi, I need to access value computed in interceptor inside of serverLogic, is there any ideomatic way to do that?

What exactly do you want to compute in the interceptor? Have you checked RequestInterceptor? It can be used to transform server request to some extent using RequestInterceptor.transformServerRequest

docs: Interceptors — tapir 1.x documentation
example: tapir/server/pekko-http-server/src/test/scala/sttp/tapir/server/pekkohttp/PekkoHttpServerTest.scala at e28308f1670cd75ece764cb924e97b0e43c5b357 · softwaremill/tapir · GitHub

1 Like

And in the RequestInterceptor, you can set an attribute using .attribute(k, v). In the endpoint definition, you can extract this value using the extractFromRequest input.

1 Like

Thanks, thats what I thought about.