Skip to content

Commit

Permalink
Merge pull request #408 from atsign-foundation/apkam_new_error_code
Browse files Browse the repository at this point in the history
feat: new error code AT0028 for expired enrollments
  • Loading branch information
srieteja authored Sep 8, 2023
2 parents 430929b + 9626792 commit 4ec4089
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/at_commons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 3 additions & 1 deletion packages/at_commons/lib/src/enroll/enrollment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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');
}
Expand Down
9 changes: 5 additions & 4 deletions packages/at_commons/lib/src/exception/error_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'
};

0 comments on commit 4ec4089

Please sign in to comment.