Skip to content

Commit

Permalink
Add CredentialManagement.is_update_supported
Browse files Browse the repository at this point in the history
  • Loading branch information
dainnilsson committed Sep 28, 2024
1 parent a163838 commit 4cb49bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fido2/ctap2/credman.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ def is_supported(info: Info) -> bool:
return True
return False

@staticmethod
def is_update_supported(info: Info) -> bool:
# Not supported in credentialMgmtPreview
return bool(info.options.get("credMgmt"))

def __init__(
self,
ctap: Ctap2,
Expand Down Expand Up @@ -229,6 +234,9 @@ def update_user_info(
:param cred_id: The PublicKeyCredentialDescriptor of the credential to update.
:param user_info: The user info update.
"""
if not CredentialManagement.is_update_supported(self.ctap.info):
raise ValueError("Authenticator does not support update_user_info")

logger.debug(f"Updating credential: {cred_id} with user info: {user_info}")
self._call(
CredentialManagement.CMD.UPDATE_USER_INFO,
Expand Down

0 comments on commit 4cb49bd

Please sign in to comment.