eclipse-tractusx / portal-frontend

Portal Frontend
Apache License 2.0
5 stars 32 forks source link

Wallet UI - Change Backend API for Wallet GET Endpoint #621

Closed jjeroch closed 1 week ago

jjeroch commented 7 months ago

Scope:

Change of the backend API used to create the Wallet UI content from the existing endpoint of the MIW to the new GET endpoint of the issuer component GET /api/issuer/owned-credentials. This change is required to retrieve all company-owned credentials along with their status. Additionally, the response body schema needs to be updated to reflect the changes.

Swagger: https://ssi-credential-issuer.int.demo.catena-x.net/api/issuer/swagger/index.html

Tasks:

  1. Update API Endpoint:

  2. Update Response Body Schema:

    • Modify the response body schema to accommodate the changes in the retrieved company-owned credentials.
    • Update the schema to include the necessary fields for each credential, such as ID, name, status, and any other relevant information. (details see response body and comments below)
  3. Handle Error Cases:

    • Implement appropriate error handling for scenarios where the company-owned credentials cannot be retrieved.
    • Return the appropriate error response codes and messages in case of any errors or exceptions. e.g. in case of an complete empty response or API error:

Image


New API response body

[
  {
    "credentialType": "DISMANTLER_CERTIFICATE", //Used for the Credential Name - but please without "_" instead take a space
    "status": "ACTIVE", //Used to display the status
    "expiryDate": null, //Used to display the expiry
    "authority": "BPNL00000003CRHK" //Used to display the authority. 
  },
  {
    "credentialType": "BUSINESS_PARTNER_NUMBER",
    "status": "ACTIVE",
    "expiryDate": null,
    "authority": "BPNL00000003CRHK"
  },
  {
    "credentialType": "BUSINESS_PARTNER_NUMBER",
    "status": "REVOKED",
    "expiryDate": null,
    "authority": "BPNL00000003CRHK"
  },
  {
    "credentialType": "DISMANTLER_CERTIFICATE",
    "status": "REVOKED",
    "expiryDate": null,
    "authority": "BPNL00000003CRHK"
  }
]




manojava-gk commented 5 months ago

@jjeroch for the mentioned new end point getting 403 error in INT and 404 in DEV. Attached image for your ref

Screenshot 2024-05-08 at 4 43 29 PM Screenshot 2024-05-08 at 4 42 59 PM
manojava-gk commented 5 months ago

Is 403 access related issue? I'm using CX Operator user for the testing purpose

manojava-gk commented 5 months ago

@jjeroch FYI - Phil helped me to set the access needed for this page in INT environment

manojava-gk commented 5 months ago

@jjeroch in schema provided in swagger does not has creadentialType: 'MEMBERSHIP'

TRACEABILITY_FRAMEWORK, PCF_FRAMEWORK, BEHAVIOR_TWIN_FRAMEWORK, DISMANTLER_CERTIFICATE, CIRCULAR_ECONOMY, BUSINESS_PARTNER_NUMBER, DEMAND_AND_CAPACITY_MANAGEMENT, DEMAND_AND_CAPACITY_MANAGEMENT_PURIS, BUSINESS_PARTNER_DATA_MANAGEMENT

manojava-gk commented 5 months ago
Screenshot 2024-05-09 at 2 37 32 PM

@jjeroch FYR