Fix for - ReactiveSecurityContextHolder is empty inside @QueryHandler in Spring WebFlux applications #4207#4236
Fix for - ReactiveSecurityContextHolder is empty inside @QueryHandler in Spring WebFlux applications #4207#4236taniyanandi wants to merge 1 commit intoAxonIQ:mainfrom
Conversation
… in Spring WebFlux applications AxonIQ#4207
|
Taniya Nandi seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
I have read the CLA Document and I hereby sign the CLA, @AxonFramework I'm unable to see the "I agree" button on the CLA page despite being logged in. Can you assist? |
|
Apparently, the email address used for the commit doesn't match one of the email addresses registered on your github account. Can you make sure those match? |
|
I have a pointer to share besides the signing. I am not convinced yet that this should be core AF logic. Wouldn't this be a detail specific for the Reactor Extension that we still need to port to AF5? |
|
@smcvb , Thank you for the feedback! You're right, putting ContextView and Mono.deferContextual() directly in DefaultQueryGateway and SimpleQueryBus introduces a Reactor dependency in core AF which is incorrect. I'll refactor this to introduce a neutral DispatchContextContributor SPI in core that the Reactor Extension can implement, keeping all Reactor-specific logic out of core. Is this the direction you had in mind, or is there an existing extension mechanism I should be using instead? |
|
@taniyanandi, be sure to check what's happening in this PR. This was provided to use yesterday, and contains the base for this reactor extension port! Anything you'd provide for Reactor specifics would benefit from that PR being merged, I think! |
|
@smcvb Thank you for pointing that out! I've gone through the PR and it's great to see the Reactor extension being ported into AF5, that's exactly the right home for this fix. I'll wait for that PR to merge and then rebase my Reactor Context propagation fix on top of DefaultReactiveQueryGateway. |
|
@taniyanandi @smcvb Is propagating the context all the way into the handlers really something we want to introduce to the Reactor extension? If so I can add that in now that I am working on it. But I think a much simpler solution, thats also more aligned is simply to register a dispatch interceptor that will on Message dispatch take the ReactiveSecurityContext and attach the subject inside the Message Metadata. |
I'd wager some handler interceptor that upon entering the message handling thread repopulates the I don't think this change strictly needs to happen in the PR you're working on, @theoema. |
Feel free what works for you, @taniyanandi! I am fine if you wait, but similarly fine if you make a branch from his branch. |
|
@taniyanandi, #4245 has just been merged into |
No description provided.