From 0bdb5e5980050d840cadde37358d8555edaa65e3 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Sat, 30 Nov 2024 07:22:31 +0530 Subject: [PATCH] fix: Add at_demo_data dependency to remove hard coded cram keys --- .../at_onboarding_cli/lib/src/util/create_at_client_cli.dart | 2 +- tests/at_onboarding_cli_functional_tests/pubspec.yaml | 1 + .../test/enrollment_cli_commands_test.dart | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/at_onboarding_cli/lib/src/util/create_at_client_cli.dart b/packages/at_onboarding_cli/lib/src/util/create_at_client_cli.dart index ff638ce1..0cd58e71 100644 --- a/packages/at_onboarding_cli/lib/src/util/create_at_client_cli.dart +++ b/packages/at_onboarding_cli/lib/src/util/create_at_client_cli.dart @@ -74,7 +74,7 @@ Future createAtClient( stderr.writeln(); var msg = 'Failed to connect after $attempts attempts'; stderr.writeln(chalk.brightRed(msg)); - throw SecondaryServerConnectivityException(msg); + throw UnAuthenticatedException(msg); } stderr.writeln(chalk.brightGreen('Connected')); // Get the AtClient which the onboardingService just authenticated diff --git a/tests/at_onboarding_cli_functional_tests/pubspec.yaml b/tests/at_onboarding_cli_functional_tests/pubspec.yaml index 6b061fcd..1e6171f4 100644 --- a/tests/at_onboarding_cli_functional_tests/pubspec.yaml +++ b/tests/at_onboarding_cli_functional_tests/pubspec.yaml @@ -10,6 +10,7 @@ dependencies: at_lookup: ^3.0.49 at_client: ^3.2.2 at_commons: ^5.0.0 + at_demo_data: ^1.2.0 dependency_overrides: at_auth: diff --git a/tests/at_onboarding_cli_functional_tests/test/enrollment_cli_commands_test.dart b/tests/at_onboarding_cli_functional_tests/test/enrollment_cli_commands_test.dart index a82f8a6f..e0143ec0 100644 --- a/tests/at_onboarding_cli_functional_tests/test/enrollment_cli_commands_test.dart +++ b/tests/at_onboarding_cli_functional_tests/test/enrollment_cli_commands_test.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:at_auth/at_auth.dart'; import 'package:at_chops/at_chops.dart'; import 'package:at_client/at_client.dart'; +import 'package:at_demo_data/at_demo_data.dart'; import 'package:at_onboarding_cli/at_onboarding_cli.dart'; import 'package:at_onboarding_cli/src/cli/auth_cli.dart' as auth_cli; import 'package:at_utils/at_utils.dart'; @@ -21,8 +22,7 @@ void main() { getOnboardingPreference(atSign, '${Platform.environment['HOME']}/.atsign/keys/${atSign}_key.atKeys') // Fetched cram key from the at_demos repo. - ..cramSecret = - '15cdce8f92bcf7e742d5b75dc51ec06d798952f8bf7e8ff4c2b6448e5f7c2c12b570fe945f04011455fdc49cacdf9393d9c1ac4609ec71c1a0b0c213578e7ec7'); + ..cramSecret = cramKeyMap[atSign]); bool onboardingStatus = await atOnboardingService.onboard(); expect(onboardingStatus, true);