Closed jwag956 closed 2 years ago
@jwag956 Thank you for the report! I'm lucky to have you and your ability to find (and endure?) these compatibility issues 🙇
Okay, so seeing that the CustomBytes
in tests/test_bytes_subclass_support.py calls .tobytes()
on a memoryview
it uses, I suppose it'd be sufficient to add the following elif
to BytesLike.validate()
:
elif isinstance(v, memoryview):
return v.tobytes()
I'll give this a try in the morning.
Yup - I think that's all it will take.
thanks!
@jwag956 This should be fixed in the newly published webauthn==1.4.0
🚀
The latest version going back to pydantic with a custom 'bytes' validation class still throws an error during runtime validation in the case of peewee+postresql.
In this case - a python memoryview type is being returned. That should also be 'ok' as being bytes. It seems like it would be very simple to extend the BytesLike validator to handle this case.
Note: the original mongodb issue - which subclassed 'bytes' works fine....