duo-labs / py_webauthn

Pythonic WebAuthn 🐍
https://duo-labs.github.io/py_webauthn
BSD 3-Clause "New" or "Revised" License
856 stars 171 forks source link

Question/Idea - Separation of User And Credential Models #81

Closed pouya314 closed 3 years ago

pouya314 commented 4 years ago

Hi,

Firstly, let me thank you for this fantastic project; it has been extremely helpful.

Question: In the flask demo app, would it make sense to turn the User model into User and Credential models instead? in order to support multiple credential registrations against one user object?

Thanks, Pouya

pouya314 commented 4 years ago

So looking at all the fields in models.py:

ukey credential_id display_name pub_key sign_count username rp_id icon_url

I have have tried separating them like this:

User model:

Credential model:

My questions are:

  1. Is the above split correct?
  2. Which model does ukey go to?

I would really appreciate any help on this.

Thanks