secure-ls icon indicating copy to clipboard operation
secure-ls copied to clipboard

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

Open bestmazzo opened this issue 5 years ago • 1 comments

  • 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

bestmazzo avatar Feb 13 '20 00:02 bestmazzo

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.

softvar avatar Jul 05 '20 14:07 softvar