From cd07992798cdf3fc378bcb7b9444a9f5fc904899 Mon Sep 17 00:00:00 2001 From: Murali Date: Fri, 2 Feb 2024 16:02:14 +0530 Subject: [PATCH 1/4] feat: replace md5 persistence --- .../lib/src/model/at_meta_data.dart | 82 ++++++++++++++++++- .../pubspec.yaml | 7 +- 2 files changed, 85 insertions(+), 4 deletions(-) diff --git a/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart b/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart index 571f80850..2f9c662ce 100644 --- a/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart +++ b/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart @@ -77,6 +77,9 @@ class AtMetaData extends HiveObject { @HiveField(23) String? skeEncAlgo; + @HiveField(24) + PublicKeyHash? publicKeyHash; + @override String toString() { return toJson().toString(); @@ -95,6 +98,8 @@ class AtMetaData extends HiveObject { ..dataSignature = dataSignature ..sharedKeyEnc = sharedKeyEnc ..pubKeyCS = pubKeyCS + // name conflict between PublicKeyHash of persistence and at_commons + //..pubKeyHash = publicKeyHash ..encoding = encoding ..encKeyName = encKeyName ..encAlgo = encAlgo @@ -151,6 +156,7 @@ class AtMetaData extends HiveObject { map[AtConstants.ivOrNonce] = ivNonce; map[AtConstants.sharedKeyEncryptedEncryptingKeyName] = skeEncKeyName; map[AtConstants.sharedKeyEncryptedEncryptingAlgo] = skeEncAlgo; + map[AtConstants.sharedWithPublicKeyHash] = publicKeyHash; return map; } @@ -205,7 +211,7 @@ class AtMetaData extends HiveObject { ivNonce = json[AtConstants.ivOrNonce]; skeEncKeyName = json[AtConstants.sharedKeyEncryptedEncryptingKeyName]; skeEncAlgo = json[AtConstants.sharedKeyEncryptedEncryptingAlgo]; - + publicKeyHash = json[AtConstants.sharedWithPublicKeyHash]; return this; } @@ -232,6 +238,7 @@ class AtMetaData extends HiveObject { dataSignature == other.dataSignature && sharedKeyEnc == other.sharedKeyEnc && pubKeyCS == other.pubKeyCS && + publicKeyHash == other.publicKeyHash && encoding == other.encoding && encKeyName == other.encKeyName && encAlgo == other.encAlgo && @@ -259,6 +266,7 @@ class AtMetaData extends HiveObject { dataSignature.hashCode ^ sharedKeyEnc.hashCode ^ pubKeyCS.hashCode ^ + publicKeyHash.hashCode ^ encoding.hashCode ^ encKeyName.hashCode ^ encAlgo.hashCode ^ @@ -301,7 +309,8 @@ class AtMetaDataAdapter extends TypeAdapter { ..encAlgo = fields[20] ..ivNonce = fields[21] ..skeEncKeyName = fields[22] - ..skeEncAlgo = fields[23]; + ..skeEncAlgo = fields[23] + ..publicKeyHash = fields[24]; } @override @@ -355,6 +364,73 @@ class AtMetaDataAdapter extends TypeAdapter { ..writeByte(22) ..write(obj.skeEncKeyName) ..writeByte(23) - ..write(obj.skeEncAlgo); + ..write(obj.skeEncAlgo) + ..writeByte(24) + ..write(obj.publicKeyHash); + } +} + +@HiveType(typeId: 11) +class PublicKeyHash extends HiveObject { + String? hash; + String? hashingAlgo; + PublicKeyHash(); + Map toJson() { + Map map = {}; + map['hash'] = hash; + map['hashingAlgo'] = hashingAlgo; + return map; + } + + factory PublicKeyHash.fromJson(Map json) { + return PublicKeyHash().fromJson(json); + } + + PublicKeyHash fromJson(Map json) { + hash = json['hash']; + hashingAlgo = json['hashingAlgo']; + return this; + } + + @override + String toString() { + return toJson().toString(); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PublicKeyHash && + runtimeType == other.runtimeType && + hash == other.hash && + hashingAlgo == other.hashingAlgo; + + @override + int get hashCode => hash.hashCode ^ hashingAlgo.hashCode; +} + +class PublicKeyHashAdapter extends TypeAdapter { + @override + final int typeId = typeAdapterMap['PublicKeyHashAdapter']; + + @override + PublicKeyHash read(BinaryReader reader) { + var numOfFields = reader.readByte(); + var fields = { + for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return PublicKeyHash() + ..hash = fields[0] as String? + ..hashingAlgo = fields[1] as String?; + } + + @override + void write(BinaryWriter writer, PublicKeyHash obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.hash) + ..writeByte(1) + ..write(obj.hashingAlgo); } } diff --git a/packages/at_persistence_secondary_server/pubspec.yaml b/packages/at_persistence_secondary_server/pubspec.yaml index ce94fd209..ccce2c1a8 100644 --- a/packages/at_persistence_secondary_server/pubspec.yaml +++ b/packages/at_persistence_secondary_server/pubspec.yaml @@ -19,7 +19,12 @@ dependencies: at_persistence_spec: ^2.0.14 meta: ^1.8.0 -dev_dependencies: +dependency_overrides: + at_commons: + git: + url: https://github.com/atsign-foundation/at_libraries + path: packages/at_commons + ref: at_commons_replace_md5 lints: ^2.0.1 test: ^1.22.1 coverage: ^1.6.1 From 609c6ba081618b614992ed7492cf762e3ae5035f Mon Sep 17 00:00:00 2001 From: Murali Date: Sat, 3 Feb 2024 16:32:49 +0530 Subject: [PATCH 2/4] fix: at_meta_data changes --- .../lib/src/model/at_meta_data.dart | 102 ++++++++++-------- 1 file changed, 56 insertions(+), 46 deletions(-) diff --git a/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart b/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart index 2f9c662ce..beafa9d51 100644 --- a/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart +++ b/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart @@ -1,3 +1,4 @@ +import 'package:at_commons/at_commons.dart' as at_commons; import 'package:at_commons/at_commons.dart'; import 'package:at_persistence_secondary_server/at_persistence_secondary_server.dart'; import 'package:at_persistence_secondary_server/src/utils/type_adapter_util.dart'; @@ -87,8 +88,8 @@ class AtMetaData extends HiveObject { AtMetaData(); - Metadata toCommonsMetadata() { - return Metadata() + at_commons.Metadata toCommonsMetadata() { + return at_commons.Metadata() ..ttl = ttl ..ttb = ttb ..ttr = ttr @@ -98,8 +99,11 @@ class AtMetaData extends HiveObject { ..dataSignature = dataSignature ..sharedKeyEnc = sharedKeyEnc ..pubKeyCS = pubKeyCS - // name conflict between PublicKeyHash of persistence and at_commons - //..pubKeyHash = publicKeyHash + //#TODO handle null objects + ..pubKeyHash = (at_commons.PublicKeyHash() + ..hash = publicKeyHash?.hash + ..publicKeyHashingAlgo = + PublicKeyHashingAlgo.values.byName(publicKeyHash!.hashingAlgo!)) ..encoding = encoding ..encKeyName = encKeyName ..encAlgo = encAlgo @@ -108,7 +112,7 @@ class AtMetaData extends HiveObject { ..skeEncAlgo = skeEncAlgo; } - factory AtMetaData.fromCommonsMetadata(Metadata metadata) { + factory AtMetaData.fromCommonsMetadata(at_commons.Metadata metadata) { var atMetadata = AtMetaData(); atMetadata ..ttl = metadata.ttl @@ -120,6 +124,9 @@ class AtMetaData extends HiveObject { ..dataSignature = metadata.dataSignature ..sharedKeyEnc = metadata.sharedKeyEnc ..pubKeyCS = metadata.pubKeyCS + ..publicKeyHash = (PublicKeyHash() + ..hash = metadata.pubKeyHash!.hash + ..hashingAlgo = metadata.pubKeyHash!.publicKeyHashingAlgo!.name) ..encoding = metadata.encoding ..encKeyName = metadata.encKeyName ..encAlgo = metadata.encAlgo @@ -141,22 +148,24 @@ class AtMetaData extends HiveObject { map['refreshAt'] = refreshAt?.toUtc().toString(); map['status'] = status; map['version'] = version; - map[AtConstants.ttl] = ttl; - map[AtConstants.ttb] = ttb; - map[AtConstants.ttr] = ttr; - map[AtConstants.ccd] = isCascade; - map[AtConstants.isBinary] = isBinary; - map[AtConstants.isEncrypted] = isEncrypted; - map[AtConstants.publicDataSignature] = dataSignature; - map[AtConstants.sharedKeyEncrypted] = sharedKeyEnc; - map[AtConstants.sharedWithPublicKeyCheckSum] = pubKeyCS; - map[AtConstants.encoding] = encoding; - map[AtConstants.encryptingKeyName] = encKeyName; - map[AtConstants.encryptingAlgo] = encAlgo; - map[AtConstants.ivOrNonce] = ivNonce; - map[AtConstants.sharedKeyEncryptedEncryptingKeyName] = skeEncKeyName; - map[AtConstants.sharedKeyEncryptedEncryptingAlgo] = skeEncAlgo; - map[AtConstants.sharedWithPublicKeyHash] = publicKeyHash; + map[at_commons.AtConstants.ttl] = ttl; + map[at_commons.AtConstants.ttb] = ttb; + map[at_commons.AtConstants.ttr] = ttr; + map[at_commons.AtConstants.ccd] = isCascade; + map[at_commons.AtConstants.isBinary] = isBinary; + map[at_commons.AtConstants.isEncrypted] = isEncrypted; + map[at_commons.AtConstants.publicDataSignature] = dataSignature; + map[at_commons.AtConstants.sharedKeyEncrypted] = sharedKeyEnc; + map[at_commons.AtConstants.sharedWithPublicKeyCheckSum] = pubKeyCS; + map[at_commons.AtConstants.encoding] = encoding; + map[at_commons.AtConstants.encryptingKeyName] = encKeyName; + map[at_commons.AtConstants.encryptingAlgo] = encAlgo; + map[at_commons.AtConstants.ivOrNonce] = ivNonce; + map[at_commons.AtConstants.sharedKeyEncryptedEncryptingKeyName] = + skeEncKeyName; + map[at_commons.AtConstants.sharedKeyEncryptedEncryptingAlgo] = skeEncAlgo; + map[at_commons.AtConstants.sharedWithPublicKeyHash] = + publicKeyHash?.toJson(); return map; } @@ -184,34 +193,35 @@ class AtMetaData extends HiveObject { : (json['version'] == null) ? 0 : json['version']; - ttl = (json[AtConstants.ttl] is String) - ? int.parse(json[AtConstants.ttl]) - : (json[AtConstants.ttl] == null) + ttl = (json[at_commons.AtConstants.ttl] is String) + ? int.parse(json[at_commons.AtConstants.ttl]) + : (json[at_commons.AtConstants.ttl] == null) ? null - : json[AtConstants.ttl]; - ttb = (json[AtConstants.ttb] is String) - ? int.parse(json[AtConstants.ttb]) - : (json[AtConstants.ttb] == null) + : json[at_commons.AtConstants.ttl]; + ttb = (json[at_commons.AtConstants.ttb] is String) + ? int.parse(json[at_commons.AtConstants.ttb]) + : (json[at_commons.AtConstants.ttb] == null) ? null - : json[AtConstants.ttb]; - ttr = (json[AtConstants.ttr] is String) - ? int.parse(json[AtConstants.ttr]) - : (json[AtConstants.ttr] == null) + : json[at_commons.AtConstants.ttb]; + ttr = (json[at_commons.AtConstants.ttr] is String) + ? int.parse(json[at_commons.AtConstants.ttr]) + : (json[at_commons.AtConstants.ttr] == null) ? null - : json[AtConstants.ttr]; - isCascade = json[AtConstants.ccd]; - isBinary = json[AtConstants.isBinary]; - isEncrypted = json[AtConstants.isEncrypted]; - dataSignature = json[AtConstants.publicDataSignature]; - sharedKeyEnc = json[AtConstants.sharedKeyEncrypted]; - pubKeyCS = json[AtConstants.sharedWithPublicKeyCheckSum]; - encoding = json[AtConstants.encoding]; - encKeyName = json[AtConstants.encryptingKeyName]; - encAlgo = json[AtConstants.encryptingAlgo]; - ivNonce = json[AtConstants.ivOrNonce]; - skeEncKeyName = json[AtConstants.sharedKeyEncryptedEncryptingKeyName]; - skeEncAlgo = json[AtConstants.sharedKeyEncryptedEncryptingAlgo]; - publicKeyHash = json[AtConstants.sharedWithPublicKeyHash]; + : json[at_commons.AtConstants.ttr]; + isCascade = json[at_commons.AtConstants.ccd]; + isBinary = json[at_commons.AtConstants.isBinary]; + isEncrypted = json[at_commons.AtConstants.isEncrypted]; + dataSignature = json[at_commons.AtConstants.publicDataSignature]; + sharedKeyEnc = json[at_commons.AtConstants.sharedKeyEncrypted]; + pubKeyCS = json[at_commons.AtConstants.sharedWithPublicKeyCheckSum]; + encoding = json[at_commons.AtConstants.encoding]; + encKeyName = json[at_commons.AtConstants.encryptingKeyName]; + encAlgo = json[at_commons.AtConstants.encryptingAlgo]; + ivNonce = json[at_commons.AtConstants.ivOrNonce]; + skeEncKeyName = + json[at_commons.AtConstants.sharedKeyEncryptedEncryptingKeyName]; + skeEncAlgo = json[at_commons.AtConstants.sharedKeyEncryptedEncryptingAlgo]; + publicKeyHash = json[at_commons.AtConstants.sharedWithPublicKeyHash]; return this; } From e7d30f56614ba7d6f2fc0d794171d83836bbece7 Mon Sep 17 00:00:00 2001 From: Murali Date: Tue, 6 Feb 2024 19:31:54 +0530 Subject: [PATCH 3/4] feat: added unit test --- .../lib/src/keystore/hive_manager.dart | 3 ++ .../lib/src/model/at_meta_data.dart | 52 ++++++++++--------- .../lib/src/utils/type_adapter_util.dart | 3 +- .../test/at_metadata_test.dart | 39 +++++++++++--- 4 files changed, 63 insertions(+), 34 deletions(-) diff --git a/packages/at_persistence_secondary_server/lib/src/keystore/hive_manager.dart b/packages/at_persistence_secondary_server/lib/src/keystore/hive_manager.dart index be7e6f82b..fcab1e9d2 100644 --- a/packages/at_persistence_secondary_server/lib/src/keystore/hive_manager.dart +++ b/packages/at_persistence_secondary_server/lib/src/keystore/hive_manager.dart @@ -31,6 +31,9 @@ class HivePersistenceManager with HiveBase { if (!Hive.isAdapterRegistered(AtMetaDataAdapter().typeId)) { Hive.registerAdapter(AtMetaDataAdapter()); } + if (!Hive.isAdapterRegistered(PublicKeyHashAdapter().typeId)) { + Hive.registerAdapter(PublicKeyHashAdapter()); + } var secret = await _getHiveSecretFromFile(_atsign!, storagePath); _boxName = AtUtils.getShaForAtSign(_atsign!); diff --git a/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart b/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart index beafa9d51..d2eb10cd8 100644 --- a/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart +++ b/packages/at_persistence_secondary_server/lib/src/model/at_meta_data.dart @@ -1,5 +1,4 @@ import 'package:at_commons/at_commons.dart' as at_commons; -import 'package:at_commons/at_commons.dart'; import 'package:at_persistence_secondary_server/at_persistence_secondary_server.dart'; import 'package:at_persistence_secondary_server/src/utils/type_adapter_util.dart'; import 'package:hive/hive.dart'; @@ -99,11 +98,7 @@ class AtMetaData extends HiveObject { ..dataSignature = dataSignature ..sharedKeyEnc = sharedKeyEnc ..pubKeyCS = pubKeyCS - //#TODO handle null objects - ..pubKeyHash = (at_commons.PublicKeyHash() - ..hash = publicKeyHash?.hash - ..publicKeyHashingAlgo = - PublicKeyHashingAlgo.values.byName(publicKeyHash!.hashingAlgo!)) + ..pubKeyHash = _toCommonsPublicKeyHash(publicKeyHash) ..encoding = encoding ..encKeyName = encKeyName ..encAlgo = encAlgo @@ -112,6 +107,16 @@ class AtMetaData extends HiveObject { ..skeEncAlgo = skeEncAlgo; } + at_commons.PublicKeyHash? _toCommonsPublicKeyHash( + PublicKeyHash? publicKeyHash) => + publicKeyHash != null + ? at_commons.PublicKeyHash( + publicKeyHash.hash, + at_commons.PublicKeyHashingAlgo.values + .byName(publicKeyHash.hashingAlgo), + ) + : null; + factory AtMetaData.fromCommonsMetadata(at_commons.Metadata metadata) { var atMetadata = AtMetaData(); atMetadata @@ -124,9 +129,10 @@ class AtMetaData extends HiveObject { ..dataSignature = metadata.dataSignature ..sharedKeyEnc = metadata.sharedKeyEnc ..pubKeyCS = metadata.pubKeyCS - ..publicKeyHash = (PublicKeyHash() - ..hash = metadata.pubKeyHash!.hash - ..hashingAlgo = metadata.pubKeyHash!.publicKeyHashingAlgo!.name) + ..publicKeyHash = (metadata.pubKeyHash != null + ? PublicKeyHash(metadata.pubKeyHash!.hash, + metadata.pubKeyHash!.publicKeyHashingAlgo.name) + : null) ..encoding = metadata.encoding ..encKeyName = metadata.encKeyName ..encAlgo = metadata.encAlgo @@ -221,7 +227,8 @@ class AtMetaData extends HiveObject { skeEncKeyName = json[at_commons.AtConstants.sharedKeyEncryptedEncryptingKeyName]; skeEncAlgo = json[at_commons.AtConstants.sharedKeyEncryptedEncryptingAlgo]; - publicKeyHash = json[at_commons.AtConstants.sharedWithPublicKeyHash]; + publicKeyHash = PublicKeyHash.fromJson( + json[at_commons.AtConstants.sharedWithPublicKeyHash]); return this; } @@ -326,7 +333,7 @@ class AtMetaDataAdapter extends TypeAdapter { @override void write(BinaryWriter writer, AtMetaData obj) { writer - ..writeByte(24) + ..writeByte(25) ..writeByte(0) ..write(obj.createdBy) ..writeByte(1) @@ -382,9 +389,9 @@ class AtMetaDataAdapter extends TypeAdapter { @HiveType(typeId: 11) class PublicKeyHash extends HiveObject { - String? hash; - String? hashingAlgo; - PublicKeyHash(); + String hash; + String hashingAlgo; + PublicKeyHash(this.hash, this.hashingAlgo); Map toJson() { Map map = {}; map['hash'] = hash; @@ -392,14 +399,11 @@ class PublicKeyHash extends HiveObject { return map; } - factory PublicKeyHash.fromJson(Map json) { - return PublicKeyHash().fromJson(json); - } - - PublicKeyHash fromJson(Map json) { - hash = json['hash']; - hashingAlgo = json['hashingAlgo']; - return this; + static PublicKeyHash? fromJson(Map? json) { + if (json == null) { + return null; + } + return PublicKeyHash(json['hash'], json['hashingAlgo']); } @override @@ -429,9 +433,7 @@ class PublicKeyHashAdapter extends TypeAdapter { var fields = { for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; - return PublicKeyHash() - ..hash = fields[0] as String? - ..hashingAlgo = fields[1] as String?; + return PublicKeyHash(fields[0] as String, fields[1] as String); } @override diff --git a/packages/at_persistence_secondary_server/lib/src/utils/type_adapter_util.dart b/packages/at_persistence_secondary_server/lib/src/utils/type_adapter_util.dart index 8c8da9e70..445c375ed 100644 --- a/packages/at_persistence_secondary_server/lib/src/utils/type_adapter_util.dart +++ b/packages/at_persistence_secondary_server/lib/src/utils/type_adapter_util.dart @@ -10,5 +10,6 @@ final Map typeAdapterMap = { 'NotificationTypeAdapter': 7, 'OperationTypeAdapter': 8, 'NotificationPriorityAdapter': 9, - 'MessageTypeAdapter': 10 + 'MessageTypeAdapter': 10, + 'PublicKeyHashAdapter': 11 }; diff --git a/packages/at_persistence_secondary_server/test/at_metadata_test.dart b/packages/at_persistence_secondary_server/test/at_metadata_test.dart index 49e7a5681..1098dcbd9 100644 --- a/packages/at_persistence_secondary_server/test/at_metadata_test.dart +++ b/packages/at_persistence_secondary_server/test/at_metadata_test.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'dart:io'; -import 'package:at_commons/at_commons.dart'; +import 'package:at_commons/at_commons.dart' as at_commons; import 'package:at_persistence_secondary_server/at_persistence_secondary_server.dart'; import 'package:collection/collection.dart'; import 'package:test/test.dart'; @@ -135,11 +135,34 @@ void main() async { expect(atData.metaData!.version, 1); expect(atData.metaData!.ttl, 10000); }); + test( + 'A test to verify public key hash object in metadata is set and retrieved correctly', + () async { + var hiveKeyStore = SecondaryPersistenceStoreFactory.getInstance() + .getSecondaryPersistenceStore(atSign)! + .getSecondaryKeyStore(); + var key = '@bob:mobile@alice'; + var value = '12345678'; + var metaData = AtMetaData() + ..publicKeyHash = PublicKeyHash('randomhash', 'sha512'); + await hiveKeyStore?.put( + key, + AtData() + ..data = value + ..metaData = metaData); + var atData = await hiveKeyStore?.get(key); + expect(atData?.data, '12345678'); + expect(atData?.metaData, isNotNull); + expect(atData?.metaData!.createdBy, atSign); + expect(atData?.metaData!.publicKeyHash, isNotNull); + expect(atData?.metaData!.publicKeyHash!.hash, 'randomhash'); + expect(atData?.metaData!.publicKeyHash!.hashingAlgo, 'sha512'); + }); tearDownAll(() async => await tearDownFunc()); }); group('A group of tests to verify at_metadata adapter', () { test('at_meta_data adapter test', () async { - final metaData = Metadata() + final metaData = at_commons.Metadata() ..ttl = 1000 ..ccd = true ..pubKeyCS = 'xyz' @@ -156,7 +179,7 @@ void main() async { group('Test json round-tripping', () { test('Test without null values', () { - final Metadata startMetaData = Metadata() + final at_commons.Metadata startMetaData = at_commons.Metadata() ..ttl = 100 ..ttb = 200 ..ttr = 3600 @@ -180,11 +203,11 @@ void main() async { expect(DeepCollectionEquality().equals(endMap, startMap), true); AtMetaData endAtMetaData = AtMetaData().fromJson(endMap); expect(endAtMetaData, startAtMetaData); - final Metadata endMetaData = endAtMetaData.toCommonsMetadata(); + final at_commons.Metadata endMetaData = endAtMetaData.toCommonsMetadata(); expect(endMetaData, startMetaData); }); test('Test with null values', () { - final Metadata startMetaData = Metadata() + final at_commons.Metadata startMetaData = at_commons.Metadata() ..ttl = null ..ttb = null ..ttr = null @@ -208,11 +231,11 @@ void main() async { expect(DeepCollectionEquality().equals(endMap, startMap), true); AtMetaData endAtMetaData = AtMetaData().fromJson(endMap); expect(endAtMetaData, startAtMetaData); - final Metadata endMetaData = endAtMetaData.toCommonsMetadata(); + final at_commons.Metadata endMetaData = endAtMetaData.toCommonsMetadata(); expect(endMetaData, startMetaData); }); test('Test with some null, some non-null values', () { - final Metadata startMetaData = Metadata() + final at_commons.Metadata startMetaData = at_commons.Metadata() ..ttl = 0 ..ttb = 0 ..ttr = 0 @@ -236,7 +259,7 @@ void main() async { expect(DeepCollectionEquality().equals(endMap, startMap), true); AtMetaData endAtMetaData = AtMetaData().fromJson(endMap); expect(endAtMetaData, startAtMetaData); - final Metadata endMetaData = endAtMetaData.toCommonsMetadata(); + final at_commons.Metadata endMetaData = endAtMetaData.toCommonsMetadata(); expect(endMetaData, startMetaData); }); }); From a16b858567dc00cf7f6647d37dcc95ba06909007 Mon Sep 17 00:00:00 2001 From: Murali Date: Tue, 6 Feb 2024 19:59:59 +0530 Subject: [PATCH 4/4] fix: replace at_commons with trunk branch in dependency overrides --- packages/at_persistence_secondary_server/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/at_persistence_secondary_server/pubspec.yaml b/packages/at_persistence_secondary_server/pubspec.yaml index ccce2c1a8..ffa7e4de3 100644 --- a/packages/at_persistence_secondary_server/pubspec.yaml +++ b/packages/at_persistence_secondary_server/pubspec.yaml @@ -24,7 +24,7 @@ dependency_overrides: git: url: https://github.com/atsign-foundation/at_libraries path: packages/at_commons - ref: at_commons_replace_md5 + ref: trunk lints: ^2.0.1 test: ^1.22.1 coverage: ^1.6.1