def test_remove_all_credentials(driver): options = VirtualAuthenticatorOptions() options.has_resident_key = True driver.add_virtual_authenticator(options) assert driver.virtual_authenticator_id is not None credential = Credential.create_non_resident_credential( bytearray({1, 2, 3, 4}), "localhost", b64decode(BASE64__ENCODED_PK), 0, ) credential2 = Credential.create_resident_credential( bytearray({1, 2, 3, 4, 5}), "localhost", bytearray({1}), b64decode(BASE64__ENCODED_PK), 1, ) driver.add_credential(credential) assert len(driver.get_credentials()) == 1 driver.add_credential(credential2) assert len(driver.get_credentials()) == 2 driver.remove_all_credentials() assert len(driver.get_credentials()) == 0 driver.remove_virtual_authenticator()
def create_rk_enabled_u2f_authenticator(driver) -> WebDriver: options = VirtualAuthenticatorOptions() options.protocol = VirtualAuthenticatorOptions.Protocol.U2F options.has_resident_key = True driver.add_virtual_authenticator(options) return driver
def create_rk_enabled_authenticator(driver) -> WebDriver: options = VirtualAuthenticatorOptions() options.protocol = VirtualAuthenticatorOptions.Protocol.CTAP2 options.has_resident_key = True options.has_user_verification = True options.is_user_verified = True driver.add_virtual_authenticator(options) return driver
def create_rk_disabled_ctap2_authenticator(driver) -> WebDriver: options = VirtualAuthenticatorOptions() options.protocol = VirtualAuthenticatorOptions.Protocol.CTAP2 options.transport = VirtualAuthenticatorOptions.Transport.USB options.has_resident_key = False options.has_user_verification = True options.is_user_verified = True driver.add_virtual_authenticator(options) return driver