Skip to content

Encrypt Current User - LocalStorage #967

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

Closed
macarthuror opened this issue Oct 24, 2019 · 8 comments
Closed

Encrypt Current User - LocalStorage #967

macarthuror opened this issue Oct 24, 2019 · 8 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@macarthuror
Copy link
Contributor

Hello guys 🖖,

Right now I’m trying to encrypt the data which is storage in the browser and I’m using secure-ls , actually is working fine but only is encrypting the ping data not the Current User.

Do you have any idea of how to do it ?

Thanks and have a good day.

BTW. This is the code I’m using

import SecureLS from 'secure-ls'
const ls = new SecureLS({ isCompression: false })

Parse.enableLocalDatastore()
Parse.setLocalDatastoreController({
  fromPinWithName: name => ls.get(name),
  pinWithName: (name, objects) => ls.set(name, objects),
  unPinWithName: name => ls.remove(name),
  getAllContents: () => ls.getAllKeys(),
  clear: () => ls.removeAll()
})

I wrote it before in the community forum but no one shows up 😅

@dplewis
Copy link
Member

dplewis commented Oct 25, 2019

Sorry for the late reply. That secure-ls trick looks cool.

The currentUser isn't stored in the localDatastore.

This is the line you are looking for.

@dplewis
Copy link
Member

dplewis commented Oct 27, 2019

If you want you could do the same for setting the StorageController

Feel free to do a PR.

@dplewis dplewis closed this as completed Oct 27, 2019
@dplewis dplewis reopened this Oct 28, 2019
@dplewis dplewis added enhancement type:feature New feature or improvement of existing feature labels Oct 28, 2019
@macarthuror
Copy link
Contributor Author

Hello @dplewis 🖖
Sorry for not answering before and thanks for the line I was looking for.

Sure let me try it. 👌😁

@dplewis
Copy link
Member

dplewis commented Oct 29, 2019

I would like to add SecureLS to the SDK but I’m skeptical. StorageController is swappable so we could have that option.

@acinader @davimacedo Thoughts?

@acinader
Copy link
Contributor

Off the cuff, just documenting it on the readme and maybe the js sdk guide how to use it would be a decent first step?

alternatively, we could make an argument to initialize or a single call to use it wheen Parse SDK is initialized?

@dplewis
Copy link
Member

dplewis commented Oct 29, 2019

I figure it could be the same as setAsyncStorage for React-Native.

Secure LS has browser support issues i.e Microsoft Edge (insert rant here). I can open a PR for this and we can move the conversation there. @macarthuror what do you think?

@macarthuror
Copy link
Contributor Author

@acinader I'm gonna documented it in the Readme. Thanks.

@dplewis I like it, also I think we can use other solutions to improve the security without using other repo.

BTW @davimacedo suggest trying with CoreManager.setStorageController()

@dplewis
Copy link
Member

dplewis commented Nov 6, 2019

I'm going to close this as users can add their own storage implementation if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants