Skip to content

[PB-6052] chore: use a getter to set encrypted name#1005

Merged
apsantiso merged 2 commits into
masterfrom
chore/set-encrypted-name-on-the-fly
Mar 23, 2026
Merged

[PB-6052] chore: use a getter to set encrypted name#1005
apsantiso merged 2 commits into
masterfrom
chore/set-encrypted-name-on-the-fly

Conversation

@apsantiso
Copy link
Copy Markdown
Collaborator

@apsantiso apsantiso commented Mar 23, 2026

We're planning to remove the column 'name'.

As a first step, compute name on-the-fly from plainName + folderId using AesService, so clients reading name continue to work after the column is gone.

Once we made sure that the calculated 'name' is working correctly, we need to open a PR setting the field as 'virtual' so no INSERT/UPDATEs are made on the column.

What changes:

  • FileModel.name is now a getter that recomputes the encrypted value on every read so we can test the behaviour before setting 'name' as virtual field.
  • A setter keeps writing to the DB column as before, safe to roll back at any time and INSERT/UPDATE continue working in case of roll back.

…igure get/set to calculate the encrypted name on the fly
@apsantiso apsantiso force-pushed the chore/set-encrypted-name-on-the-fly branch from 681b550 to 4c21a69 Compare March 23, 2026 14:53
@sonarqubecloud
Copy link
Copy Markdown

@apsantiso apsantiso requested a review from sg-gs March 23, 2026 14:58
@apsantiso apsantiso marked this pull request as ready for review March 23, 2026 14:58
@apsantiso apsantiso requested a review from jzunigax2 as a code owner March 23, 2026 14:58
@apsantiso apsantiso merged commit e1b1705 into master Mar 23, 2026
17 checks passed
@apsantiso apsantiso deleted the chore/set-encrypted-name-on-the-fly branch March 23, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants