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

feat: auth-client stores identities in indexeddb #605

Merged
merged 6 commits into from Aug 4, 2022

Conversation

krpeacock
Copy link
Contributor

@krpeacock krpeacock commented Aug 4, 2022

Description

AuthClient now uses IndexedDb by default, as localStorage is less secure.
Also offers a generic Indexed Db keyval store, IdbKeyVal

I decided to leave out encryption for this PR to reduce overhead - could be added at a later date https://gist.github.com/krpeacock/9203f1c6bbd8c55f2eef5e001223edf2

Fixes SDK-313

How Has This Been Tested?

Unit test coverage

Checklist:

  • My changes follow the guidelines in CONTRIBUTING.md.
  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@krpeacock krpeacock requested a review from a team as a code owner August 4, 2022 20:59
version: number,
) => {
// Clear legacy stored delegations
if (localStorage && localStorage.getItem(KEY_STORAGE_DELEGATION)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this changes the place where identities are stored, is there any migration of identities from the previous place to the new one? Or is there a reason why that would not be necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identities are temporary delegation identities, and get cleared on logout. Resetting after a package upgrade is a fairly safe interaction, and will only require a new II login

@krpeacock krpeacock merged commit f79ae86 into main Aug 4, 2022
@krpeacock krpeacock deleted the SDK-313-identity-stored-in-localstorage branch August 4, 2022 22:01
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

Successfully merging this pull request may close these issues.

None yet

2 participants