| | | 1 | | using ArturRios.Util.Http; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Heimdall.Shared.Messages; |
| | | 4 | | |
| | | 5 | | /// <summary>Status codes for <c>ApplicationCredentialController</c>'s messages (UC-53…UC-55).</summary> |
| | | 6 | | public static class ApplicationCredentialMessageMap |
| | | 7 | | { |
| | 2 | 8 | | public static readonly IReadOnlyDictionary<string, int> StatusCodes = |
| | 2 | 9 | | DataAccessMessageMap.CombinedWith(new Dictionary<string, int> |
| | 2 | 10 | | { |
| | 2 | 11 | | // UC-53 main flow — credential issued. |
| | 2 | 12 | | [ApplicationCredentialMessages.CredentialIssued] = HttpStatusCodes.Created, |
| | 2 | 13 | | // AF-53a, AF-54a, AF-55a — no live application in the addressed, live scope. |
| | 2 | 14 | | [ApplicationMessages.ApplicationNotFound] = HttpStatusCodes.NotFound, |
| | 2 | 15 | | // AF-53b, AF-54b, AF-55b — the actor may not manage the application. |
| | 2 | 16 | | [ApplicationCredentialMessages.NotAuthorizedToManageCredentials] = HttpStatusCodes.Forbidden, |
| | 2 | 17 | | // AF-53c — the expiry is not in the future. |
| | 2 | 18 | | [ApplicationCredentialMessages.ExpiryNotInFuture] = HttpStatusCodes.BadRequest, |
| | 2 | 19 | | // AF-53d — two live credentials already. |
| | 2 | 20 | | [ApplicationCredentialMessages.CredentialLimitReached] = HttpStatusCodes.Conflict, |
| | 2 | 21 | | // UC-54 main flow and its empty case — credentials listed. |
| | 2 | 22 | | [ApplicationCredentialMessages.CredentialsRetrieved] = HttpStatusCodes.Ok, |
| | 2 | 23 | | // UC-55 main flow — credential revoked. |
| | 2 | 24 | | [ApplicationCredentialMessages.CredentialRevoked] = HttpStatusCodes.Ok, |
| | 2 | 25 | | // AF-55c — no such credential on this application. |
| | 2 | 26 | | [ApplicationCredentialMessages.CredentialNotFound] = HttpStatusCodes.NotFound, |
| | 2 | 27 | | // AF-55d — already revoked. |
| | 2 | 28 | | [ApplicationCredentialMessages.CredentialAlreadyRevoked] = HttpStatusCodes.Conflict |
| | 2 | 29 | | }); |
| | | 30 | | } |