Skip to content
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

Model entity need to add custom Encryption on insert/update and decrypt on read #839

Open
sandeep2244 opened this issue Sep 29, 2023 · 4 comments
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@sandeep2244
Copy link

Hello,

Can you guys define how to implement encryption, decryption on some of Model columns by custom annotation.
Or any eventListener such as Hibernate in R2DBC can use ?
We can find solution for JPA but not found for R2DBC.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 29, 2023
@mp911de
Copy link
Member

mp911de commented Sep 29, 2023

There's no consistent way to post-process database values before writing them to the database or after returning these and before conversion into an entity.

@sandeep2244
Copy link
Author

sandeep2244 commented Sep 29, 2023

@mp911de does customConverter works with this requirement ? I mean just need to verify that, it won't make any issue to persist DB value, state right ?

@mp911de
Copy link
Member

mp911de commented Sep 29, 2023

CustomConversions uses type-based converters to e.g. apply conversion for temporal types or to serialize a custom type to bytes or JSON. We do not have sufficient hooks. While there's a BeforeSave callback, there's no way to post-process the loaded result when reading or when running a query.

@sandeep2244
Copy link
Author

sandeep2244 commented Sep 29, 2023

Sounds good @mp911de , I checked BeforeSaveCallback is of type based conversion at table level.
May I know , does it work for annotation on Column based ?, requirement is to add encryption for some of the columns only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants