Stormbase / django-otp-webauthn

Passkey support for Django. Currently in early stages of development and not ready for production use!
BSD 3-Clause "New" or "Revised" License
10 stars 2 forks source link

Not compatible with MySQL #17

Closed nijel closed 1 month ago

nijel commented 1 month ago

Migrating on MySQL fails with:

django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'credential_id_sha256' used in key specification without a key length")

nijel commented 1 month ago

Possible solutions I can see:

I can prepare a pull request, but I'd like to hear opinion on the preferred approach first.

Stormheg commented 1 month ago

@nijel thanks for listing those suggestion so clearly, I happened to have some time available today so I tried out the third solution as it was most appealing to me because - as you mentioned - it avoids calculating the hash in the save() method.

I ended up discovering that cryptographic functions like SHA256 are not always available. On Postgres for example, it requires the pgcrypto extension to be enabled which I consider too much of a hassle to warrant going with this solution.

nijel commented 1 month ago

Ah, I use just MD5 so far and never hit that it would be unavailable, I thought it's the case for all of them.