Example #1
0
 def create(cls, get_assertion_req: dict):
     # noinspection PyProtectedMember
     return CtapGetAssertionRequest(
         rp_id=get_assertion_req.get(cls.RP_ID_KEY),
         client_data_hash=get_assertion_req.get(cls.CLIENT_DATA_HASH_KEY),
         allow_list=PublicKeyCredentialDescriptor._wrap_list(
             get_assertion_req.get(cls.ALLOW_LIST_KEY)),
         extensions=get_assertion_req.get(cls.EXTENSIONS_KEY),
         options=get_assertion_req.get(cls.OPTIONS_KEY),
         pin_auth=get_assertion_req.get(cls.PIN_AUTH_KEY),
         pin_protocol=get_assertion_req.get(cls.PIN_PROTOCOL_KEY),
     )
Example #2
0
 def create(cls, make_credential_request: dict):
     # noinspection PyProtectedMember
     return CtapMakeCredentialRequest(
         client_data_hash=make_credential_request.get(
             cls.CLIENT_DATA_HASH_KEY),
         rp=PublicKeyCredentialRpEntity._wrap(
             make_credential_request.get(cls.RP_KEY)),
         user=PublicKeyCredentialUserEntity._wrap(
             make_credential_request.get(cls.USER_KEY)),
         public_key_credential_params=PublicKeyCredentialParameters.
         _wrap_list(
             make_credential_request.get(
                 cls.PUBLIC_KEY_CREDENTIAL_PARAMS_KEY)),
         exclude_list=PublicKeyCredentialDescriptor._wrap_list(
             make_credential_request.get(cls.EXCLUDE_LIST_KEY)),
         extensions=make_credential_request.get(cls.EXTENSIONS_KEY),
         options=make_credential_request.get(cls.OPTIONS_KEY),
         pin_auth=make_credential_request.get(cls.PIN_AUTH_KEY),
         pin_protocol=make_credential_request.get(cls.PIN_PROTOCOL_KEY),
     )
 def __init__(
     self,
     challenge,
     timeout=None,
     rp_id=None,
     allow_credentials=None,
     user_verification=None,
     extensions=None,
     user_presence=None,
 ):
     super(PublicKeyCredentialRequestOptions, self).__init__(
         challenge=challenge,
         timeout=timeout,
         rp_id=rp_id,
         allow_credentials=PublicKeyCredentialDescriptor._wrap_list(
             allow_credentials),
         user_verification=UserVerificationRequirement._wrap(
             user_verification),
         extensions=extensions,
         user_presence=UserPresenceRequirement._wrap(user_presence))