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

Fixes encryption handler #13985

Merged
merged 4 commits into from
May 23, 2022
Merged

Fixes encryption handler #13985

merged 4 commits into from
May 23, 2022

Conversation

sidhantgoel
Copy link
Contributor

Pull Request Template

Use this template to quickly create a well written pull request. Delete all quotes before creating the pull request.

Description

Fixes bug in EncryptionHandler that does not work with collection any other than List. This makes EncryptionHandler work with any collection.

Fixes # (issue)

if no issue exists, please create an issue and ask the maintainers about this first

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions, so we can reproduce.
Please also list any relevant details for your test configuration.

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@sidhantgoel sidhantgoel added the Team Managers Pod Issues that team managers care about for the security and efficiency of their teams label May 20, 2022
@vercel
Copy link

vercel bot commented May 20, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview May 23, 2022 at 10:18AM (UTC)

@sidhantgoel
Copy link
Contributor Author

/ok-to-test sha=d6d45cf4d44822d8a2a5533048381136e6cf2a5f

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2358435555.
Workflow: Appsmith External Integration Test Workflow.
Commit: d6d45cf4d44822d8a2a5533048381136e6cf2a5f.
PR: 13985.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2358435555.
Commit: d6d45cf4d44822d8a2a5533048381136e6cf2a5f.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Median Mean SD.Sample SD.Population
SELECT_WIDGET_MENU_OPEN
scripting 1945.86 2105.87 1998.57 2140.14 2121.93 2105.87 2062.47 4.14 3.70
painting 8.16 22.72 8.96 20.36 16.85 16.85 15.41 42.83 38.29
rendering 625.44 684 667.53 712 672.85 672.85 672.36 4.66 4.17
SELECT_WIDGET_SELECT_OPTION
scripting 370.73 273.28 297.07 293.76 289.95 293.76 304.96 12.42 11.11
painting 7.7 6.3 4.78 3.26 6.66 6.3 5.74 30.31 27.00
rendering 21.19 18.33 17.52 15.74 16.55 17.52 17.87 11.75 10.52

1 similar comment
@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2358435555.
Commit: d6d45cf4d44822d8a2a5533048381136e6cf2a5f.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Median Mean SD.Sample SD.Population
SELECT_WIDGET_MENU_OPEN
scripting 1945.86 2105.87 1998.57 2140.14 2121.93 2105.87 2062.47 4.14 3.70
painting 8.16 22.72 8.96 20.36 16.85 16.85 15.41 42.83 38.29
rendering 625.44 684 667.53 712 672.85 672.85 672.36 4.66 4.17
SELECT_WIDGET_SELECT_OPTION
scripting 370.73 273.28 297.07 293.76 289.95 293.76 304.96 12.42 11.11
painting 7.7 6.3 4.78 3.26 6.66 6.3 5.74 30.31 27.00
rendering 21.19 18.33 17.52 15.74 16.55 17.52 17.87 11.75 10.52

@@ -207,7 +208,8 @@ List<CandidateField> findCandidateFieldsForType(@NonNull Object source) {

}

synchronized boolean convertEncryption(Object source, Function<String, String> transformer) {
// Return value of convertEncryption does not accurately tell you whether there are encrypted properties or not but can be treated as good estimate
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey could you please help me understand in what cases the estimation here would be off @sidhantgoel ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When there is collection_unknown and map_unknown in fields it will return true while it may not be true.
1 question, what is need of making this function synchronized?
@nidhi-nair

Copy link
Contributor

Choose a reason for hiding this comment

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

It's so that the cache we're using does not keep recalculating the values during load time. It basically waits for when that source class type has a type defined and then uses that. We should may be look at improving the conditions for when the recalculation happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for synchronization or inaccurate estimate?

@sidhantgoel
Copy link
Contributor Author

/ok-to-test sha=54b82d050212c2f862ece30be5e95b9a075cba24

@nidhi-nair
Copy link
Contributor

Recording notes from convo @sidhantgoel

Revert includes:

  1. Introducing a safe path for unencrypted data to be ignored during transformation.
    Reason: We should not introduce a code path that allows unencrypted data to flow and be stored in the DB. We should try to figure out how those unencrypted data points are getting stored and fix those paths instead.
  2. Return data as null instead
    Reason: This might lead to unexpected behaviour in code.
  3. Unidentified behaviour where cache is returning incorrect type for empty set
    Reason: This is not yet fixed, needs to be investigated.

@sidhantgoel
Copy link
Contributor Author

/ok-to-test sha=c979e6442e059f29f44fe530f93520a06fe9ba70

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2370946893.
Workflow: Appsmith External Integration Test Workflow.
Commit: c979e6442e059f29f44fe530f93520a06fe9ba70.
PR: 13985.

@trishaanand trishaanand merged commit b4ead51 into release May 23, 2022
@trishaanand trishaanand deleted the fix/encryption_handler branch May 23, 2022 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Managers Pod Issues that team managers care about for the security and efficiency of their teams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants