Skip to content

Commit

Permalink
Clean up import and unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ljodal committed Aug 2, 2023
1 parent 5aea0d9 commit 705de48
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/test_verify_authentication_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_verify_authentication_response_with_EC2_public_key(self):
},
"type": "public-key",
"clientExtensionResults": {}
}""",
}"""
)
challenge = base64url_to_bytes(
"xi30GPGAFYRxVDpY1sM10DaLzVQG66nv-_7RUazH0vI2YvG8LYgDEnvN5fZZNVuvEDuMi9te3VLqb42N0fkLGA"
Expand All @@ -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(
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_verify_registration_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion webauthn/helpers/bytes_to_base64url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
1 change: 1 addition & 0 deletions webauthn/helpers/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 705de48

Please sign in to comment.