Skip to content

Commit

Permalink
Use cbor2.loads directly to avoid a deprecation warning
Browse files Browse the repository at this point in the history
Starting with version 5.5.0 of `cbor2`, importing the `cbor2.decoder`
module triggers a deprecation warning. We depend on `cbor2` version
5.4.6 or better which all feature `cbor2.loads` so use it.
  • Loading branch information
jlaine committed Oct 23, 2023
1 parent efc5345 commit 207da73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webauthn/helpers/decode_credential_public_key.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Union

from cbor2 import decoder
import cbor2
from pydantic import BaseModel

from .cose import COSECRV, COSEKTY, COSEAlgorithmIdentifier, COSEKey
Expand Down Expand Up @@ -53,7 +53,7 @@ def decode_credential_public_key(
y=key[33:65],
)

decoded_key: dict = decoder.loads(key)
decoded_key: dict = cbor2.loads(key)

kty = decoded_key[COSEKey.KTY]
alg = decoded_key[COSEKey.ALG]
Expand Down

0 comments on commit 207da73

Please sign in to comment.