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

feat:update findex #33

Merged
merged 7 commits into from
Nov 22, 2024
Merged

feat:update findex #33

merged 7 commits into from
Nov 22, 2024

Conversation

HatemMn
Copy link
Collaborator

@HatemMn HatemMn commented Nov 12, 2024

What's new ?

  • [ ] ded code moved here : Dead code #36 . specefic PR will be created later
  • Update findex : encrypt DB before search and then decrypt results
  • Use cloudproof JS for that

General notes

might see multiple such copy pasted lines like this :

        resultBytes.map(async (byteEmployee) => ({
          uuid: byteEmployee.uuid,
          country: await decryptByteEmployeeToString(byteEmployee.country),
          email: await decryptByteEmployeeToString(byteEmployee.email),
          first: await decryptByteEmployeeToString(byteEmployee.first),
          last: await decryptByteEmployeeToString(byteEmployee.last),
          salary: await decryptByteEmployeeToString(byteEmployee.salary),
        }))

'refactoring' these needs a lot of code lines ( ~ 25 ) and generates (pointless) type errors that need themselves other boilerplate. I consider the upper code to be way more readable, despite "the copy". Any less verbose suggestion is welcome !

@HatemMn HatemMn force-pushed the feat/encrypt_findex_db branch from fe2cee2 to bb0b148 Compare November 18, 2024 14:28
@HatemMn HatemMn self-assigned this Nov 18, 2024
@HatemMn HatemMn removed their assignment Nov 18, 2024
@HatemMn HatemMn requested a review from ccorsin November 18, 2024 15:16
@@ -9,6 +9,18 @@ export type Employee = {
salary?: number | string;
};

// in the findex workflow we need to have the country as a string because it will be encrypted
// using this new type to avoid breaking changes (OCP)
export type findexDatabaseEmployee = Omit<Employee, "country"> & { country?: string };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong naming - encryptedEmployee

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure ? I can't see it

Copy link
Collaborator Author

@HatemMn HatemMn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General thoughts :

Those files under public/actions

They should have never been committed to the repo, they should be copied in Vite's config at build time and be ignored when committing

I will add this to one of the repo issues to update it, it should make reviews less verbose for us and avoid linters & co catching those files

@@ -9,6 +9,18 @@ export type Employee = {
salary?: number | string;
};

// in the findex workflow we need to have the country as a string because it will be encrypted
// using this new type to avoid breaking changes (OCP)
export type findexDatabaseEmployee = Omit<Employee, "country"> & { country?: string };
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@HatemMn HatemMn force-pushed the feat/encrypt_findex_db branch from 53d4b0e to 03d5b0d Compare November 20, 2024 18:04
chore:WIP save

feat:first working prototype

feat: encrypt db OK

feat: first working app

fix: fix encrypt DB bugs
fix: restaure knip

fix: restaure package-lock
fix:final review fixes reread

fix:another fix

chore:lint the project

fix:fix cloudproof bug, upgrade lock

feat:commit login logo

chore:fix store
@HatemMn HatemMn force-pushed the feat/encrypt_findex_db branch from 2504939 to a324212 Compare November 22, 2024 15:37
@HatemMn HatemMn merged commit 5895d06 into main Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants