-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add AuthorizationManagerFactory #17673
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
base: main
Are you sure you want to change the base?
Add AuthorizationManagerFactory #17673
Conversation
4ef91a4
to
1de115e
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 for the updates @sjohnr! I've provided feedback inline.
...n/java/org/springframework/security/access/expression/AbstractSecurityExpressionHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/springframework/security/access/expression/SecurityExpressionRoot.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/springframework/security/access/expression/SecurityExpressionRoot.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/springframework/security/access/expression/SecurityExpressionRoot.java
Outdated
Show resolved
Hide resolved
...main/java/org/springframework/security/authorization/DefaultAuthorizationManagerFactory.java
Outdated
Show resolved
Hide resolved
.../org/springframework/security/messaging/access/expression/MessageSecurityExpressionRoot.java
Outdated
Show resolved
Hide resolved
.../org/springframework/security/messaging/access/expression/MessageSecurityExpressionRoot.java
Outdated
Show resolved
Hide resolved
...gframework/security/messaging/access/expression/DefaultMessageSecurityExpressionHandler.java
Outdated
Show resolved
Hide resolved
.../org/springframework/security/web/access/expression/DefaultWebSecurityExpressionHandler.java
Outdated
Show resolved
Hide resolved
.../org/springframework/security/web/access/expression/DefaultWebSecurityExpressionHandler.java
Outdated
Show resolved
Hide resolved
@rwinch Thanks for the review! Changing the generic type of |
I think that this can work if we update the constructor too. For example: public class MessageSecurityExpressionRoot<T> extends SecurityExpressionRoot {
public final Message<T> message;
public MessageSecurityExpressionRoot(Authentication authentication, Message<T> message) {
...
public MessageSecurityExpressionRoot(Supplier<Authentication> authentication, Message<T> message) {
... Then this will compile: Message<?> message = ...
MessageSecurityExpressionRoot root = new MessageSecurityExpressionRoot<>(authentication, message); |
Signed-off-by: Steve Riesenberg <[email protected]>
1de115e
to
5fb6f37
Compare
@rwinch I've working through the changes and it's looking really good. The only thing I'm noticing is that a few packages are missing nullability defaults.
As it stands now, classes in these packages show as having inconsistent nullability. These show up as IntelliJ inspections for me, similar to our conversation a few weeks ago. I think adding |
.../springframework/security/data/repository/query/SecurityEvaluationContextExtensionTests.java
Show resolved
Hide resolved
...pringframework/security/access/expression/method/DefaultMethodSecurityExpressionHandler.java
Show resolved
Hide resolved
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 looking great @sjohnr!
I think we are very close 😄 I provided a few minor comments inline.
Now that we are almost done, please also add documentation (using include-code).
After those are addressed, I think we will be ready to merge!
...main/java/org/springframework/security/authorization/DefaultAuthorizationManagerFactory.java
Show resolved
Hide resolved
...main/java/org/springframework/security/authorization/DefaultAuthorizationManagerFactory.java
Show resolved
Hide resolved
...main/java/org/springframework/security/authorization/DefaultAuthorizationManagerFactory.java
Show resolved
Hide resolved
.../springframework/security/data/repository/query/SecurityEvaluationContextExtensionTests.java
Show resolved
Hide resolved
.../java/org/springframework/security/web/access/expression/FilterInvocationExpressionRoot.java
Show resolved
Hide resolved
.../java/org/springframework/security/web/access/expression/FilterInvocationExpressionRoot.java
Show resolved
Hide resolved
We've only added nullability for crypto and core so feel free to leave as is. We'll get the rest of the module in a different ticket commit. |
This PR is a work in progress. cc: @rwinch