Releases: duo-labs/py_webauthn
v2.7.0
Changes:
- The
webauthn.helpers.options_to_json_dict
helper has a new, optionalbytes_encoder
argument that accepts aCallable[[bytes], Any]
method. This enables the use of custom encoding logic when serializingbytes
values. When this argument is unspecified,bytes
values will continue to be encoded into Base64URL (#257)
v2.6.0
v2.5.3
v2.5.2
v2.5.1
v2.5.0
Changes:
- A new
require_user_presence
argument has been added toverify_registration_response()
to enable verification of WebAuthn responses generated through use of conditional create where theup
bit inauthData.flags
will beFalse
(#236, h/t @bschoenmaeckers) verify_authentication_response()
has been updated to returnuser_verified
as well to indicate whether or not the user performed user verification (#235, h/t @ggirol-rc)- Verification of
"android-key"
attestation statements has been modernized in light of Android's latest observable behavior (#240) - Verification of
"android-safetynet"
attestation statements now enforces the"basicIntegrity"
flag instead of the"ctsProfileMatch"
flag when determining device integrity (#241) - The list of known TPM manufacturers has been updated (#242)
v2.4.0
v2.3.0
v2.2.0
Changes:
- All exceptions in
webauthn.helpers.exceptions
now subclass the newwebauthn.helpers.exceptions.WebAuthnException
base exception (#219, h/t @bschoenmaeckers) - Support has been added for the new
"smart-card"
transport (#221)
v2.1.0
Changes:
- New
webauthn.helpers.parse_registration_options_json()
andwebauthn.helpers.parse_authentication_options_json()
methods have been added to help replace use of Pydantic's.parse_obj()
on this library'sPublicKeyCredentialCreationOptions
andPublicKeyCredentialRequestOptions
classes in projects upgrading towebauthn>=2.0.0
. See Refactor Guidance below for more info (#210) - Updated dependencies to
cryptography==42.0.5
(#212)
Refactor Guidance
Taking an example from registration: imagine a py_webauthn v1.11.1 scenario in which a project using this library wanted to retrieve output from generate_registration_options()
, serialized to JSON using webauthn.helpers.options_to_json()
and then stored in a cache or DB, and turn it back into an instance of PublicKeyCredentialCreationOptions
:
# webauthn==1.11.1
json_reg_options: dict = get_stored_registration_options(session_id)
parsed_reg_options = PublicKeyCredentialCreationOptions.parse_obj(
json_reg_options,
)
py_webauthn v2.0.0+ removed use of Pydantic so .parse_obj()
is no longer available on PublicKeyCredentialCreationOptions
. It will become possible to refactor away this use of .parse_obj()
with the new webauthn.helpers.parse_registration_options_json()
in this release:
# webauthn==2.1.0
from webauthn.helpers import parse_registration_options_json
json_reg_options: dict = get_stored_registration_options(session_id)
parsed_reg_options: PublicKeyCredentialCreationOptions = parse_registration_options_json(
json_reg_options,
)
This same logic applies to calls to PublicKeyCredentialRequestOptions.parse_obj()
- these calls can be replaced with the new webauthn.helpers.parse_authentication_options_json()
in this release as well.