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

[FEATURE] Comply with Storage API for drop-in replacement of a unencrypted localStorage #37

Open
bestmazzo opened this issue Feb 13, 2020 · 1 comment

Comments

@bestmazzo
Copy link

  • Actual behavior:
    If a user wants to switch from a unencrypted localStorage to secure-ls, he/she has to rewrite most of the current storage method calls as secure-ls uses different APIs (e.g. get(key) instead of getItem(key) and so on )

-Desired behavior
In order to simplify secure-ls adoption in place of a unencrypted storage, if it could comply the Storage API https://developer.mozilla.org/en-US/docs/Web/API/Storage this could make a developer life much easier, and allow better third party integration.

This would require implementing the five Storage interface methods:
Storage.key()
Storage.getItem()
Storage.setItem()
Storage.removeItem()
Storage.clear()

or just remap current method names

@softvar
Copy link
Owner

softvar commented Jul 5, 2020

Hey @bestmazzo ,
I gave it a thought and it appears a valid point to me. Migration would be much easier in case of same methods.

Will try to ship this feature in next release.

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

2 participants