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

fix: add types in dmmfparser for encryption #105

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

gurjotkaur20
Copy link

Fixes #74

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8354948239

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 80.727%

Totals Coverage Status
Change from base Build 7807229309: 0.0%
Covered Lines: 245
Relevant Lines: 290

💛 - Coveralls

@franky47
Copy link
Member

Thank you!

Have you tested this in a MongoDB project? It feels like it should work, but I'd like to make sure the tree traversal works for both models and types, switching to the correct current model/type when navigating relations, as mentionned in #74.

@gurjotkaur20
Copy link
Author

gurjotkaur20 commented Mar 20, 2024

Yes, I've tested this in MongoDB project. Actually I also needed this in our project where encryption in the types was not working. If you have any specific test in your mind, please let me know. I can test that as well.

@franky47
Copy link
Member

The test cases I have in mind are:

  1. Starting from a model with no encrypted fields, include/select a relation to a model/type that does have encrypted fields, and ensure encrypt-on-write / decrypt-on-read (example)
  2. Same thing, but starting from a model that does have an encrypted field.

I'm not sure how deeply nested types and models can be with each other, but ensuring that traversal of the relation inclusion graph finds the correct encrypted fields would be the way to validate this.

During create or update, return from decryptOnRead only if the model doesn't have any connections
@gurjotkaur20
Copy link
Author

@franky47 I tested these scenarios and found an issue in the first scenario: "Starting from a model with no encrypted fields, include/select a relation to a model/type that does have encrypted fields, and ensure encrypt-on-write / decrypt-on-read"
During create/update operation, while returning the result, decryptOnRead was not happened correctly. I've done the fix. Now, it is working fine.

@gurjotkaur20
Copy link
Author

@franky47 could you review the PR again? Let me know if you have any thoughts.

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.

Only works for Model and not embedded Type?
3 participants