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

Forced dependency on pydantic for library users #171

Closed jpaniagualaconich closed 1 year ago

jpaniagualaconich commented 1 year ago

Users of this library need to explicitly rely on symbols that are implemented in pydantic because the public interface expects pydantic instances that have to be built using {RegistrationCredential, AuthenticationCredential}.parse_raw (a v1-ism) or .model_validate_json (equivalent in v2).

In this way, py_webauthn dependency on pydantic is "contagious". It's even more complicated because the coupling is to a specific version of pydantic. Additionally to the .parse_raw/.model_validate_json there's also the extra need to depend on pydantic.ValidationError.

MasterKale commented 1 year ago

@jpaniagualaconich Thank you very much for suggesting this, it's a great way to stabilize the library's API in light of how chaotic things have been since Pydantic v2 launched. I'm going to start reviewing #172.

MasterKale commented 1 year ago

This enhanced behavior is now available in webauthn==1.11.0