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/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 7fdbfaaa..d6b90632 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..77a37594 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 @@ -8,10 +8,10 @@ environment: sdk: '>=3.0.0 <4.0.0' dependencies: - at_commons: ^3.0.58 - at_lookup: ^3.0.43 - at_chops: ^1.0.6 - at_utils: ^3.0.15 + at_commons: ^4.0.0 + 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 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', () { diff --git a/tests/at_onboarding_cli_functional_tests/pubspec.yaml b/tests/at_onboarding_cli_functional_tests/pubspec.yaml index 67785dc4..8c3f4246 100644 --- a/tests/at_onboarding_cli_functional_tests/pubspec.yaml +++ b/tests/at_onboarding_cli_functional_tests/pubspec.yaml @@ -16,10 +16,6 @@ dependencies: at_utils: ^3.0.15 at_lookup: ^3.0.40 -dependency_overrides: - at_auth: - path: ../../packages/at_auth - dev_dependencies: lints: ^1.0.0 test: ^1.17.2