diff --git a/tests/test_verify_authentication_response.py b/tests/test_verify_authentication_response.py index 83565e9..accaef0 100644 --- a/tests/test_verify_authentication_response.py +++ b/tests/test_verify_authentication_response.py @@ -19,7 +19,7 @@ def test_verify_authentication_response_with_EC2_public_key(self): }, "type": "public-key", "clientExtensionResults": {} - }""", + }""" ) challenge = base64url_to_bytes( "xi30GPGAFYRxVDpY1sM10DaLzVQG66nv-_7RUazH0vI2YvG8LYgDEnvN5fZZNVuvEDuMi9te3VLqb42N0fkLGA" @@ -45,7 +45,7 @@ def test_verify_authentication_response_with_EC2_public_key(self): ) assert verification.new_sign_count == 78 assert verification.credential_backed_up == False - assert verification.credential_device_type == "single_device" + assert verification.credential_device_type == 'single_device' def test_verify_authentication_response_with_RSA_public_key(self): credential = AuthenticationCredential.parse_raw( @@ -60,7 +60,7 @@ def test_verify_authentication_response_with_RSA_public_key(self): }, "type": "public-key", "clientExtensionResults": {} - }""", + }""" ) challenge = base64url_to_bytes( "iPmAi1Pp1XL6oAgq3PWZtZPnZa1zFUDoGbaQ0_KvVG1lF2s3Rt_3o4uSzccy0tmcTIpTTT4BU1T-I4maavndjQ" @@ -96,7 +96,7 @@ def test_raises_exception_on_incorrect_public_key(self): }, "type": "public-key", "clientExtensionResults": {} - }""", + }""" ) challenge = base64url_to_bytes( "zsfiMZj16TUVCrT5tDRYXdYlUrJp7zn_UNd5NmBocPc4I2dKZbeEWpwBAwA4s6oHkVX6_ly_jgp743dyiWHYYw" diff --git a/tests/test_verify_registration_response.py b/tests/test_verify_registration_response.py index 614e3f3..7dab1df 100644 --- a/tests/test_verify_registration_response.py +++ b/tests/test_verify_registration_response.py @@ -60,7 +60,7 @@ def test_verifies_none_attestation_response(self) -> None: assert verification.credential_type == PublicKeyCredentialType.PUBLIC_KEY assert verification.sign_count == 23 assert verification.credential_backed_up == False - assert verification.credential_device_type == "single_device" + assert verification.credential_device_type == 'single_device' def test_raises_exception_on_unsupported_attestation_type(self) -> None: cred_json = { diff --git a/webauthn/helpers/bytes_to_base64url.py b/webauthn/helpers/bytes_to_base64url.py index e323bc9..b3bd321 100644 --- a/webauthn/helpers/bytes_to_base64url.py +++ b/webauthn/helpers/bytes_to_base64url.py @@ -5,4 +5,4 @@ def bytes_to_base64url(val: bytes) -> str: """ Base64URL-encode the provided bytes """ - return urlsafe_b64encode(val).decode("utf-8") # .replace("=", "") + return urlsafe_b64encode(val).decode("utf-8") diff --git a/webauthn/helpers/structs.py b/webauthn/helpers/structs.py index 3bb586d..cc2dbc3 100644 --- a/webauthn/helpers/structs.py +++ b/webauthn/helpers/structs.py @@ -14,6 +14,7 @@ PYDANTIC_V2 = False +from .base64url_to_bytes import base64url_to_bytes from .bytes_to_base64url import bytes_to_base64url from .cose import COSEAlgorithmIdentifier from .json_loads_base64url_to_bytes import json_loads_base64url_to_bytes