From cc8e2784195e61824fdbdef5174f71fe1691d097 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Thu, 14 Sep 2023 19:44:47 +0530 Subject: [PATCH 1/9] feat: Filter sync entries APKAM enrolled namespaces --- .../sync_progressive_verb_handler.dart | 31 +++++- .../test/sync_unit_test.dart | 95 +++++++++++++++++++ 2 files changed, 121 insertions(+), 5 deletions(-) diff --git a/packages/at_secondary_server/lib/src/verb/handler/sync_progressive_verb_handler.dart b/packages/at_secondary_server/lib/src/verb/handler/sync_progressive_verb_handler.dart index 46a6c6f95..f68ebfdf2 100644 --- a/packages/at_secondary_server/lib/src/verb/handler/sync_progressive_verb_handler.dart +++ b/packages/at_secondary_server/lib/src/verb/handler/sync_progressive_verb_handler.dart @@ -3,6 +3,8 @@ import 'dart:convert'; import 'package:at_commons/at_commons.dart'; import 'package:at_persistence_secondary_server/at_persistence_secondary_server.dart'; +import 'package:at_secondary/src/connection/inbound/inbound_connection_metadata.dart'; +import 'package:at_secondary/src/constants/enroll_constants.dart'; import 'package:at_secondary/src/server/at_secondary_config.dart'; import 'package:at_secondary/src/server/at_secondary_impl.dart'; import 'package:at_secondary/src/verb/handler/abstract_verb_handler.dart'; @@ -44,7 +46,9 @@ class SyncProgressiveVerbHandler extends AbstractVerbHandler { regex: verbParams['regex']); List syncResponse = []; - await prepareResponse(capacity, syncResponse, commitEntryIterator); + await prepareResponse(capacity, syncResponse, commitEntryIterator, + enrollmentId: (atConnection.getMetaData() as InboundConnectionMetadata) + .enrollmentId); response.data = jsonEncode(syncResponse); } @@ -53,11 +57,18 @@ class SyncProgressiveVerbHandler extends AbstractVerbHandler { /// 1. there is at least one item in [syncResponse], and the response length is greater than [desiredMaxSyncResponseLength], or /// 2. there are [AtSecondaryConfig.syncPageLimit] items in the [syncResponse] @visibleForTesting - Future prepareResponse( - int desiredMaxSyncResponseLength, - List syncResponse, - Iterator commitEntryIterator) async { + Future prepareResponse(int desiredMaxSyncResponseLength, + List syncResponse, Iterator commitEntryIterator, + {String? enrollmentId}) async { int currentResponseLength = 0; + Map enrolledNamespaces = {}; + + if (enrollmentId != null && enrollmentId.isNotEmpty) { + String enrollmentKey = + '$enrollmentId.$newEnrollmentKeyPattern.$enrollManageNamespace${AtSecondaryServerImpl.getInstance().currentAtSign}'; + enrolledNamespaces = + (await getEnrollDataStoreValue(enrollmentKey)).namespaces; + } while (commitEntryIterator.moveNext() && syncResponse.length < AtSecondaryConfig.syncPageLimit) { @@ -68,6 +79,15 @@ class SyncProgressiveVerbHandler extends AbstractVerbHandler { '${commitEntryIterator.current.key} is an invalid key. Skipping from adding it to sync response'); continue; } + String? keyNamespace = + AtKey.fromString(commitEntryIterator.current.key!).namespace; + if ((keyNamespace != null && keyNamespace.isNotEmpty) && + enrolledNamespaces.isNotEmpty && + (!enrolledNamespaces.containsKey(allNamespaces) && + !enrolledNamespaces.containsKey(enrollManageNamespace) && + !enrolledNamespaces.containsKey(keyNamespace))) { + continue; + } var keyStoreEntry = KeyStoreEntry(); keyStoreEntry.key = commitEntryIterator.current.key; keyStoreEntry.commitId = commitEntryIterator.current.value.commitId; @@ -80,6 +100,7 @@ class SyncProgressiveVerbHandler extends AbstractVerbHandler { '${commitEntryIterator.current.key} does not exist in the keystore. skipping the key to sync'); continue; } + var atData = await keyStore.get(commitEntryIterator.current.key); if (atData == null) { logger.info('atData is null for ${commitEntryIterator.current.key}'); diff --git a/packages/at_secondary_server/test/sync_unit_test.dart b/packages/at_secondary_server/test/sync_unit_test.dart index 0750dd4be..2c7843d87 100644 --- a/packages/at_secondary_server/test/sync_unit_test.dart +++ b/packages/at_secondary_server/test/sync_unit_test.dart @@ -6,7 +6,9 @@ import 'package:at_commons/at_commons.dart'; import 'package:at_persistence_secondary_server/at_persistence_secondary_server.dart'; import 'package:at_secondary/src/caching/cache_manager.dart'; import 'package:at_secondary/src/connection/inbound/inbound_connection_impl.dart'; +import 'package:at_secondary/src/connection/inbound/inbound_connection_metadata.dart'; import 'package:at_secondary/src/connection/outbound/outbound_client_manager.dart'; +import 'package:at_secondary/src/constants/enroll_constants.dart'; import 'package:at_secondary/src/notification/notification_manager_impl.dart'; import 'package:at_secondary/src/notification/stats_notification_service.dart'; import 'package:at_secondary/src/server/at_secondary_impl.dart'; @@ -16,6 +18,7 @@ import 'package:at_secondary/src/verb/manager/verb_handler_manager.dart'; import 'package:at_server_spec/at_verb_spec.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; +import 'package:uuid/uuid.dart'; // How the server processes updates from the client (including the responses it generates) and what the expectations // are - i.e. can we reject? what happens when we reject? and more @@ -827,6 +830,98 @@ void main() { }); tearDown(() async => await tearDownMethod()); }); + + group('A group of tests on APKAM Enrollment', () { + setUp(() async => await setUpMethod()); + test( + 'A test to verify keys whose namespace are enrolled are only returned', + () async { + await secondaryPersistenceStore! + .getSecondaryKeyStore() + ?.put('public:phone.wavi@alice', AtData()..data = '8897896765'); + await secondaryPersistenceStore! + .getSecondaryKeyStore() + ?.put('public:mobile.buzz@alice', AtData()..data = '8897896765'); + var enrollmentId = Uuid().v4(); + String enrollmentKey = + '$enrollmentId.$newEnrollmentKeyPattern.$enrollManageNamespace@alice'; + final enrollJson = { + 'sessionId': '123', + 'appName': 'wavi', + 'deviceName': 'pixel', + 'namespaces': {'wavi': 'rw'}, + 'apkamPublicKey': 'testPublicKeyValue', + 'requestType': 'newEnrollment', + 'approval': {'state': 'approved'} + }; + await secondaryPersistenceStore! + .getSecondaryKeyStore() + ?.put(enrollmentKey, AtData()..data = jsonEncode(enrollJson)); + + var syncProgressiveVerbHandler = SyncProgressiveVerbHandler( + secondaryPersistenceStore!.getSecondaryKeyStore()!); + var response = Response(); + var inBoundSessionId = '_6665436c-29ff-481b-8dc6-129e89199718'; + var atConnection = InboundConnectionImpl(null, inBoundSessionId); + atConnection.metaData.isAuthenticated = true; + (atConnection.metaData as InboundConnectionMetadata).enrollmentId = + enrollmentId; + var syncVerbParams = HashMap(); + syncVerbParams.putIfAbsent(AT_FROM_COMMIT_SEQUENCE, () => '-1'); + await syncProgressiveVerbHandler.processVerb( + response, syncVerbParams, atConnection); + List syncResponseList = jsonDecode(response.data!); + expect(syncResponseList.length, 1); + expect(syncResponseList[0]['atKey'], 'public:phone.wavi@alice'); + expect(syncResponseList[0]['operation'], '+'); + }); + + test('A test to verify all keys are returned when enrollment contains *:rw', + () async { + await secondaryPersistenceStore! + .getSecondaryKeyStore() + ?.put('public:phone.wavi@alice', AtData()..data = '8897896765'); + await secondaryPersistenceStore! + .getSecondaryKeyStore() + ?.put('public:mobile.buzz@alice', AtData()..data = '8897896765'); + var enrollmentId = Uuid().v4(); + String enrollmentKey = + '$enrollmentId.$newEnrollmentKeyPattern.$enrollManageNamespace@alice'; + final enrollJson = { + 'sessionId': '123', + 'appName': 'wavi', + 'deviceName': 'pixel', + 'namespaces': {'wavi': 'rw', '*': 'rw'}, + 'apkamPublicKey': 'testPublicKeyValue', + 'requestType': 'newEnrollment', + 'approval': {'state': 'approved'} + }; + await secondaryPersistenceStore! + .getSecondaryKeyStore() + ?.put(enrollmentKey, AtData()..data = jsonEncode(enrollJson), skipCommit: true); + + var syncProgressiveVerbHandler = SyncProgressiveVerbHandler( + secondaryPersistenceStore!.getSecondaryKeyStore()!); + var response = Response(); + var inBoundSessionId = '_6665436c-29ff-481b-8dc6-129e89199718'; + var atConnection = InboundConnectionImpl(null, inBoundSessionId); + atConnection.metaData.isAuthenticated = true; + (atConnection.metaData as InboundConnectionMetadata).enrollmentId = + enrollmentId; + var syncVerbParams = HashMap(); + syncVerbParams.putIfAbsent(AT_FROM_COMMIT_SEQUENCE, () => '-1'); + await syncProgressiveVerbHandler.processVerb( + response, syncVerbParams, atConnection); + List syncResponseList = jsonDecode(response.data!); + expect(syncResponseList.length, 2); + expect(syncResponseList[0]['atKey'], 'public:phone.wavi@alice'); + expect(syncResponseList[0]['operation'], '+'); + expect(syncResponseList[1]['atKey'], 'public:mobile.buzz@alice'); + expect(syncResponseList[1]['operation'], '+'); + + }); + tearDown(() async => await tearDownMethod()); + }); }); } From d83c1db74bd35e80f913ec324d99f7287d7d1e14 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Sun, 17 Sep 2023 15:09:49 +0530 Subject: [PATCH 2/9] feat: Return latestCommitId among enrolled namespaces --- .../lib/src/log/commitlog/at_commit_log.dart | 4 +- .../log/commitlog/commit_log_keystore.dart | 28 ++++- .../src/verb/handler/stats_verb_handler.dart | 31 ++++- .../lib/src/verb/metrics/metrics_impl.dart | 11 +- .../test/stats_verb_test.dart | 95 +++++++++++++- .../test/enroll_verb_test.dart | 72 +++++++++++ .../test/sync_verb_test.dart | 118 ++++++++++++++++-- 7 files changed, 330 insertions(+), 29 deletions(-) diff --git a/packages/at_persistence_secondary_server/lib/src/log/commitlog/at_commit_log.dart b/packages/at_persistence_secondary_server/lib/src/log/commitlog/at_commit_log.dart index edb8088e0..5edf7c940 100644 --- a/packages/at_persistence_secondary_server/lib/src/log/commitlog/at_commit_log.dart +++ b/packages/at_persistence_secondary_server/lib/src/log/commitlog/at_commit_log.dart @@ -110,8 +110,8 @@ class AtCommitLog implements AtLogType { /// Returns the latest committed sequence number with regex @server - Future lastCommittedSequenceNumberWithRegex(String regex) async { - return await _commitLogKeyStore.lastCommittedSequenceNumberWithRegex(regex); + Future lastCommittedSequenceNumberWithRegex(String regex,{List? enrolledNamespace}) async { + return await _commitLogKeyStore.lastCommittedSequenceNumberWithRegex(regex, enrolledNamespace: enrolledNamespace); } @client diff --git a/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart b/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart index c709a7008..eccc20ee4 100644 --- a/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart +++ b/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart @@ -153,9 +153,11 @@ class CommitLogKeyStore } /// Returns the latest committed sequence number with regex - Future lastCommittedSequenceNumberWithRegex(String regex) async { + Future lastCommittedSequenceNumberWithRegex(String regex, + {List? enrolledNamespace}) async { var lastCommittedEntry = (_getBox() as Box).values.lastWhere( - (entry) => (_acceptKey(entry.atKey, regex)), + (entry) => (_acceptKey(entry.atKey, regex, + enrolledNamespace: enrolledNamespace)), orElse: () => NullCommitEntry()); var lastCommittedSequenceNum = (lastCommittedEntry != null) ? lastCommittedEntry.key : null; @@ -329,8 +331,26 @@ class CommitLogKeyStore } } - bool _acceptKey(String atKey, String regex) { - return _isRegexMatches(atKey, regex) || _isSpecialKey(atKey); + bool _acceptKey(String atKey, String regex, + {List? enrolledNamespace}) { + return _isNamespaceAuthorised(atKey, enrolledNamespace) && + (_isRegexMatches(atKey, regex) || _isSpecialKey(atKey)); + } + + bool _isNamespaceAuthorised(String atKey, List? enrolledNamespace) { + String? keyNamespace = AtKey.fromString(atKey).namespace; + // If enrolledNamespace is null or keyNamespace is null, fallback to + // existing behaviour - the key is authorized for the client to receive. So return true. + if (enrolledNamespace == null || + enrolledNamespace.isEmpty || + (keyNamespace == null || keyNamespace.isEmpty)) { + return true; + } + if (enrolledNamespace.contains('*') || + enrolledNamespace.contains(keyNamespace)) { + return true; + } + return false; } bool _isRegexMatches(String atKey, String regex) { diff --git a/packages/at_secondary_server/lib/src/verb/handler/stats_verb_handler.dart b/packages/at_secondary_server/lib/src/verb/handler/stats_verb_handler.dart index 981de95ee..18931d8e9 100644 --- a/packages/at_secondary_server/lib/src/verb/handler/stats_verb_handler.dart +++ b/packages/at_secondary_server/lib/src/verb/handler/stats_verb_handler.dart @@ -5,6 +5,9 @@ import 'dart:convert'; import 'package:at_commons/at_commons.dart'; import 'package:at_persistence_secondary_server/at_persistence_secondary_server.dart'; +import 'package:at_secondary/src/connection/inbound/inbound_connection_metadata.dart'; +import 'package:at_secondary/src/constants/enroll_constants.dart'; +import 'package:at_secondary/src/server/at_secondary_impl.dart'; import 'package:at_secondary/src/verb/handler/abstract_verb_handler.dart'; import 'package:at_secondary/src/verb/metrics/metrics_impl.dart'; import 'package:at_secondary/src/verb/metrics/metrics_provider.dart'; @@ -108,12 +111,21 @@ class StatsVerbHandler extends AbstractVerbHandler { return stats; } - Future addStatToResult(id, result) async { + Future addStatToResult( + id, result, List enrolledNamespaces) async { logger.info('addStatToResult for id : $id, regex: $_regex'); var metric = _getMetrics(id); var name = metric.name!.getName(); dynamic value; - if ((id == '3' || id == '15') && _regex != null) { + if (id == '3') { + if (_regex == null || _regex.isEmpty) { + _regex = '.*'; + } + value = await (metric.name as LastCommitIDMetricImpl) + .getMetrics(regex: _regex, enrolledNamespaces: enrolledNamespaces); + } else if (id == '15' && _regex != null) { + // When connection is authenticated via the APKAM, return the highest commit-Id + // among the specified namespaces. value = await metric.name!.getMetrics(regex: _regex); } else { value = await metric.name!.getMetrics(); @@ -143,9 +155,22 @@ class StatsVerbHandler extends AbstractVerbHandler { statsList = statsMap.keys.toSet(); } var result = []; + List enrolledNamespaces = []; + if ((atConnection.getMetaData() as InboundConnectionMetadata) + .enrollmentId != + null) { + var enrollmentKey = + '${(atConnection.getMetaData() as InboundConnectionMetadata).enrollmentId}.$newEnrollmentKeyPattern.$enrollManageNamespace${AtSecondaryServerImpl.getInstance().currentAtSign}'; + enrolledNamespaces = (await getEnrollDataStoreValue(enrollmentKey)) + .namespaces + .keys + .toList(); + } //Iterate through stats_id_list await Future.forEach( - statsList, (dynamic element) => addStatToResult(element, result)); + statsList, + (dynamic element) => + addStatToResult(element, result, enrolledNamespaces)); // Create response json var responseJson = result.toString(); response.data = responseJson; diff --git a/packages/at_secondary_server/lib/src/verb/metrics/metrics_impl.dart b/packages/at_secondary_server/lib/src/verb/metrics/metrics_impl.dart index 120c47d2c..c2514cda0 100644 --- a/packages/at_secondary_server/lib/src/verb/metrics/metrics_impl.dart +++ b/packages/at_secondary_server/lib/src/verb/metrics/metrics_impl.dart @@ -57,7 +57,7 @@ class OutBoundMetricImpl implements MetricProvider { class LastCommitIDMetricImpl implements MetricProvider { static final LastCommitIDMetricImpl _singleton = LastCommitIDMetricImpl._internal(); - var _atCommitLog; + AtCommitLog? _atCommitLog; set atCommitLog(value) { _atCommitLog = value; @@ -70,15 +70,16 @@ class LastCommitIDMetricImpl implements MetricProvider { } @override - Future getMetrics({String? regex}) async { + Future getMetrics({String? regex, List? enrolledNamespaces}) async { logger.finer('In commitID getMetrics...regex : $regex'); var lastCommitID; - if (regex != null) { + if (regex != null || enrolledNamespaces != null) { + regex ??= '.*'; lastCommitID = - await _atCommitLog.lastCommittedSequenceNumberWithRegex(regex); + await _atCommitLog?.lastCommittedSequenceNumberWithRegex(regex, enrolledNamespace: enrolledNamespaces); return lastCommitID.toString(); } - lastCommitID = _atCommitLog.lastCommittedSequenceNumber().toString(); + lastCommitID = _atCommitLog?.lastCommittedSequenceNumber().toString(); return lastCommitID; } diff --git a/packages/at_secondary_server/test/stats_verb_test.dart b/packages/at_secondary_server/test/stats_verb_test.dart index 0480efcd9..fac55bc4e 100644 --- a/packages/at_secondary_server/test/stats_verb_test.dart +++ b/packages/at_secondary_server/test/stats_verb_test.dart @@ -124,7 +124,7 @@ void main() { group('A group of notificationStats verb tests', () { SecondaryKeyStoreManager? keyStoreManager; setUp(() async => keyStoreManager = await setUpFunc( - '${Directory.current.path}/test/hive', + '${Directory.current.path}/unit_test_storage', atsign: '@alice')); // test for Notification Stats test('notification stats command accept test', () { @@ -288,7 +288,7 @@ void main() { group('A group of commitLogCompactionStats verb tests', () { SecondaryKeyStoreManager? keyStoreManager; setUp(() async => keyStoreManager = await setUpFunc( - '${Directory.current.path}/test/hive', + '${Directory.current.path}/unit_test_storage', atsign: '@alice')); test('commitLogCompactionStats command accept test', () { @@ -341,7 +341,7 @@ void main() { group('A group of accessLogCompactionStats verb tests', () { SecondaryKeyStoreManager? keyStoreManager; setUp(() async => keyStoreManager = await setUpFunc( - '${Directory.current.path}/test/hive', + '${Directory.current.path}/unit_test_storage', atsign: '@alice')); test('accessLogCompactionStats command acceptance test', () { @@ -387,7 +387,7 @@ void main() { group('A group of notificationCompactionStats verb tests', () { SecondaryKeyStoreManager? keyStoreManager; setUp(() async => keyStoreManager = await setUpFunc( - '${Directory.current.path}/test/hive', + '${Directory.current.path}/unit_test_storage', atsign: '@alice')); test('notificationCompactionStats command accept test', () { @@ -470,5 +470,92 @@ void main() { (int.parse(lastCommitId) + 5)); expect(latestCommitIdMap['@alice:deletekey-$randomString@alice'][1], '-'); }); + + test( + 'A test to verify latest commitId among enrolled namespaces is returned', + () async { + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:phone.wavi@alice', AtData()..data = '9848033443'); + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:location.wavi@alice', AtData()..data = 'Hyderabad'); + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:mobile.buzz@alice', AtData()..data = '9848033444'); + + LastCommitIDMetricImpl.getInstance().atCommitLog = + secondaryPersistenceStore!.getSecondaryKeyStore()!.commitLog; + var lastCommitId = await LastCommitIDMetricImpl.getInstance() + .getMetrics(enrolledNamespaces: ['wavi']); + expect(lastCommitId, '1'); + }); + + test( + 'A test to verify highest commitId among the authorized namespaces is returned', + () async { + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:phone.wavi@alice', AtData()..data = '9848033443'); + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:location.wavi@alice', AtData()..data = 'Hyderabad'); + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:mobile.buzz@alice', AtData()..data = '9848033444'); + await secondaryPersistenceStore!.getSecondaryKeyStore()!.put( + '@alice:contact.atmosphere@alice', AtData()..data = '9848033444'); + + LastCommitIDMetricImpl.getInstance().atCommitLog = + secondaryPersistenceStore!.getSecondaryKeyStore()!.commitLog; + var lastCommitId = await LastCommitIDMetricImpl.getInstance() + .getMetrics(enrolledNamespaces: ['wavi', 'buzz']); + expect(lastCommitId, '2'); + }); + + test( + 'A test to verify latestCommitId is returned when enrolledNamespace and regex are not supplied', + () async { + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:phone.wavi@alice', AtData()..data = '9848033443'); + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:location.wavi@alice', AtData()..data = 'Hyderabad'); + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:mobile.buzz@alice', AtData()..data = '9848033444'); + await secondaryPersistenceStore!.getSecondaryKeyStore()!.put( + '@alice:contact.atmosphere@alice', AtData()..data = '9848033444'); + + LastCommitIDMetricImpl.getInstance().atCommitLog = + secondaryPersistenceStore!.getSecondaryKeyStore()!.commitLog; + var lastCommitId = + await LastCommitIDMetricImpl.getInstance().getMetrics(); + expect(lastCommitId, '3'); + }); + + test( + 'A test to verify latestCommitId is returned when only regex is not supplied', + () async { + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:phone.wavi@alice', AtData()..data = '9848033443'); + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:location.wavi@alice', AtData()..data = 'Hyderabad'); + await secondaryPersistenceStore! + .getSecondaryKeyStore()! + .put('@alice:mobile.buzz@alice', AtData()..data = '9848033444'); + await secondaryPersistenceStore!.getSecondaryKeyStore()!.put( + '@alice:contact.atmosphere@alice', AtData()..data = '9848033444'); + + LastCommitIDMetricImpl.getInstance().atCommitLog = + secondaryPersistenceStore!.getSecondaryKeyStore()!.commitLog; + var lastCommitId = + await LastCommitIDMetricImpl.getInstance().getMetrics(regex: 'buzz'); + expect(lastCommitId, '2'); + }); + tearDown(() async => await verbTestsTearDown()); }); } diff --git a/tests/at_functional_test/test/enroll_verb_test.dart b/tests/at_functional_test/test/enroll_verb_test.dart index afa4e56db..bf9d6f4b9 100644 --- a/tests/at_functional_test/test/enroll_verb_test.dart +++ b/tests/at_functional_test/test/enroll_verb_test.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:at_demo_data/at_demo_data.dart' as at_demos; import 'package:at_functional_test/conf/config_util.dart'; import 'package:test/test.dart'; +import 'package:uuid/uuid.dart'; import 'at_demo_data.dart'; import 'encryption_util.dart'; @@ -45,6 +46,8 @@ Future encryptKeys() async { var firstAtsign = ConfigUtil.getYaml()!['first_atsign_server']['first_atsign_name']; +var secondAtSign = + ConfigUtil.getYaml()!['second_atsign_server']['second_atsign_name']; void main() { //Establish the client socket connection @@ -859,6 +862,75 @@ void main() { await read(); }); }); + + group('A group of tests related to fetching latest commit id', () { + String enrollmentResponse; + late String enrollmentId; + setUp(() async { + // Get TOTP from server + String otp = await _getOTPFromServer(firstAtsign); + await socketConnection1?.close(); + // Close the connection and create a new connection and send an enrollment request on an + // unauthenticated connection. + await _connect(); + String enrollRequest = + 'enroll:request:{"appName":"my-first-app","deviceName":"pixel","namespaces":{"wavi":"rw","buzz":"r"},"otp":"$otp","apkamPublicKey":"${pkamPublicKeyMap[firstAtsign]!}"}'; + await socket_writer(socketConnection1!, enrollRequest); + enrollmentResponse = await read(); + enrollmentResponse = enrollmentResponse.replaceAll('data:', ''); + enrollmentId = jsonDecode(enrollmentResponse)['enrollmentId']; + enrollmentId = enrollmentId.trim(); + socketConnection1?.close(); + }); + + /// The purpose of the test is to fetch the latestCommitId among the enrolled namespaces + /// When 3 keys are inserted into server: + /// key1.wavi@alice - CommitId: 1 + /// key2.buzz@alice - CommitId: 2 + /// key3.atmosphere@alice - CommitId: 3 + /// and if only 'wavi' and 'buzz' are enrolled, return commitId: 2 + test( + 'A test to verify stats verb returns highest commitId among enrolled namespace', + () async { + String randomId = Uuid().v4(); + String enrollRequest = 'enroll:approve:{"enrollmentId":"$enrollmentId"}'; + await _connect(); + await prepare(socketConnection1!, firstAtsign); + socket_writer(socketConnection1!, enrollRequest); + await read(); + socket_writer(socketConnection1!, 'stats:3'); + await read(); + + socket_writer(socketConnection1!, + 'update:$secondAtSign:phone-$randomId.wavi$firstAtsign random-value'); + await read(); + socket_writer(socketConnection1!, + 'update:$secondAtSign:mobile-$randomId.buzz$firstAtsign random-value'); + String commitIdOfLastEnrolledKey = + (await read()).replaceAll('data:', '').trim(); + // Key which has un-enrolled namespace + socket_writer(socketConnection1!, + 'update:$secondAtSign:contact-$randomId.atmosphere$firstAtsign random-value'); + await read(); + socket_writer(socketConnection1!, 'stats:3'); + await read(); + socketConnection1?.close(); + await _connect(); + await socket_writer(socketConnection1!, 'from:$firstAtsign'); + String response = (await read()).replaceAll('data:', '').trim(); + String digest = generatePKAMDigest(firstAtsign, response); + await socket_writer( + socketConnection1!, 'pkam:enrollmentId:$enrollmentId:$digest'); + response = (await read()).replaceAll('data:', ''); + await socket_writer(socketConnection1!, 'stats:3'); + String lastCommitIdAmongEnrolledNamespace = + jsonDecode((await read()).replaceAll('data:', ''))[0]['value']; + expect( + int.parse(lastCommitIdAmongEnrolledNamespace) >= + int.parse(commitIdOfLastEnrolledKey), + true); + }); + }); } Future _getOTPFromServer(String atSign) async { diff --git a/tests/at_functional_test/test/sync_verb_test.dart b/tests/at_functional_test/test/sync_verb_test.dart index 4c6b420e3..3a6f0d9de 100644 --- a/tests/at_functional_test/test/sync_verb_test.dart +++ b/tests/at_functional_test/test/sync_verb_test.dart @@ -1,30 +1,42 @@ +import 'dart:convert'; import 'dart:io'; import 'package:test/test.dart'; - +import 'package:uuid/uuid.dart'; +import 'at_demo_data.dart'; import 'functional_test_commons.dart'; import 'package:at_functional_test/conf/config_util.dart'; +import 'pkam_utils.dart'; + void main() { - var firstAtsign = + var firstAtSign = ConfigUtil.getYaml()!['first_atsign_server']['first_atsign_name']; + var firstAtSignServer = + ConfigUtil.getYaml()!['first_atsign_server']['first_atsign_url']; + var firstAtSignPort = + ConfigUtil.getYaml()!['first_atsign_server']['first_atsign_port']; + + var secondAtSign = + ConfigUtil.getYaml()!['second_atsign_server']['second_atsign_name']; + var secondAtSignServer = + ConfigUtil.getYaml()!['second_atsign_server']['second_atsign_url']; + var secondAtSignPort = + ConfigUtil.getYaml()!['second_atsign_server']['second_atsign_port']; + Socket? socketFirstAtsign; setUp(() async { - var firstAtsignServer = ConfigUtil.getYaml()!['first_atsign_server']['first_atsign_url']; - var firstAtsignPort = - ConfigUtil.getYaml()!['first_atsign_server']['first_atsign_port']; - socketFirstAtsign = - await secure_socket_connection(firstAtsignServer, firstAtsignPort); + await secure_socket_connection(firstAtSignServer, firstAtSignPort); socket_listener(socketFirstAtsign!); - await prepare(socketFirstAtsign!, firstAtsign); + await prepare(socketFirstAtsign!, firstAtSign); }); test('sync verb with regex ', () async { /// UPDATE VERB await socket_writer(socketFirstAtsign!, - 'update:public:twitter.persona$firstAtsign bob_tweet'); + 'update:public:twitter.persona$firstAtSign bob_tweet'); var response = await read(); print('update verb response : $response'); assert( @@ -34,10 +46,11 @@ void main() { var regex = '.persona'; // sync with regex - await socket_writer(socketFirstAtsign!, 'sync:from:${syncId - 1}:limit:5:$regex'); + await socket_writer( + socketFirstAtsign!, 'sync:from:${syncId - 1}:limit:5:$regex'); response = await read(); print('sync response is : $response'); - assert((response.contains('"atKey":"public:twitter$regex$firstAtsign'))); + assert((response.contains('"atKey":"public:twitter$regex$firstAtSign'))); }); // sync negative scenario @@ -59,9 +72,92 @@ void main() { assert((response.contains('Invalid syntax'))); }); + group('A group of tests to verify sync entries', () { + late SecureSocket authenticatedSocket; + late SecureSocket unauthenticatedSocket; + late String enrollmentId; + + setUp(() async { + authenticatedSocket = + await secure_socket_connection(firstAtSignServer, firstAtSignPort); + socket_listener(authenticatedSocket); + unauthenticatedSocket = + await secure_socket_connection(firstAtSignServer, firstAtSignPort); + socket_listener(unauthenticatedSocket); + // Get TOTP from server + String otp = await _getOTPFromServer(authenticatedSocket, firstAtSign); + String enrollRequest = + 'enroll:request:{"appName":"my-first-app","deviceName":"pixel","namespaces":{"wavi":"rw","buzz":"r"},"otp":"$otp","apkamPublicKey":"${pkamPublicKeyMap[firstAtSign]!}"}'; + + await socket_writer(unauthenticatedSocket, enrollRequest); + String enrollmentResponse = await read(); + enrollmentResponse = enrollmentResponse.replaceAll('data:', ''); + enrollmentId = jsonDecode(enrollmentResponse)['enrollmentId']; + enrollmentId = enrollmentId.trim(); + }); + test( + 'A test to verify sync entries contains keys with only enrolled namespace on APKAM Authenticated Connection', + () async { + await socket_writer(authenticatedSocket, 'stats:3'); + int lastCommitIdBeforeUpdate = int.parse( + jsonDecode((await read()).replaceAll('data:', ''))[0]['value']); + String randomString = Uuid().v4(); + + socket_writer(authenticatedSocket, + 'enroll:approve:{"enrollmentId":"$enrollmentId"}'); + await read(); + socket_writer(authenticatedSocket, + 'update:$secondAtSign:phone-$randomString.wavi$firstAtSign $randomString'); + await read(); + socket_writer(authenticatedSocket, + 'update:$secondAtSign:phone-$randomString.buzz$firstAtSign $randomString'); + await read(); + socket_writer(authenticatedSocket, + 'update:$secondAtSign:phone-$randomString.atmosphere$firstAtSign $randomString'); + await read(); + + socket_writer(authenticatedSocket, 'stats:3'); + expect( + int.parse( + jsonDecode((await read()).replaceAll('data:', ''))[0]['value']), + lastCommitIdBeforeUpdate + 4); + authenticatedSocket.close(); + + authenticatedSocket = + await secure_socket_connection(firstAtSignServer, firstAtSignPort); + socket_listener(authenticatedSocket); + + socket_writer(authenticatedSocket, 'from:$firstAtSign'); + String fromResponse = (await read()).replaceAll('data:', '').trim(); + String digest = generatePKAMDigest(firstAtSign, fromResponse); + socket_writer( + authenticatedSocket, 'pkam:enrollmentId:$enrollmentId:$digest'); + expect((await read()).trim(), 'data:success'); + socket_writer( + authenticatedSocket, 'sync:from:$lastCommitIdBeforeUpdate:limit:10'); + List syncResponse = jsonDecode((await read()).replaceAll('data:', '')); + expect(syncResponse.length, 2); + expect(syncResponse[0]['atKey'], + '$secondAtSign:phone-$randomString.wavi$firstAtSign'); + expect(syncResponse[0]['commitId'], lastCommitIdBeforeUpdate + 2); + + expect(syncResponse[1]['atKey'], + '$secondAtSign:phone-$randomString.buzz$firstAtSign'); + expect(syncResponse[1]['commitId'], lastCommitIdBeforeUpdate + 3); + }); + }); + tearDown(() { //Closing the client socket connection clear(); socketFirstAtsign!.destroy(); }); } + +Future _getOTPFromServer(SecureSocket socket, String atSign) async { + await prepare(socket, atSign); + await socket_writer(socket, 'otp:get'); + String otp = await read(); + otp = otp.replaceAll('data:', '').trim(); + return otp; +} From a13be692821a14ecff9f7ecfdfaaebaa56993357 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Wed, 20 Sep 2023 12:24:37 +0530 Subject: [PATCH 3/9] fix: Add dependency overrides for at_persistence_secondary_server --- .../test/commit_log_test.dart | 8 ++++---- packages/at_secondary_server/pubspec.yaml | 8 ++++++++ tests/at_functional_test/pubspec.yaml | 7 +++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/at_persistence_secondary_server/test/commit_log_test.dart b/packages/at_persistence_secondary_server/test/commit_log_test.dart index c4ff6a9fc..2bbb63efe 100644 --- a/packages/at_persistence_secondary_server/test/commit_log_test.dart +++ b/packages/at_persistence_secondary_server/test/commit_log_test.dart @@ -479,10 +479,10 @@ void main() async { for (int i = 0; i < 10; i++) { if (i % 2 == 0) { await commitLogKeystore.getBox().add(CommitEntry( - 'test_key_false_$i', CommitOp.UPDATE, DateTime.now())); + 'test_key_false_$i.wavi@alice', CommitOp.UPDATE, DateTime.now())); } else { await commitLogKeystore.getBox().add( - CommitEntry('test_key_false_$i', CommitOp.UPDATE, DateTime.now()) + CommitEntry('test_key_false_$i.wavi@alice', CommitOp.UPDATE, DateTime.now()) ..commitId = i); } } @@ -504,10 +504,10 @@ void main() async { for (int i = 0; i < 10; i++) { if (i % 2 == 0) { await commitLogKeystore.getBox().add( - CommitEntry('test_key_true_$i', CommitOp.UPDATE, DateTime.now())); + CommitEntry('test_key_true_$i.wavi@alice', CommitOp.UPDATE, DateTime.now())); } else { await commitLogKeystore.getBox().add( - CommitEntry('test_key_true_$i', CommitOp.UPDATE, DateTime.now()) + CommitEntry('test_key_true_$i.wavi@alice', CommitOp.UPDATE, DateTime.now()) ..commitId = i); } } diff --git a/packages/at_secondary_server/pubspec.yaml b/packages/at_secondary_server/pubspec.yaml index 4ecb1652a..93331e1f9 100644 --- a/packages/at_secondary_server/pubspec.yaml +++ b/packages/at_secondary_server/pubspec.yaml @@ -35,6 +35,14 @@ dependencies: yaml: 3.1.2 logging: 1.2.0 +dependency_overrides: + at_persistence_secondary_server: + git: + url: https://github.com/atsign-foundation/at_server.git + path: packages/at_persistence_secondary_server + ref: apkam_sync_persistence_changes + + dev_dependencies: test: ^1.24.4 coverage: ^1.6.1 diff --git a/tests/at_functional_test/pubspec.yaml b/tests/at_functional_test/pubspec.yaml index e0a4919e0..b88c78349 100644 --- a/tests/at_functional_test/pubspec.yaml +++ b/tests/at_functional_test/pubspec.yaml @@ -20,6 +20,13 @@ dependencies: uuid: ^3.0.7 elliptic: ^0.3.8 +dependency_overrides: + at_persistence_secondary_server: + git: + url: https://github.com/atsign-foundation/at_server.git + path: packages/at_persistence_secondary_server + ref: apkam_sync_persistence_changes + dev_dependencies: lints: ^1.0.1 test: ^1.24.3 From 8cea6bfde3b8c681720180b6849e0dc37fc60b62 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Wed, 20 Sep 2023 12:33:17 +0530 Subject: [PATCH 4/9] fix: Remove unused variables --- tests/at_functional_test/test/sync_verb_test.dart | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/at_functional_test/test/sync_verb_test.dart b/tests/at_functional_test/test/sync_verb_test.dart index 3a6f0d9de..967da96be 100644 --- a/tests/at_functional_test/test/sync_verb_test.dart +++ b/tests/at_functional_test/test/sync_verb_test.dart @@ -19,10 +19,6 @@ void main() { var secondAtSign = ConfigUtil.getYaml()!['second_atsign_server']['second_atsign_name']; - var secondAtSignServer = - ConfigUtil.getYaml()!['second_atsign_server']['second_atsign_url']; - var secondAtSignPort = - ConfigUtil.getYaml()!['second_atsign_server']['second_atsign_port']; Socket? socketFirstAtsign; From e9647ae2b6c19171e9746e121493d99e5b66b3fd Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Wed, 20 Sep 2023 15:30:46 +0530 Subject: [PATCH 5/9] fix: Add a work around for git-issue 1570 --- .../lib/src/log/commitlog/commit_log_keystore.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart b/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart index eccc20ee4..1c92a855c 100644 --- a/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart +++ b/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart @@ -338,6 +338,10 @@ class CommitLogKeyStore } bool _isNamespaceAuthorised(String atKey, List? enrolledNamespace) { + // This is work-around for : https://github.com/atsign-foundation/at_server/issues/1570 + if (atKey == 'configkey') { + return true; + } String? keyNamespace = AtKey.fromString(atKey).namespace; // If enrolledNamespace is null or keyNamespace is null, fallback to // existing behaviour - the key is authorized for the client to receive. So return true. From 16db9f79b2e7488832f99db87ecd6f62e0a7c6e7 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Tue, 10 Oct 2023 08:31:34 +0530 Subject: [PATCH 6/9] fix: Resolve merge conflicts --- .../log/commitlog/commit_log_keystore.dart | 38 +++++++++++++++---- .../test/commit_log_test.dart | 4 +- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart b/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart index 477dbb888..7cfed0020 100644 --- a/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart +++ b/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart @@ -58,9 +58,11 @@ class CommitLogKeyStore extends BaseCommitLogKeyStore { } /// Returns the latest committed sequence number with regex - Future lastCommittedSequenceNumberWithRegex(String regex) async { + Future lastCommittedSequenceNumberWithRegex(String regex, + {List? enrolledNamespace}) async { var lastCommittedEntry = (getBox() as Box).values.lastWhere( - (entry) => (_acceptKey(entry.atKey, regex)), + (entry) => (_acceptKey(entry.atKey, regex, + enrolledNamespace: enrolledNamespace)), orElse: () => NullCommitEntry()); var lastCommittedSequenceNum = (lastCommittedEntry != null) ? lastCommittedEntry.key : null; @@ -177,8 +179,30 @@ class CommitLogKeyStore extends BaseCommitLogKeyStore { } } - bool _acceptKey(String atKey, String regex) { - return _isRegexMatches(atKey, regex) || _isSpecialKey(atKey); + bool _acceptKey(String atKey, String regex, + {List? enrolledNamespace}) { + return _isNamespaceAuthorised(atKey, enrolledNamespace) && + (_isRegexMatches(atKey, regex) || _isSpecialKey(atKey)); + } + + bool _isNamespaceAuthorised(String atKey, List? enrolledNamespace) { + // This is work-around for : https://github.com/atsign-foundation/at_server/issues/1570 + if (atKey == 'configkey') { + return true; + } + String? keyNamespace = AtKey.fromString(atKey).namespace; + // If enrolledNamespace is null or keyNamespace is null, fallback to + // existing behaviour - the key is authorized for the client to receive. So return true. + if (enrolledNamespace == null || + enrolledNamespace.isEmpty || + (keyNamespace == null || keyNamespace.isEmpty)) { + return true; + } + if (enrolledNamespace.contains('*') || + enrolledNamespace.contains(keyNamespace)) { + return true; + } + return false; } bool _isRegexMatches(String atKey, String regex) { @@ -186,10 +210,10 @@ class CommitLogKeyStore extends BaseCommitLogKeyStore { } bool _isSpecialKey(String atKey) { - return atKey.contains(AT_ENCRYPTION_SHARED_KEY) || + return atKey.contains(AtConstants.atEncryptionSharedKey) || atKey.startsWith('public:') || - atKey.contains(AT_PKAM_SIGNATURE) || - atKey.contains(AT_SIGNING_PRIVATE_KEY); + atKey.contains(AtConstants.atPkamSignature) || + atKey.contains(AtConstants.atSigningPrivateKey); } /// Returns the latest commitEntry of the key. diff --git a/packages/at_persistence_secondary_server/test/commit_log_test.dart b/packages/at_persistence_secondary_server/test/commit_log_test.dart index 9b8fb42fa..c393b0c42 100644 --- a/packages/at_persistence_secondary_server/test/commit_log_test.dart +++ b/packages/at_persistence_secondary_server/test/commit_log_test.dart @@ -133,10 +133,10 @@ void main() async { for (int i = 0; i < 10; i++) { if (i % 2 == 0) { await commitLogKeystore.getBox().add(CommitEntry( - 'test_key_false_$i', CommitOp.UPDATE, DateTime.now())); + 'test_key_false_$i.wavi@alice', CommitOp.UPDATE, DateTime.now())); } else { await commitLogKeystore.getBox().add(CommitEntry( - 'test_key_false_$i', CommitOp.UPDATE, DateTime.now()) + 'test_key_false_$i.wavi@alice', CommitOp.UPDATE, DateTime.now()) ..commitId = i); } } From 8c09621c86ec7f256c9735d2096476b10d702805 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Tue, 10 Oct 2023 11:52:43 +0530 Subject: [PATCH 7/9] fix: convert configKey to lowercase before comparision --- .../lib/src/log/commitlog/commit_log_keystore.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart b/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart index 7cfed0020..e32a530d0 100644 --- a/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart +++ b/packages/at_persistence_secondary_server/lib/src/log/commitlog/commit_log_keystore.dart @@ -187,7 +187,7 @@ class CommitLogKeyStore extends BaseCommitLogKeyStore { bool _isNamespaceAuthorised(String atKey, List? enrolledNamespace) { // This is work-around for : https://github.com/atsign-foundation/at_server/issues/1570 - if (atKey == 'configkey') { + if (atKey.toLowerCase() == 'configkey') { return true; } String? keyNamespace = AtKey.fromString(atKey).namespace; From b1e3745b4c7c1ef23ed9744073a8684910d4a7de Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Mon, 16 Oct 2023 13:54:56 +0530 Subject: [PATCH 8/9] fix: Update at_persistence_secondary_version to 3.0.58 --- packages/at_secondary_server/CHANGELOG.md | 1 + .../lib/src/verb/handler/stats_verb_handler.dart | 8 ++++---- packages/at_secondary_server/pubspec.yaml | 10 +--------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/packages/at_secondary_server/CHANGELOG.md b/packages/at_secondary_server/CHANGELOG.md index 197669c6c..4a5017e56 100644 --- a/packages/at_secondary_server/CHANGELOG.md +++ b/packages/at_secondary_server/CHANGELOG.md @@ -2,6 +2,7 @@ - fix: Implement notify ephemeral changes - Send notification with value without caching the key on receiver's secondary server - feat: Implement AtRateLimiter to limit the enrollment requests on a particular connection - fix: Upgraded at_commons to 3.0.56 +- fix: Modify sync_progressive_verb_handler to filter responses on enrolled namespaces if authenticated via APKAM ## 3.0.35 - chore: Upgraded at_persistence_secondary_server to 3.0.57 for memory optimization in commit log - feat: APKAM keys verb implementation diff --git a/packages/at_secondary_server/lib/src/verb/handler/stats_verb_handler.dart b/packages/at_secondary_server/lib/src/verb/handler/stats_verb_handler.dart index 18931d8e9..725b1f200 100644 --- a/packages/at_secondary_server/lib/src/verb/handler/stats_verb_handler.dart +++ b/packages/at_secondary_server/lib/src/verb/handler/stats_verb_handler.dart @@ -121,11 +121,11 @@ class StatsVerbHandler extends AbstractVerbHandler { if (_regex == null || _regex.isEmpty) { _regex = '.*'; } + // When connection is authenticated via the APKAM, return the highest commit-Id + // among the specified namespaces. value = await (metric.name as LastCommitIDMetricImpl) .getMetrics(regex: _regex, enrolledNamespaces: enrolledNamespaces); } else if (id == '15' && _regex != null) { - // When connection is authenticated via the APKAM, return the highest commit-Id - // among the specified namespaces. value = await metric.name!.getMetrics(regex: _regex); } else { value = await metric.name!.getMetrics(); @@ -143,8 +143,8 @@ class StatsVerbHandler extends AbstractVerbHandler { HashMap verbParams, InboundConnection atConnection) async { try { - var statID = verbParams[AT_STAT_ID]; - _regex = verbParams[AT_REGEX]; + var statID = verbParams[AtConstants.statId]; + _regex = verbParams[AtConstants.regex]; logger.finer('In statsVerbHandler statID : $statID, regex : $_regex'); Set statsList; if (statID != null) { diff --git a/packages/at_secondary_server/pubspec.yaml b/packages/at_secondary_server/pubspec.yaml index 6bc59b403..8b96aef6b 100644 --- a/packages/at_secondary_server/pubspec.yaml +++ b/packages/at_secondary_server/pubspec.yaml @@ -25,7 +25,7 @@ dependencies: at_lookup: 3.0.40 at_server_spec: 3.0.15 at_persistence_spec: 2.0.14 - at_persistence_secondary_server: 3.0.57 + at_persistence_secondary_server: 3.0.58 expire_cache: ^2.0.1 intl: ^0.18.1 json_annotation: ^4.8.0 @@ -35,14 +35,6 @@ dependencies: yaml: 3.1.2 logging: 1.2.0 -dependency_overrides: - at_persistence_secondary_server: - git: - url: https://github.com/atsign-foundation/at_server.git - path: packages/at_persistence_secondary_server - ref: apkam_sync_persistence_changes - - dev_dependencies: test: ^1.24.4 coverage: ^1.6.1 From 5af23f2872acc257948ab52c7301013ce3c4a1a1 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Mon, 16 Oct 2023 14:19:38 +0530 Subject: [PATCH 9/9] fix: Remove dependency_overrides in functional test --- tests/at_functional_test/pubspec.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/at_functional_test/pubspec.yaml b/tests/at_functional_test/pubspec.yaml index b88c78349..e0a4919e0 100644 --- a/tests/at_functional_test/pubspec.yaml +++ b/tests/at_functional_test/pubspec.yaml @@ -20,13 +20,6 @@ dependencies: uuid: ^3.0.7 elliptic: ^0.3.8 -dependency_overrides: - at_persistence_secondary_server: - git: - url: https://github.com/atsign-foundation/at_server.git - path: packages/at_persistence_secondary_server - ref: apkam_sync_persistence_changes - dev_dependencies: lints: ^1.0.1 test: ^1.24.3