Skip to content

Commit

Permalink
Test Ed25519 alg in reg options
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKale committed Dec 4, 2024
1 parent 4467157 commit 0e5d64d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions _app/homepage/tests/test_registration_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,20 @@ def test_generate_options(self):
UserVerificationRequirement.DISCOURAGED,
)

def test_options_pub_key_alg_ed25519_is_first(self):
options = self.service.generate_registration_options(
username="mmiller",
algorithms=["ed25519", "es256"],
attachment="",
attestation="",
discoverable_credential="",
existing_credentials=[],
hints=[],
user_verification="",
)

self.assertEqual(len(options.pub_key_cred_params), 2)
self.assertEqual(
options.pub_key_cred_params[0],
PublicKeyCredentialParameters(alg=COSEAlgorithmIdentifier.EDDSA, type="public-key"),
)

0 comments on commit 0e5d64d

Please sign in to comment.