spring-projects / spring-projects/spring-data-rest
Provide ability to handle 'after' Http findOne event [DATAREST-836]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Pavel varchenko opened DATAREST-836 and commented
At the moment to read item resource by ID spring data rest uses JPA repository 'findOne' method. There are some different use cases to use this method:
- Custom jackson deserializer (via RepositoryInvoker.invokeFindOne())
- Spring data rest RepositoryEntityController (via RepositoryInvoker.invokeFindOne())
- Another application business logic (via JPA repository)
In some use cases we need
- To secure findOne
- To count usage of findOne from HTTP requests
Provide security via findOne in some cases make different troubles (deserialization an entity to object by ID) and may be unnecessary.
In this issue I suggest to implement HandleAfterFindOne annotation and AfterFindOneEvent event and publish them in RepositoryEntityController. So we could use annotated handlers
At the moment I'm working on pull request of this issue implementation and it will be great if you can say if this feature could be part of spring data rest or not =)
No further details from DATAREST-836
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.