From 367d63a5431069bf67132ee5196c75b80019e0cf Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Wed, 20 Mar 2024 15:21:04 +0400 Subject: [PATCH] test(deriv_passkeys): added mock data passkeysRegisterOptionsResponse --- .../connection/api_manager/mock_api.dart | 3 ++ .../passkeys_register_options_response.dart | 46 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 lib/services/connection/api_manager/mock_data/passkeys/passkeys_register_options_response.dart diff --git a/lib/services/connection/api_manager/mock_api.dart b/lib/services/connection/api_manager/mock_api.dart index 15e702553a..45ef84a3d6 100644 --- a/lib/services/connection/api_manager/mock_api.dart +++ b/lib/services/connection/api_manager/mock_api.dart @@ -13,6 +13,7 @@ import 'package:flutter_deriv_api/services/connection/api_manager/connection_inf import 'package:flutter_deriv_api/services/connection/api_manager/exceptions/api_manager_exception.dart'; import 'package:flutter_deriv_api/services/connection/api_manager/mock_data/account/new_account_wallet_response.dart'; import 'package:flutter_deriv_api/services/connection/api_manager/mock_data/cashier/cashier_payments_response.dart'; +import 'package:flutter_deriv_api/services/connection/api_manager/mock_data/passkeys/passkeys_register_options_response.dart'; import 'package:flutter_deriv_api/services/connection/call_manager/base_call_manager.dart'; import 'package:flutter_deriv_api/services/connection/call_manager/exceptions/call_manager_exception.dart'; @@ -375,6 +376,8 @@ class MockAPI extends BaseAPI { return websiteStatusResponse; case 'wallet_migration': return walletMigrationResponse; + case 'passkeys_register_options': + return passkeysRegisterOptionsResponse; default: throw APIManagerException( diff --git a/lib/services/connection/api_manager/mock_data/passkeys/passkeys_register_options_response.dart b/lib/services/connection/api_manager/mock_data/passkeys/passkeys_register_options_response.dart new file mode 100644 index 0000000000..b51d9a515e --- /dev/null +++ b/lib/services/connection/api_manager/mock_data/passkeys/passkeys_register_options_response.dart @@ -0,0 +1,46 @@ +/// Wallet migration response mock data. +const String passkeysRegisterOptionsResponse = '''{ + "echo_req": { + "passkeys_register_options": 1 + }, + "msg_type": "passkeys_register_options", + "passkeys_register_options": { + "publicKey": { + "attestation": "direct", + "authenticatorSelection": { + "requireResidentKey": true, + "residentKey": "required", + "userVerification": "preferred" + }, + "challenge": "40gAmfy2FaUGwsV_VrxtvBgPa77dl8W6fFLxQf5WHMc", + "excludeCredentials": [], + "extensions": { + "credProps": true + }, + "pubKeyCredParams": [ + { + "alg": -8, + "type": "public-key" + }, + { + "alg": -7, + "type": "public-key" + }, + { + "alg": -257, + "type": "public-key" + } + ], + "rp": { + "id": "deriv.com", + "name": "Deriv" + }, + "timeout": 60000, + "user": { + "displayName": "bassam@deriv.com", + "id": 14, + "name": "bassam@deriv.com" + } + } + } +}''';