diff --git a/packages/at_commons/CHANGELOG.md b/packages/at_commons/CHANGELOG.md index d37506a9..f468736a 100644 --- a/packages/at_commons/CHANGELOG.md +++ b/packages/at_commons/CHANGELOG.md @@ -1,5 +1,6 @@ ## 3.0.55 - feat: Introduce "AtThrottleLimitExceeded" exception which is thrown when enrollment request exceeds the limit +- feat: Introduce new error codes for apkam enrollments ## 3.0.54 - fix: Modify "totp" verb regex to include alpha-numeric characters - feat: Introduce "EnrollResponse" class which represents the enrollment response. diff --git a/packages/at_commons/lib/src/enroll/enrollment.dart b/packages/at_commons/lib/src/enroll/enrollment.dart index bfb68f57..902b7d93 100644 --- a/packages/at_commons/lib/src/enroll/enrollment.dart +++ b/packages/at_commons/lib/src/enroll/enrollment.dart @@ -10,7 +10,7 @@ class EnrollResponse { } } -enum EnrollStatus { pending, approved, denied, revoked } +enum EnrollStatus { pending, approved, denied, revoked, expired } EnrollStatus getEnrollStatusFromString(String value) { switch (value) { @@ -22,6 +22,8 @@ EnrollStatus getEnrollStatusFromString(String value) { return EnrollStatus.pending; case 'revoked': return EnrollStatus.revoked; + case 'expired': + return EnrollStatus.expired; default: throw ArgumentError('Unknown enroll status string: $value'); } diff --git a/packages/at_commons/lib/src/exception/error_message.dart b/packages/at_commons/lib/src/exception/error_message.dart index 0d7d61af..ae41ffd5 100644 --- a/packages/at_commons/lib/src/exception/error_message.dart +++ b/packages/at_commons/lib/src/exception/error_message.dart @@ -47,8 +47,9 @@ const Map error_description = { 'AT0022': 'Illegal arguments', 'AT0023': 'Timeout waiting for response', 'AT0024': 'Server is paused', - 'AT0025': 'ApkamAuthDenied', - 'AT0026': 'ApkamAuthFailed', - 'AT0027': 'ApkamAccessRevoked', - 'AT0028': 'Too Many Requests' + 'AT0025': 'Apkam Auth Denied', + 'AT0026': 'Apkam Auth Failed', + 'AT0027': 'Apkam Access Revoked', + 'AT0028': 'Apkam Enrollment Expired', + 'AT0029': 'Too Many Requests' };