Skip to content

Commit

Permalink
test(deriv_passkeys): added mock data passkeysRegisterOptionsResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
bassam-deriv committed Mar 20, 2024
1 parent a8caea3 commit 367d63a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/services/connection/api_manager/mock_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -375,6 +376,8 @@ class MockAPI extends BaseAPI {
return websiteStatusResponse;
case 'wallet_migration':
return walletMigrationResponse;
case 'passkeys_register_options':
return passkeysRegisterOptionsResponse;

default:
throw APIManagerException(
Expand Down
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"id": 14,
"name": "[email protected]"
}
}
}
}''';

0 comments on commit 367d63a

Please sign in to comment.