-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ReactiveAuthorizationManager + Reactive Method Security #9867
Conversation
0bdddc0
to
44b9720
Compare
3dbe286
to
e78efc0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @evgeniycheban, for your efforts here!
I've left some initial feedback inline.
ExpressionBasedPreInvocationAdvice preAdvice = new ExpressionBasedPreInvocationAdvice(); | ||
preAdvice.setExpressionHandler(handler); | ||
return new PrePostAdviceReactiveMethodInterceptor(source, preAdvice, postAdvice); | ||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is likely a bug for other branches. Would you please put this addition of the @Role
annotation into a separate commit? That way, we can backport that commit to earlier branches.
...ork/security/authorization/method/PreFilterAuthorizationBeforeReactiveMethodInterceptor.java
Outdated
Show resolved
Hide resolved
...ava/org/springframework/security/authorization/method/AbstractReactiveMethodInterceptor.java
Outdated
Show resolved
Hide resolved
...rg/springframework/security/authorization/method/PostAuthorizeAuthorizationManagerTests.java
Show resolved
Hide resolved
Hi, @evgeniycheban, are you able to apply the requested changes? |
Hi, sorry for the long time of inactivity on this PR. I've been busy at work these few months. I plan to continue working on this next week. |
627bedd
to
3516528
Compare
@jzheaux I updated the PR according to your comments. |
a7aa40b
to
d6c2fb2
Compare
@evgeniycheban I am seeing error " EL1001E: Type conversion problem, cannot convert from reactor.core.publisher.MonoJust<java.lang.Boolean> to java.lang.Boolean" when mixing a non reactive and reactive expression in @PreAuthorize. Any clue why is this happening? Example:- |
@code-uri Interesting note. @jzheaux @rwinch What do you think? Should the user be able to mix reactive and non-reactive expressions in |
fe02459
to
ba54a56
Compare
I wonder if the user could simply do Personally, I'm not a huge fan of embedding logic inside the annotations as it's a bit harder to test; I'd prefer to use a bean or a custom |
82202bc
to
b3786ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've responded inline. The biggest ask is to update to remove co-routines support as discussed #9867 (review)
Please also ensure you rebase off 5.8.x as there are currently conflicts
...va/org/springframework/security/authorization/method/CoroutinesBeanFactoryPostProcessor.java
Outdated
Show resolved
Hide resolved
...framework/security/authorization/method/PreFilterAuthorizationReactiveMethodInterceptor.java
Show resolved
Hide resolved
...mework/security/authorization/method/AuthorizationManagerAfterReactiveMethodInterceptor.java
Show resolved
Hide resolved
...ework/security/authorization/method/AuthorizationManagerBeforeReactiveMethodInterceptor.java
Show resolved
Hide resolved
.../springframework/security/authorization/method/CoroutinesAfterReactiveMethodInterceptor.java
Outdated
Show resolved
Hide resolved
...springframework/security/authorization/method/PostAuthorizeReactiveAuthorizationManager.java
Show resolved
Hide resolved
Any update on this? |
i tried to rebase 5.8.x, but the 5.8.x branch was broken/couldn't be build because of mission classes ... @evgeniycheban are you going to fix the stuff mentionend in the review? |
Hello @koenpunt @jens-meiss, I'm going to fix it this week. |
Thanks, @evgeniycheban, just saw your update. Thank you for such a valuable and time-consuming contribution. I'll add any minor polish that remains and hopefully merge this week. |
Nice, @evgeniycheban! This is now merged into Thanks again for all your consistent effort to this PR! |
Closes gh-9401