-
Notifications
You must be signed in to change notification settings - Fork 21
Adds @RequiresCRUD security annotation && Interceptors #238
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
Adds @RequiresCRUD security annotation && Interceptors #238
Conversation
|
Can you show a simple example of how to use this annotation ? I'm somewhat understanding its purpose from the test, but an explanation would help :) |
| import org.seedstack.seed.security.spi.CRUDActionResolver; | ||
|
|
||
| public class TestActionResolver implements CRUDActionResolver { | ||
|
|
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'd name the Class CrudActionResolver in order to be compliant to java standard name with acronyms and also to be flat with CrudSecurityIT.
I also would rename CRUDAction to CrudAction for the same reasons.
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.
Agree. I suggested those names but it's better to keep CamelCase even for acryonyms.
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.
Agree, already commited the cangue :)
|
The canResolve method is not useful because resolve already returns an Optional and can return empty if nothing is detected. I removed it and refactored the implementation of the interceptors a bit in my fork at https://github.com/adrienlauer/seed/tree/feature/RequiresRestAnnotation. |
Added AbstractInterceptor as a base class for the interceptors, as much of their logic were pretty much the same Added SPI functionality to define custom verb resolvers Implementation improvements on CRUD security Simplify CrudActionResolver
e4d3433 to
6d6464c
Compare
Added AbstractInterceptor as a base class for the interceptors, as much of their logic were pretty much the same Added SPI functionality to define custom verb resolvers Implementation improvements on CRUD security Simplify CrudActionResolver
Smart Annotation that takes care of adding a permission check,
User is able to configure how to resolve the CRUD verb implementing
CRUDActionResolveron their code