stagse/authenticator_webauthn: remove pydantic import
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
e450e7b107
commit
65d2eed82d
|
@ -53,9 +53,6 @@ class AuthenticatorWebAuthnChallengeResponse(ChallengeResponse):
|
||||||
|
|
||||||
def validate_response(self, response: dict) -> dict:
|
def validate_response(self, response: dict) -> dict:
|
||||||
"""Validate webauthn challenge response"""
|
"""Validate webauthn challenge response"""
|
||||||
# pylint: disable=no-name-in-module
|
|
||||||
from pydantic.error_wrappers import ValidationError as PydanticValidationError
|
|
||||||
|
|
||||||
challenge = self.request.session["challenge"]
|
challenge = self.request.session["challenge"]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -65,7 +62,7 @@ class AuthenticatorWebAuthnChallengeResponse(ChallengeResponse):
|
||||||
expected_rp_id=get_rp_id(self.request),
|
expected_rp_id=get_rp_id(self.request),
|
||||||
expected_origin=get_origin(self.request),
|
expected_origin=get_origin(self.request),
|
||||||
)
|
)
|
||||||
except (InvalidRegistrationResponse, PydanticValidationError) as exc:
|
except InvalidRegistrationResponse as exc:
|
||||||
LOGGER.warning("registration failed", exc=exc)
|
LOGGER.warning("registration failed", exc=exc)
|
||||||
raise ValidationError(f"Registration failed. Error: {exc}")
|
raise ValidationError(f"Registration failed. Error: {exc}")
|
||||||
|
|
||||||
|
|
Reference in a new issue