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

Added decryption mechanism for "initial-page" data if the text content is not a string #399

Open
ankur-bqprime opened this issue Oct 30, 2023 · 6 comments
Assignees

Comments

@ankur-bqprime
Copy link

No description provided.

@ankur-bqprime
Copy link
Author

Issue: The client config is completely exposed in the site page source.

Details: The Quintype framework client expects a configuration which is loaded in the redux store which in turn is used by the application throughout. This configuration is used by the function "startApp" which uses another function "getJsonContent" in "@quintype/framework/client/start.js" to pick up that data from the "window" element itself. Currently, the "getJsonContent" function expects a JSON string which is parsed and used in the store. This JSON string is completely exposed in the site page source as this gets loaded with the initial load of the site.

Solution: A simple encryption mechanism has been applied on the client side which shows encrypted data in the page site. On the package level, the function "getJsonContent" has been modified to accept such encoded data, decrypt it and parse it accordingly. The original functionality still remains intact in case other clients do not wish to do the same.

A pull request has been raised for the update. #398

Please review. @Jeevan-Kishore

@shraddha-kesari
Copy link
Contributor

This is not encryption mechanism, this is encoding. This will be done from the browser end and we do not gain anything from this. Hence, this PR cannot be merged.

CC: @Jeevan-Kishore

@shraddha-kesari
Copy link
Contributor

They have the option to apply the identical solution we previously suggested, which involves adding a filter to initial page in the layout.ejs file, as it appears to be the most efficient resolution.

CC: @Jeevan-Kishore @VyshnavChandran

@ankur-bqprime
Copy link
Author

Sorry, I may have missed out the filter part. What filter are we talking about here and what does that filter do?

@AkshilDasture
Copy link

@shraddha-kesari Could you please look into this request

@shraddha-kesari
Copy link
Contributor

@ankur-bqprime The first suggestion we provided for this request.

Copy pasting here again -
Regarding the json in page source, you need to change this line https://github.com/quintype/bloombergquint-node/blob/master/views/pages/layout.ejs#L165
This is the place, where we are sending json to page source. We need to exclude or add a filter for the parameters we do not want to render.
parameters are to be defined in render-layout.js file
https://github.com/quintype/bloombergquint-node/blob/master/app/server/handlers/render-layout.js

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

No branches or pull requests

3 participants