Skip to content

Commit

Permalink
appease mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaniagualaconich committed Sep 1, 2023
1 parent 171309b commit 0159974
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion webauthn/helpers/parse_authentication_credential_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def parse_authentication_credential_json(json_val: str) -> AuthenticationCredential:
if PYDANTIC_V2:
parsing_method: Callable = AuthenticationCredential.model_validate_json
parsing_method: Callable = AuthenticationCredential.model_validate_json # type: ignore[attr-defined]
else: # assuming V1
parsing_method = AuthenticationCredential.parse_raw

Expand Down
2 changes: 1 addition & 1 deletion webauthn/helpers/parse_registration_credential_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def parse_registration_credential_json(json_val: str) -> RegistrationCredential:
if PYDANTIC_V2:
parsing_method: Callable = RegistrationCredential.model_validate_json
parsing_method: Callable = RegistrationCredential.model_validate_json # type: ignore[attr-defined]
else: # assuming V1
parsing_method = RegistrationCredential.parse_raw

Expand Down
4 changes: 2 additions & 2 deletions webauthn/registration/formats/android_safetynet.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def verify_android_safetynet(
)

if PYDANTIC_V2:
header = SafetyNetJWSHeader.model_validate_json(base64url_to_bytes(jws_parts[0]))
payload = SafetyNetJWSPayload.model_validate_json(base64url_to_bytes(jws_parts[1]))
header = SafetyNetJWSHeader.model_validate_json(base64url_to_bytes(jws_parts[0])) # type: ignore[attr-defined]
payload = SafetyNetJWSPayload.model_validate_json(base64url_to_bytes(jws_parts[1])) # type: ignore[attr-defined]
else:
header = SafetyNetJWSHeader.parse_raw(base64url_to_bytes(jws_parts[0]))
payload = SafetyNetJWSPayload.parse_raw(base64url_to_bytes(jws_parts[1]))
Expand Down
2 changes: 1 addition & 1 deletion webauthn/registration/verify_registration_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def verify_registration_response(
# A "none" attestation should not contain _anything_ in its attestation
# statement
if PYDANTIC_V2:
num_att_stmt_fields_set = len(attestation_object.att_stmt.model_fields_set)
num_att_stmt_fields_set = len(attestation_object.att_stmt.model_fields_set) # type: ignore[attr-defined]
else:
num_att_stmt_fields_set = len(attestation_object.att_stmt.__fields_set__)

Expand Down

0 comments on commit 0159974

Please sign in to comment.