Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new error code AT0028 for expired enrollments #408

Merged
merged 6 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
};