salesforce / akita

🚀 State Management Tailored-Made for JS Applications
https://salesforce.github.io/akita/
Apache License 2.0
3.7k stars 342 forks source link

feat(persistState): added encryption configuration for data persistence #1084

Open lucbevilaqua opened 3 months ago

lucbevilaqua commented 3 months ago

PR Checklist

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Prior to this change, sensitive data could be stored in the storage without any encryption security. This meant that any data, regardless of its sensitivity, was stored in plain text, making it vulnerable to unauthorized access and potential data breaches

What is the new behavior?

With the new change, sensitive data is now stored securely using encryption. This means that before any data is stored, it is first encrypted using a secure encryption algorithm. This significantly enhances the security of the data, making it much harder for unauthorized individuals to access or decipher the stored data. This is particularly beneficial for sensitive data, as it adds an extra layer of protection against potential data breaches. In addition to the encryption feature, it is strongly recommended to personalize the security key in the project. This key can be obtained from an .env file, GitHub secrets, or other secure sources. Using a personalized security key greatly enhances the security of the encryption. It is not advised to use the default encryption secretKey, as this could potentially weaken the security of the stored data. By using a unique and secure key, you ensure that your encrypted data remains as secure as possible.

Does this PR introduce a breaking change?

[ ] Yes
[x] No
salesforce-cla[bot] commented 3 months ago

Thanks for the contribution! Before we can merge this, we need @lucbevilaqua to sign the Salesforce Inc. Contributor License Agreement.

anish commented 3 months ago

fixed @lucbevilaqua