From c50729c833982202b63859faf27acc3cafc68c63 Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Thu, 14 Dec 2023 15:48:56 +0530 Subject: [PATCH 1/7] fix: Uptake at_commons 4.0.0 changes --- packages/at_auth/lib/src/at_auth_impl.dart | 13 +++++++------ .../lib/src/enroll/at_enrollment_impl.dart | 15 ++++++++------- .../lib/src/enroll/at_enrollment_response.dart | 2 +- packages/at_auth/pubspec.yaml | 14 +++++++++++++- packages/at_auth/test/at_auth_test.dart | 2 +- packages/at_auth/test/enrollment_test.dart | 2 +- 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/packages/at_auth/lib/src/at_auth_impl.dart b/packages/at_auth/lib/src/at_auth_impl.dart index 8339bfe0..04518125 100644 --- a/packages/at_auth/lib/src/at_auth_impl.dart +++ b/packages/at_auth/lib/src/at_auth_impl.dart @@ -179,16 +179,17 @@ class AtAuthImpl implements AtAuth { // and delete cram key from server final encryptionPublicKey = atAuthKeys.defaultEncryptionPublicKey; UpdateVerbBuilder updateBuilder = UpdateVerbBuilder() - ..atKey = 'publickey' - ..isPublic = true - ..value = encryptionPublicKey - ..sharedBy = atOnboardingRequest.atSign; + ..atKey = (AtKey() + ..key = 'publickey' + ..sharedBy = atOnboardingRequest.atSign + ..metadata = (Metadata()..isPublic = true)) + ..value = encryptionPublicKey; String? encryptKeyUpdateResult = await atLookUp!.executeVerb(updateBuilder); _logger.info('Encryption public key update result $encryptKeyUpdateResult'); //8. Delete cram secret from the keystore as cram auth is complete DeleteVerbBuilder deleteBuilder = DeleteVerbBuilder() - ..atKey = AtConstants.atCramSecret; + ..atKey = (AtKey()..key = AtConstants.atCramSecret); String? deleteResponse = await atLookUp!.executeVerb(deleteBuilder); _logger.info('Cram secret delete response : $deleteResponse'); atOnboardingResponse.isSuccessful = true; @@ -251,7 +252,7 @@ class AtAuthImpl implements AtAuth { _logger.finer('enrollment response: ${enrollmentResponse.toString()}'); var enrollmentIdFromServer = enrollmentResponse.enrollmentId; var enrollmentStatus = enrollmentResponse.enrollStatus; - if (enrollmentStatus != EnrollStatus.approved) { + if (enrollmentStatus != EnrollmentStatus.approved) { throw AtAuthenticationException( 'initial enrollment is not approved. Status from server: $enrollmentStatus'); } diff --git a/packages/at_auth/lib/src/enroll/at_enrollment_impl.dart b/packages/at_auth/lib/src/enroll/at_enrollment_impl.dart index 13252aa7..dbf7d4f1 100644 --- a/packages/at_auth/lib/src/enroll/at_enrollment_impl.dart +++ b/packages/at_auth/lib/src/enroll/at_enrollment_impl.dart @@ -94,8 +94,9 @@ class AtEnrollmentImpl implements AtEnrollmentBase { Future _getDefaultEncryptionPublicKey(AtLookUp atLookupImpl) async { var lookupVerbBuilder = LookupVerbBuilder() - ..atKey = 'publickey' - ..sharedBy = _atSign; + ..atKey = (AtKey() + ..key = 'publickey' + ..sharedBy = _atSign); String? lookupResult = await atLookupImpl.executeVerb(lookupVerbBuilder); if (lookupResult == null || lookupResult.isEmpty) { throw AtEnrollmentException( @@ -164,15 +165,15 @@ class AtEnrollmentImpl implements AtEnrollmentBase { _convertEnrollmentStatusToEnum(String enrollmentStatus) { switch (enrollmentStatus) { case 'approved': - return EnrollStatus.approved; + return EnrollmentStatus.approved; case 'denied:': - return EnrollStatus.denied; + return EnrollmentStatus.denied; case 'expired': - return EnrollStatus.expired; + return EnrollmentStatus.expired; case 'revoked': - return EnrollStatus.revoked; + return EnrollmentStatus.revoked; case 'pending': - return EnrollStatus.pending; + return EnrollmentStatus.pending; default: throw AtEnrollmentException( '$enrollmentStatus is not a valid enrollment status'); diff --git a/packages/at_auth/lib/src/enroll/at_enrollment_response.dart b/packages/at_auth/lib/src/enroll/at_enrollment_response.dart index fe8ae6f8..6b93c41b 100644 --- a/packages/at_auth/lib/src/enroll/at_enrollment_response.dart +++ b/packages/at_auth/lib/src/enroll/at_enrollment_response.dart @@ -8,7 +8,7 @@ class AtEnrollmentResponse { String enrollmentId; /// The status of the enrollment operation. - EnrollStatus enrollStatus; + EnrollmentStatus enrollStatus; /// Optional authentication keys associated with the enrollment. AtAuthKeys? atAuthKeys; diff --git a/packages/at_auth/pubspec.yaml b/packages/at_auth/pubspec.yaml index 7d42f3a5..66fce953 100644 --- a/packages/at_auth/pubspec.yaml +++ b/packages/at_auth/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: '>=3.0.0 <4.0.0' dependencies: - at_commons: ^3.0.58 + at_commons: ^4.0.0 at_lookup: ^3.0.43 at_chops: ^1.0.6 at_utils: ^3.0.15 @@ -16,6 +16,18 @@ dependencies: at_demo_data: ^1.0.3 crypton: ^2.1.0 +dependency_overrides: + at_lookup: + git: + url: https://github.com/atsign-foundation/at_libraries.git + path: packages/at_lookup + ref: uptake_commons_changes_into_lookup + at_chops: + git: + url: https://github.com/atsign-foundation/at_libraries.git + path: packages/at_chops + ref: uptake_commons_into_atchops + dev_dependencies: lints: ^2.0.0 test: ^1.24.7 diff --git a/packages/at_auth/test/at_auth_test.dart b/packages/at_auth/test/at_auth_test.dart index 25ec7b48..6f52634a 100644 --- a/packages/at_auth/test/at_auth_test.dart +++ b/packages/at_auth/test/at_auth_test.dart @@ -221,7 +221,7 @@ void main() { .thenAnswer((_) => Future.value(AtAuthResponse('@aliceđź› ')..isSuccessful = true)); final mockEnrollmentResponse = - AtEnrollmentResponse("abc123", EnrollStatus.approved); + AtEnrollmentResponse("abc123", EnrollmentStatus.approved); when(() => mockAtEnrollment.submitEnrollment(any(), mockAtLookUp)) .thenAnswer((_) => Future.value(mockEnrollmentResponse)); final atOnboardingRequest = AtOnboardingRequest('@aliceđź› ') diff --git a/packages/at_auth/test/enrollment_test.dart b/packages/at_auth/test/enrollment_test.dart index 556ee53c..d6171df5 100644 --- a/packages/at_auth/test/enrollment_test.dart +++ b/packages/at_auth/test/enrollment_test.dart @@ -94,7 +94,7 @@ void main() { AtEnrollmentResponse atEnrollmentResponse = await atEnrollmentServiceImpl .submitEnrollment(atNewEnrollmentRequest, mockAtLookUp); expect(atEnrollmentResponse.enrollmentId, '123'); - expect(atEnrollmentResponse.enrollStatus, EnrollStatus.pending); + expect(atEnrollmentResponse.enrollStatus, EnrollmentStatus.pending); }); group('A group of test related to AtEnrollmentBuilder', () { From 4cea2d1f9588a28408b9e9ef715bd0578fba2a7a Mon Sep 17 00:00:00 2001 From: purnimavenkatasubbu Date: Wed, 27 Dec 2023 13:29:06 +0530 Subject: [PATCH 2/7] updated changeLog and versions in pubspec --- packages/at_auth/CHANGELOG.md | 6 ++++++ packages/at_auth/pubspec.yaml | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/packages/at_auth/CHANGELOG.md b/packages/at_auth/CHANGELOG.md index 4276d34a..3adda9fa 100644 --- a/packages/at_auth/CHANGELOG.md +++ b/packages/at_auth/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.0.4 +- build[deps]: Upgraded the following packages: + - at_commons to v4.0.0 + - at_utils to v3.0.16 + - at_chops to v1.0.7 + - at_lookup to v3.0.44 ## 1.0.3 - fix: upgrade at_lookup to 3.0.43 since 3.0.42 has breaking change for private key reference ## 1.0.2 diff --git a/packages/at_auth/pubspec.yaml b/packages/at_auth/pubspec.yaml index 66fce953..4140d8de 100644 --- a/packages/at_auth/pubspec.yaml +++ b/packages/at_auth/pubspec.yaml @@ -1,6 +1,6 @@ name: at_auth description: Package that implements common logic for onboarding/authenticating an atsign to a secondary server -version: 1.0.3 +version: 1.0.4 homepage: https://atsign.com/ repository: https://github.com/atsign-foundation/at_libraries @@ -9,24 +9,24 @@ environment: dependencies: at_commons: ^4.0.0 - at_lookup: ^3.0.43 - at_chops: ^1.0.6 - at_utils: ^3.0.15 + at_lookup: ^3.0.44 + at_chops: ^1.0.7 + at_utils: ^3.0.16 meta: ^1.8.0 at_demo_data: ^1.0.3 crypton: ^2.1.0 -dependency_overrides: - at_lookup: - git: - url: https://github.com/atsign-foundation/at_libraries.git - path: packages/at_lookup - ref: uptake_commons_changes_into_lookup - at_chops: - git: - url: https://github.com/atsign-foundation/at_libraries.git - path: packages/at_chops - ref: uptake_commons_into_atchops +# dependency_overrides: +# at_lookup: +# git: +# url: https://github.com/atsign-foundation/at_libraries.git +# path: packages/at_lookup +# ref: uptake_commons_changes_into_lookup +# at_chops: +# git: +# url: https://github.com/atsign-foundation/at_libraries.git +# path: packages/at_chops +# ref: uptake_commons_into_atchops dev_dependencies: lints: ^2.0.0 From 7ddddd9379796977af1a38138b3862e6c714fe7e Mon Sep 17 00:00:00 2001 From: purnimavenkatasubbu Date: Wed, 27 Dec 2023 15:19:45 +0530 Subject: [PATCH 3/7] fix dependency issue --- packages/at_onboarding_cli/pubspec.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/at_onboarding_cli/pubspec.yaml b/packages/at_onboarding_cli/pubspec.yaml index 44828c56..4b94d69c 100644 --- a/packages/at_onboarding_cli/pubspec.yaml +++ b/packages/at_onboarding_cli/pubspec.yaml @@ -21,13 +21,16 @@ dependencies: path: ^1.8.1 zxing2: ^0.2.0 at_auth: ^1.0.3 - at_chops: ^1.0.6 + at_chops: ^1.0.7 at_client: ^3.0.69 - at_commons: ^3.0.58 - at_lookup: ^3.0.43 + at_commons: ^4.0.0 + at_lookup: ^3.0.44 at_server_status: ^1.0.3 - at_utils: ^3.0.15 + at_utils: ^3.0.16 +dependency_overrides: + at_auth: + path: /home/shaikirfan/Desktop/uptake_Commons_into_at_auth/at_libraries/packages/at_auth dev_dependencies: lints: ^2.1.0 test: ^1.24.2 From 5745c6937820f0506f832ae6c5f427b2f3f800f6 Mon Sep 17 00:00:00 2001 From: purnimavenkatasubbu Date: Wed, 27 Dec 2023 15:26:15 +0530 Subject: [PATCH 4/7] removed local path --- packages/at_onboarding_cli/pubspec.yaml | 11 ++++++----- tests/at_onboarding_cli_functional_tests/pubspec.yaml | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/at_onboarding_cli/pubspec.yaml b/packages/at_onboarding_cli/pubspec.yaml index 4b94d69c..660c8d1f 100644 --- a/packages/at_onboarding_cli/pubspec.yaml +++ b/packages/at_onboarding_cli/pubspec.yaml @@ -21,16 +21,17 @@ dependencies: path: ^1.8.1 zxing2: ^0.2.0 at_auth: ^1.0.3 - at_chops: ^1.0.7 + at_chops: ^1.0.6 at_client: ^3.0.69 - at_commons: ^4.0.0 - at_lookup: ^3.0.44 + at_commons: ^3.0.58 + at_lookup: ^3.0.43 at_server_status: ^1.0.3 - at_utils: ^3.0.16 + at_utils: ^3.0.15 dependency_overrides: at_auth: - path: /home/shaikirfan/Desktop/uptake_Commons_into_at_auth/at_libraries/packages/at_auth + path: ../at_auth + at_commons: ^4.0.0 dev_dependencies: lints: ^2.1.0 test: ^1.24.2 diff --git a/tests/at_onboarding_cli_functional_tests/pubspec.yaml b/tests/at_onboarding_cli_functional_tests/pubspec.yaml index 67785dc4..ae50bd94 100644 --- a/tests/at_onboarding_cli_functional_tests/pubspec.yaml +++ b/tests/at_onboarding_cli_functional_tests/pubspec.yaml @@ -19,6 +19,7 @@ dependencies: dependency_overrides: at_auth: path: ../../packages/at_auth + at_commons: ^4.0.0 dev_dependencies: lints: ^1.0.0 From e9d5e6b75ec9ee941dfa874e668047de7fabd511 Mon Sep 17 00:00:00 2001 From: purnimavenkatasubbu Date: Mon, 22 Jan 2024 20:49:42 +0530 Subject: [PATCH 5/7] removed commented lines --- packages/at_auth/pubspec.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/at_auth/pubspec.yaml b/packages/at_auth/pubspec.yaml index 4140d8de..77a37594 100644 --- a/packages/at_auth/pubspec.yaml +++ b/packages/at_auth/pubspec.yaml @@ -16,18 +16,6 @@ dependencies: at_demo_data: ^1.0.3 crypton: ^2.1.0 -# dependency_overrides: -# at_lookup: -# git: -# url: https://github.com/atsign-foundation/at_libraries.git -# path: packages/at_lookup -# ref: uptake_commons_changes_into_lookup -# at_chops: -# git: -# url: https://github.com/atsign-foundation/at_libraries.git -# path: packages/at_chops -# ref: uptake_commons_into_atchops - dev_dependencies: lints: ^2.0.0 test: ^1.24.7 From 91759289b58ca4f3d7f334c03c9ec5d06a69efb8 Mon Sep 17 00:00:00 2001 From: purnimavenkatasubbu Date: Mon, 22 Jan 2024 21:01:53 +0530 Subject: [PATCH 6/7] removed dep in onboarding_cli --- packages/at_onboarding_cli/pubspec.yaml | 4 ---- tests/at_onboarding_cli_functional_tests/pubspec.yaml | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/at_onboarding_cli/pubspec.yaml b/packages/at_onboarding_cli/pubspec.yaml index 660c8d1f..44828c56 100644 --- a/packages/at_onboarding_cli/pubspec.yaml +++ b/packages/at_onboarding_cli/pubspec.yaml @@ -28,10 +28,6 @@ dependencies: at_server_status: ^1.0.3 at_utils: ^3.0.15 -dependency_overrides: - at_auth: - path: ../at_auth - at_commons: ^4.0.0 dev_dependencies: lints: ^2.1.0 test: ^1.24.2 diff --git a/tests/at_onboarding_cli_functional_tests/pubspec.yaml b/tests/at_onboarding_cli_functional_tests/pubspec.yaml index ae50bd94..ae3b33de 100644 --- a/tests/at_onboarding_cli_functional_tests/pubspec.yaml +++ b/tests/at_onboarding_cli_functional_tests/pubspec.yaml @@ -16,10 +16,10 @@ dependencies: at_utils: ^3.0.15 at_lookup: ^3.0.40 -dependency_overrides: - at_auth: - path: ../../packages/at_auth - at_commons: ^4.0.0 +# dependency_overrides: +# at_auth: +# path: ../../packages/at_auth +# at_commons: ^4.0.0 dev_dependencies: lints: ^1.0.0 From 3ef7603e3bfaef07719e0b771e1585a7bc255130 Mon Sep 17 00:00:00 2001 From: purnimavenkatasubbu Date: Tue, 23 Jan 2024 11:28:41 +0530 Subject: [PATCH 7/7] removed commented lines --- tests/at_onboarding_cli_functional_tests/pubspec.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/at_onboarding_cli_functional_tests/pubspec.yaml b/tests/at_onboarding_cli_functional_tests/pubspec.yaml index ae3b33de..8c3f4246 100644 --- a/tests/at_onboarding_cli_functional_tests/pubspec.yaml +++ b/tests/at_onboarding_cli_functional_tests/pubspec.yaml @@ -16,11 +16,6 @@ dependencies: at_utils: ^3.0.15 at_lookup: ^3.0.40 -# dependency_overrides: -# at_auth: -# path: ../../packages/at_auth -# at_commons: ^4.0.0 - dev_dependencies: lints: ^1.0.0 test: ^1.17.2