diff --git a/packages/at_commons/CHANGELOG.md b/packages/at_commons/CHANGELOG.md index f468736a..2b70e3cb 100644 --- a/packages/at_commons/CHANGELOG.md +++ b/packages/at_commons/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.0.56 +- feat: Introduce "AtInvalidEnrollmentException" which is thrown when an enrollment is expired or invalid +- feat: Introduce error code 'AT0030' for Invalid Enrollment Status ## 3.0.55 - feat: Introduce "AtThrottleLimitExceeded" exception which is thrown when enrollment request exceeds the limit - feat: Introduce new error codes for apkam enrollments diff --git a/packages/at_commons/lib/src/exception/at_exceptions.dart b/packages/at_commons/lib/src/exception/at_exceptions.dart index f3fb2b22..3ab37819 100644 --- a/packages/at_commons/lib/src/exception/at_exceptions.dart +++ b/packages/at_commons/lib/src/exception/at_exceptions.dart @@ -213,6 +213,11 @@ class AtEnrollmentException extends AtException { AtEnrollmentException(message) : super(message); } +/// Exception thrown when an Enrollment_id is expired or invalid +class AtInvalidEnrollmentException extends AtException { + AtInvalidEnrollmentException(message) : super(message); +} + /// Exception thrown when the enrollment requests exceed the limit /// in the given time window class AtThrottleLimitExceeded extends AtException { diff --git a/packages/at_commons/lib/src/exception/error_message.dart b/packages/at_commons/lib/src/exception/error_message.dart index ae41ffd5..1679e577 100644 --- a/packages/at_commons/lib/src/exception/error_message.dart +++ b/packages/at_commons/lib/src/exception/error_message.dart @@ -21,7 +21,8 @@ const Map error_codes = { 'IllegalArgumentException': 'AT0022', 'AtTimeoutException': 'AT0023', 'ServerIsPausedException': 'AT0024', - 'AtThrottleLimitException': 'AT0028' + 'AtThrottleLimitException': 'AT0028', + 'AtInvalidEnrollmentException': 'AT0029', }; // ignore: constant_identifier_names @@ -50,6 +51,7 @@ const Map error_description = { 'AT0025': 'Apkam Auth Denied', 'AT0026': 'Apkam Auth Failed', 'AT0027': 'Apkam Access Revoked', - 'AT0028': 'Apkam Enrollment Expired', - 'AT0029': 'Too Many Requests' + 'AT0028': 'Too Many Requests', + 'AT0029': 'Apkam Enrollment Expired', + 'AT0030': 'Invalid Enrollment Status' }; diff --git a/packages/at_commons/lib/src/verb/operation_enum.dart b/packages/at_commons/lib/src/verb/operation_enum.dart index 0b7c4b7f..e993979c 100644 --- a/packages/at_commons/lib/src/verb/operation_enum.dart +++ b/packages/at_commons/lib/src/verb/operation_enum.dart @@ -17,7 +17,7 @@ enum MessageTypeEnum { key, text } String getMessageType(MessageTypeEnum? messageTypeEnum) => '$messageTypeEnum'.split('.').last; -enum EnrollOperationEnum { request, approve, deny, revoke, list } +enum EnrollOperationEnum { request, approve, deny, revoke, list, update } String getEnrollOperation(EnrollOperationEnum? enrollOperationEnum) => '$enrollOperationEnum'.split('.').last; diff --git a/packages/at_commons/lib/src/verb/syntax.dart b/packages/at_commons/lib/src/verb/syntax.dart index b2781853..780816c8 100644 --- a/packages/at_commons/lib/src/verb/syntax.dart +++ b/packages/at_commons/lib/src/verb/syntax.dart @@ -128,7 +128,7 @@ class VerbSyntax { static const notifyRemove = r'notify:remove:(?[\w\d\-\_]+)'; static const enroll = // The non-capturing group (?::)? matches ":" if the operation is request|approve|deny|revoke - r'^enroll:(?(?:list$|(request|approve|deny|revoke)))(?::)?(?.+)?$'; + r'^enroll:(?(?:list$|(request|approve|deny|revoke|update)))(?::)?(?.+)?$'; static const otp = r'^otp:(?get|validate)(:(?\w+))?$'; static const keys = r'^keys:((?put|get|delete):?)' r'(?:(?public|private|self):?)?' diff --git a/packages/at_commons/pubspec.yaml b/packages/at_commons/pubspec.yaml index 56c54f5b..8582feea 100644 --- a/packages/at_commons/pubspec.yaml +++ b/packages/at_commons/pubspec.yaml @@ -1,6 +1,6 @@ name: at_commons description: A library of Dart and Flutter utility classes that are used across other components of the atPlatform. -version: 3.0.55 +version: 3.0.56 repository: https://github.com/atsign-foundation/at_libraries homepage: https://atsign.dev