-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Use micrometer context-propagation to propagate auth between threadlocal and reactor ops #13733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently we have a SecurityContextThreadLocalAccessor in Spring for GraphQL that I can see would be more generally applicable. Not sure if that belongs in this issue or another. |
@jzheaux Hey, I think I have some context here. I believe the change in #16665 adds optional support for the context-propagation in certain conditions:
while this issue in particular is suggesting that the existing mechanism that uses If @ttddyy agrees and the optional support gives the users everything required, we could close this issue. |
Yes, I agree — making it optional makes sense, and the necessary components are now in place. To improve the developer experience further, it would be helpful to update existing consumers of these propagated objects. It would be great if they could auto-detect the presence of the new thread-local accessors and use them when available — particularly If it's too much for now, it is probably nice to update the Javadoc to note that |
In spring mvc with reactive API, it uses a custom reactor subscriber, SecurityReactorContextSubscriber, to propagate the authentication and servlet request and response to the reactor operation chain. (Defined in
SecurityReactorContextConfiguration
imported byOAuth2ImportSelector
)The micrometer context-propagation library provides support for propagating such objects between threadlocal and reactor operation chains.
It is nice to migrate to it which aligns how micrometer observations are propagated as well as avoiding reactor corner cases that may not able to propagate by
Hooks.onLastOperator
.cc @sjohnr, @chemicL
relates to #11973
The text was updated successfully, but these errors were encountered: