Access request attributes supplied by EndpointInterceptor

Hi,

Is it possible to access attributes populated by EndpointInterceptor?
My use case, trying to extract some observability logic, and I found endpoint context to be useful in order to get template path / principal.
However, I can not find a way, to pass any information from EndpointInterceptor to serverLogic.

What I’ve tried:
mutate the context:

endpointHandler.onDecodeSuccess(ctx.copy(request = ctx.request.attribute(ContextAttributeKey, context)))

Attempt to extractFromRequest, but EndpointInterceptor executed after input extractor.

Alternatively, providing a way to access raw ServerRequest after all Request/Endpoint interceptors in server logic works as well.

Thanks!

Looking at Context propagation from interceptor to serverLogic
I want to achieve the same, but not in RequestInterceptor, but in EndpointInterceptor to have access to EndpointContext.

I`ve finally ended with IOLocal for that. In my case I wanted to log usernames in requests logger, but usernames are available only within securityLogic part of endpoint

I want to achieve the same, but not in RequestInterceptor, but in EndpointInterceptor to have access to EndpointContext.

The problem with this would be that in EndpointInterceptor.onDecodeSuccess, the endpoint’s values are already decoded, so all extractFromRequest are already completed. I think the only way to pas information at that stage is altering the decoded values (however they might be of an arbitrary shape), or using thread-local-like values, such as IOLocal.