Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-6938

Go through EJBCA exceptions and map to HTTP status codes for REST API

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The goal of the task is to create a table mapping each exception in EJBCA to an HTTP response status code for use in the REST API.


      Result:

      202 Accepted
      WaitingForApprovalException

      204 No Content

      400 Bad Request
      ApprovalException
      ApprovalRequestExecutionException
      ApprovalRequestExpiredException
      CertificateRevokeException
      CertificateSerialNumberException
      EndEntityExistsException
      KeyStoreGeneralRaException
      RoleExistsException

      403 Forbidden
      AuthLoginException
      AuthStatusException
      AuthenticationFailedException
      AuthorizationDeniedException
      SelfApprovalException

      404 Not Found
      CADoesntExistsException
      CertificateProfileDoesNotExistException
      EndEntityProfileNotFoundException
      NoSuchEndEntityException
      NotFoundException
      RoleNotFoundException

      409 Conflict
      AlreadyRevokedException
      AdminAlreadyApprovedRequestException

      413 Payload Too Large
      StreamSizeLimitExceededException

      422 Unprocessable Entity
      WrongTokenTypeException
      CertificateProfileTypeNotAcceptedException
      CustomFieldException
      EndEntityProfileValidationRaException
      EndEntityProfileValidationException
      IllegalNameException
      IllegalValidityException
      InvalidAlgorithmException
      RevokeBackDateNotAllowedForProfileException
      UserDoesntFullfillEndEntityProfile

      429 Too Many Requests

      500 Internal Server Error (for these, the message can leak configuration and should probably be hidden)
      CertificateCreateException
      CertificateExtensionException
      HTTP 500 should be the default case for unknown exceptions

      501 Not Implemented

      503 Service Unavailable
      CAOfflineException
      CryptoTokenOfflineException
      CTLogException

      Base exception classes. Should always be catched
      CesecoreException
      EjbcaException
      Internal exceptions. Should always be catched, if they ever are thrown
      CertificateExtentionConfigurationException
      CertificateSignatureException
      CustomCertificateSerialNumberException
      EndEntityFieldValidatorException
      ExternalProcessException
      IllegalCryptoTokenException
      IllegalKeyException
      IllegalQueryException
      IncomatibleTokenTypeException
      PeerConnectionSendException
      PeerRaMasterApiApplicationException
      PKCS11LibraryFileNotFoundException (no longer used at all?)
      SignRequestException
      SignRequestSignatureException
      TrustedTimeProviderException
      ValidatorNotApplicableException
      TaskWithSigningException
      UnsupportedMethodException
      ValidationException
      Not relevant to REST API. Should always be catched, if they ever are thrown
      ApprovalProfileDoesNotExistException
      ApprovalProfileExistsException
      AuditLogResetException
      AuditLogValidatorException
      AuditLogExporterException
      BlacklistDoesntExistsException
      BlacklistExistsException
      CAExistsException
      CANameChangeRenewalException (only relevant if we allow CA renewal over REST API)
      CertificateImportException (only relevant if we allow certificate import or CA import)
      CertificateProfileExistsException
      CertificateRenewalException (used by the CMP and SCEP code only)
      CrlImportException
      CrlStoreException
      CryptoTokenAuthenticationFailedException (only relevant if we allow CA renewal over REST API)
      CryptoTokenIdInUseException
      CryptoTokenNameInUseException
      CouldNotRemoveKeyValidatorException
      DateNotValidException
      ErrorAdminCommandException
      EndEntityProfileExistsException
      FieldNotFoundException
      IllegalAdminCommandException
      IllegalExtendedCAServiceRequestException
      IllegalNonceException
      InternalKeyBindingNameInUseException
      InvalidConfigurationException
      KeyRenewalFailedException (currently used for ocsp key renewal only)
      KeyValidatorDoesntExistsException
      KeyValidatorExistsException
      MalformedRequestException (used by OCSP responder mainly, and internally by LimitedLengthASN1Reader)
      MultipleMatchException
      NoSuchAliasException
      NoSuchSlotException
      NotSupportedException (thrown when trying to renewal an externally signed CA)
      PrivateKeyNotExtractableException
      ProfileDoesNotExistException
      PublisherConnectionException
      PublisherException
      ServiceExistsException
      ServiceExecutionFailedException
      SignedByExternalCANotSupportedException
      UnknownProfileTypeException
      UserDataSourceConnectionException
      UserDataSourceDoesntExistsException (no longer used at all?)
      UserDataSourceException

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                samuel Samuel Lidén Borell
                Reporter:
                samuel Samuel Lidén Borell
                Verified by:
                Henrik Sunmark
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Time Spent - 5 hours Remaining Estimate - 3 hours
                  3h
                  Logged:
                  Time Spent - 5 hours Remaining Estimate - 3 hours
                  5h