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

Make storage interface more friendly #27

Open
nsatragno opened this issue Jan 8, 2020 · 2 comments
Open

Make storage interface more friendly #27

nsatragno opened this issue Jan 8, 2020 · 2 comments

Comments

@nsatragno
Copy link
Contributor

The storage interface should more easily allow developers to integrate this library with their existing user models, especially for relational databases.

  • The documentation should include the fields that are expected to be stored and their types.
  • search should probably be removed since it's not being used.
  • We should be careful that the design makes sense after Feature request: Allowing more than one authenticator #12 is implemented (e.g. we might want to be able to delete individual credentials).

It could also be a good idea to change the attribute user.authenticator to user.webauthnCredential since not all authenticators are webauthn authenticators and in theory the same user could have multiple credentials on the same authenticator, but this is a little bikesheddy :)

Blocked on #12

@EternalDeiwos
Copy link
Contributor

Agreed for the first two points -- on the last, I'd say that individual credentials can be deleted by just setting a new object that omits that credential in particular. Anything wrong with that approach?

@nsatragno @inorganik what do you think about adding a new storage interface (and documentation) for the user session as well? That would also give greater control on that front (CC #15)

@nsatragno
Copy link
Contributor Author

individual credentials can be deleted by just setting a new object that omits that credential in particular. Anything wrong with that approach?

Hmmm, I think on a relational database that would require SELECTing the user, diffing against the user authenticators, and figuring out what to delete. I just realized that's the same thing for adding authenticators though 🤔.

Maybe that's acceptable for an MVP, and we should consider having two kinds of adapters, one for relational and one for document databases.

@nsatragno @inorganik what do you think about adding a new storage interface (and documentation) for the user session as well?

+1

nsatragno added a commit to nsatragno/webauthn-node that referenced this issue Jan 30, 2020
This patch attempts to formalize the storage interface to make it easier
to integrate with existing databases.

See issue strangerlabs#27
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