eclipse-tractusx / portal-frontend

Portal Frontend
Apache License 2.0
4 stars 25 forks source link

Implement Credential Revocation Feature for Issuer Admin Board #768

Closed jjeroch closed 1 month ago

jjeroch commented 1 month ago

Description

This ticket involves the addition of a credential revocation feature within the issuer admin board. The feature will enable issuers with the "revoke_credentials_issuer" permission to revoke "Active" credentials.


Acceptance Criteria

  1. Revocation Capability:

    • Implement a revocation feature that allows issuers with the "revoke_credentials_issuer" permission to revoke credentials marked as "Active."
  2. UI Integration:

    • Add a revoke option/button on the issuer admin board next to each "Active" credential. *Icon** MaterialUI: SettingsBackupRestore image
    • The revoke option should be accessible only to users with the "revoke_credentials_issuer" permission.
  3. Confirmation Overlay:

    • Upon clicking the revoke icon, present an overlay to the user asking for confirmation to proceed with revocation.
    • The overlay should provide "Cancel" and "Confirm" options.
    image
  4. API Integration:

    • On confirmation, trigger an API call to https://ssi-credential-issuer-rc.dev.demo.catena-x.net/api/revocation/issuer/credentials/{credentialId} with the appropriate credential ID.
  5. Loading State and User Feedback:

    • Show a loading indicator while the revocation request is being processed.
    • Once the API responds, provide feedback to the issuer on the success or failure of the revocation.
  6. Success/Error Handling:

    • Upon receiving a success response from the API, inform the user that the revocation was successful.
    • If an error response is received, display an error message to the user.
    • Unsuccess Message
      • DE: "Der Widerruf der Berechtigung war erfolglos. Bitte wenden Sie sich an den Administrator oder versuchen Sie es später erneut."
      • EN: "The revocation of the credential was unsuccessful. An error occurred. Please try again. If the problem persists, contact the site administrator"
    • Success Message
      • DE: "Der Widerruf Ihrer Zugangsdaten wurde erfolgreich verarbeitet. Mit der erfolgreichen Sperrung verliert der Ausweis seine Gültigkeit. Beachten Sie, dass die Aktion nach dem Widerrufen eines Berechtigungsnachweises nicht mehr rückgängig gemacht werden kann und der Berechtigungsnachweis nicht mehr als gültig anerkannt wird."
      • EN: "The customer credential revocation has been successfully processed. With the successful revocation the credential is no longer valid. Note once a credential is revoked, the action cannot be undone, and the credential will no longer be recognized as valid."
  7. Permissions Check:

    • Ensure that the revocation feature respects the permission system and is only available to users with the "revoke_credentials_issuer" permission.

Design

image




API Endpoint

Endpoint: POST /api/revocation/issuer/credentials/{credentialId} (currently only available on rc.dev) Post inside the path under {credentialId} the ID of the to be revoked credential. The ID can get found inside the GET endpoint