From 6c0c5449e4c0c032511dae9f51316c4b6cf85e2e Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 8 Jan 2024 15:31:00 -0800 Subject: [PATCH] Revert typing on user_handle --- tests/test_bytes_subclass_support.py | 13 ------------- webauthn/helpers/structs.py | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/tests/test_bytes_subclass_support.py b/tests/test_bytes_subclass_support.py index b2f841f..3fe50d6 100644 --- a/tests/test_bytes_subclass_support.py +++ b/tests/test_bytes_subclass_support.py @@ -90,16 +90,3 @@ def base64url_to_memoryview(data: str) -> memoryview: ) assert verification.new_sign_count == 7 - - def test_supports_strings_for_bytes(self) -> None: - """ - Preserve the ability to pass strings for `bytes` fields - """ - response = AuthenticatorAssertionResponse( - authenticator_data=bytes(), - client_data_json=bytes(), - signature=bytes(), - user_handle="some_user_handle_string", - ) - - self.assertEqual(response.user_handle, "some_user_handle_string") diff --git a/webauthn/helpers/structs.py b/webauthn/helpers/structs.py index c571d84..a81f5e6 100644 --- a/webauthn/helpers/structs.py +++ b/webauthn/helpers/structs.py @@ -490,7 +490,7 @@ class AuthenticatorAssertionResponse: client_data_json: bytes authenticator_data: bytes signature: bytes - user_handle: Optional[Union[bytes, str]] = None + user_handle: Optional[bytes] = None @dataclass