spring-projects / spring-projects/spring-data-rest

Provide ability to handle 'after' Http findOne event [DATAREST-836]

Open
#1,208 5 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

type: enhancement
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:

  1. Custom jackson deserializer (via RepositoryInvoker.invokeFindOne())
  2. Spring data rest RepositoryEntityController (via RepositoryInvoker.invokeFindOne())
  3. Another application business logic (via JPA repository)

In some use cases we need

  1. To secure findOne
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.