eclipse-tractusx / portal-backend

Portal Backend
Apache License 2.0
7 stars 15 forks source link

Technical User Creation in DIM Wallet via Portal Integration #593

Open jjeroch opened 3 months ago

jjeroch commented 3 months ago

Ticket under creation

Description: The current integration between our portal and the DIM Wallet requires enhancement to support the creation of technical users for holders. The existing service account creation service within the portal should be extended to include additional logic that triggers the creation of a technical user in the DIM Wallet when the "Wallet Identity Management" permission is granted.

Acceptance Criteria:

  1. When a technical user is created in Keycloak with the "Wallet Identity Management" permission, the system should also create a corresponding technical user in the DIM Wallet.
  2. The creation of the technical user in the DIM Wallet should be handled asynchronously to ensure the portal's performance is not adversely affected. (only if needed - synchron implementation would be preferred)
  3. The system should handle any errors during the DIM Wallet technical user creation process gracefully and log them appropriately for troubleshooting.
  4. The user interface on the portal should reflect the status of the DIM Wallet technical user creation process (e.g., pending, successful, failed). => @Phil91 lets check this requirement once
  5. Make sure that the DIM Tech User has only limited permissions assigned to enable the communication of the Connector
  6. Update any relevant documentation to reflect the new functionality and guide users on how to create a technical user with the "Wallet Identity Management" permission.
  7. Implement necessary unit tests and integration tests to cover the new functionality.
  8. Ensure that the existing functionality is not affected by these changes.

Technical Notes:

jjeroch commented 2 months ago

Additional change need. Adjust backend logic of the following two api calls GET /api/administration/serviceaccount/owncompany/serviceaccounts GET /api/administration/serviceaccount/owncompany/serviceaccounts/{serviceAccountId}

=> enhance backend business logic - if the user technicalID exists in the dim technical user table, fetch the secret and client ID from there

Client_ID as well as secret to be fetched from the dim technical user table instead of using values from keycloak

jjeroch commented 2 months ago

Initial implementation done, but refactoring planned. Suggestion to do this as part of this ticket since the solution is not working like we expected