Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Subscription Provider Endpoint to Include EDC Configuration Details #841

Closed
8 tasks
jjeroch opened this issue Jul 17, 2024 · 3 comments
Closed
8 tasks
Assignees
Labels
bug Something isn't working

Comments

@jjeroch
Copy link
Contributor

jjeroch commented Jul 17, 2024

Description:
Our current system, which integrates Self-Sovereign Identity (SSI) and Enterprise Data Centers (EDCs), lacks a crucial feature that allows app/service providers who manage an EDC on behalf of a customer, to verify that the EDC is accurately configured to the customer's wallet rather than the service/app provider's wallet. To address this, we need to enhance the endpoint GET /api/apps/{appId}/subscription/{subscriptionId}/provider to return additional configuration details.

Acceptance Criteria:

  1. The endpoint response must be extended to include a new section named externalService.
  2. The externalService section should contain the following fields with their respective data types:
    • trusted_issuer (string)
    • participant_id (string)
    • iatp_id (string)
    • did_resolver (string)
    • decentralIdentityManagementAuthUrl (string)
    • decentralIdentityManagementServiceUrl (string)

*"trusted_issuer" iatp address of the issuer (e.g. did:web:dim-static-prod.dis-cloud-prod.cfapps.eu10-004.hana.ondemand.com:dim-hosted:2f45795c-d6cc-4038-96c9-63cedc0cd266:holder-iatp)
*"participant_id" Subscription customer BPNL
*"iatp_id" iatp address of the holder (e.g. did:web:dim-static-prod.dis-cloud-prod.cfapps.eu10-004.hana.ondemand.com:dim-hosted:2f45795c-d6cc-4038-96c9-63cedc0cd266:holder-iatp)
*"did_resolver" URL of the didResolver available inside the env. variables (e.g. https://bpn-did-resolution-service.int.demo.catena-x.net/api/directory)
*"DecentralIdentityManagementAuthURL" is configured inside the environment variables and displays the DIM e.g.https://dis-integration-service-prod.eu10.dim.cloud.sap/api/v2.0.0/iatp/catena-x-portal
*"DecentralIdentityManagementServiceURL" should be fetched from the portal backend which displays the customer wallet instance url - e.g. https://bpnl0000000001j2-j2.authentication.eu10.hana.ondemand.com/

  1. The data for these fields must be retrieved from the subscription customer's configuration.
  2. Ensure that the endpoint response schema is updated accordingly and that the response correctly reflects these changes when the endpoint is called.
  3. The implementation must ensure backward compatibility, not affecting existing functionalities or endpoint responses without the new section.
  4. Appropriate unit and integration tests must be written to cover the new functionality.
  5. Update the endpoint documentation to include the new externalService section with an explanation of each field.

Tasks:

  • Analyze the current implementation of the subscription provider endpoint.
  • Design the changes needed in the endpoint to include the externalService section.
  • Implement the changes in the codebase.
  • Update the endpoint tests to account for the new changes.
  • Perform unit and integration testing.
  • Update the endpoint documentation with the new changes.
  • Conduct a thorough review to ensure backward compatibility.
  • Deploy to a staging environment for final testing before production release.

Proposed new response body details:

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "offerSubscriptionStatus": "PENDING",
  "name": "string",
  "provider": "string",
  "contact": [
    "string"
  ],
  "technicalUserData": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string",
      "permissions": [
        "string"
      ]
    }
  ],
  "connectorData": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string",
      "endpoint": "string"
    }
  ],
  "externalService": {
    "trusted_issuer": "string",
    "participant_id": "string" (BPNL of the customer),
    "iatp_id": "string",
    "did_resolver": "string",
    "decentralIdentityManagementAuthUrl": "string",
    "decentralIdentityManagementServiceUrl": "string"
  }
}

Test Case 1: Retrieve Subscription Provider with EDC Configuration Details

Objective: Ensure the endpoint returns the enhanced response including the externalService section.

Steps:

  1. Make a GET request to /api/apps/{appId}/subscription/{subscriptionId}/provider.
  2. Verify the response code is 200 OK.
  3. Validate the response structure matches the updated schema including the externalService section.
  4. Check that the externalService fields contain expected data types and values.

Expected Result: The response includes the externalService section with correct details fetched from the subscription customer's configuration.


Test Case 2: Validate Field Data Types in externalService

Objective: Confirm that all fields in the externalService section have the correct data types.

Steps:

  1. Make a GET request to /api/apps/{appId}/subscription/{subscriptionId}/provider.
  2. Verify that each field in the externalService section is of type string.

Expected Result: All fields in the externalService response are strings.


Test Case 3: Backward Compatibility

Objective: Ensure that the enhancement does not break existing functionality.

Steps:

  1. Make a GET request to /api/apps/{appId}/subscription/{subscriptionId}/provider using an API version that predates the enhancement.
  2. Verify the response code is 200 OK.
  3. Validate the response structure matches the original schema without the externalService section.

Expected Result: The response is as per the original schema and functionality remains unaffected for the old API version.


Test Case 4: Error Handling for Non-Existent Subscription

Objective: Verify that the endpoint handles requests for non-existent subscriptions correctly.

Steps:

  1. Make a GET request to /api/apps/{appId}/subscription/{nonExistentSubscriptionId}/provider.
  2. Verify the response code is 404 Not Found.
  3. Confirm the response message indicates that the subscription was not found.

Expected Result: The endpoint returns a 404 Not Found for non-existent subscriptions.


Test Case 5: Security and Authorization Check

Objective: Ensure that only authorized users can access the EDC configuration details.

Steps:

  1. Make a GET request to /api/apps/{appId}/subscription/{subscriptionId}/provider without proper authorization.
  2. Verify the response code is 401 Unauthorized or 403 Forbidden.

Expected Result: Unauthorized users cannot retrieve EDC configuration details from the endpoint.


Test Case 6: Documentation and Schema Validation

Objective: Confirm that the endpoint documentation has been updated and the schema is valid.

Steps:

  1. Review the updated endpoint documentation to ensure it includes the externalService section and its fields.
  2. Validate the API schema against the documentation to ensure accuracy and completeness.

Expected Result: The documentation accurately reflects the endpoint's updated schema and functionality.


Test Case 7: Field Presence Validation

Objective: Check that all new fields in the externalService section are always present in the response.

Steps:

  1. Make a GET request to /api/apps/{appId}/subscription/{subscriptionId}/provider.
  2. Verify that all fields within the externalService section are present, regardless of whether they are populated or null.

Expected Result: The response always contains the externalService section with all expected fields.

@jjeroch jjeroch added the enhancement New feature or request label Jul 17, 2024
@jjeroch jjeroch added this to the Release 24.12 milestone Jul 17, 2024
@jjeroch jjeroch added bug Something isn't working and removed enhancement New feature or request labels Jul 22, 2024
@evegufy
Copy link
Contributor

evegufy commented Jul 22, 2024

relates to eclipse-tractusx/sig-release#731

@jjeroch
Copy link
Contributor Author

jjeroch commented Jul 24, 2024

@Phil91 can you please check once how the iatp and issuer id is getting created as part of GET /api/administration/companydata/decentralidentity/urls? ideally we use the same for this endpoint.

Phil91 added a commit that referenced this issue Jul 25, 2024
#867)

Refs: #841
Co-authored-by: Norbert Truchsess <norbert.truchsess@t-online.de>
Reviewed-by: Norbert Truchsess <norbert.truchsess@t-online.de>
@evegufy
Copy link
Contributor

evegufy commented Jul 25, 2024

@sachinargade123 @ciprianherciu it's ready for testing

Phil91 added a commit that referenced this issue Jul 26, 2024
#867)

Refs: #841
Co-authored-by: Norbert Truchsess <norbert.truchsess@t-online.de>
Reviewed-by: Norbert Truchsess <norbert.truchsess@t-online.de>
ntruchsess added a commit that referenced this issue Jul 29, 2024
#867)

Refs: #841
Co-authored-by: Norbert Truchsess <norbert.truchsess@t-online.de>
Reviewed-by: Norbert Truchsess <norbert.truchsess@t-online.de>
ntruchsess added a commit that referenced this issue Jul 29, 2024
* fix(apps): remove leading '/' from the activate subscription endpoint (#861)
Refs: #856
* bug(offersubscription): suppress activation of external serviceaccounts in keycloak on subscription-activation (#864)
Refs: #856
* fix(dim): fix callback logic for dim requests (#863)
Refs: #862
chore(dependencies): bump efcore to 8.0.7 (#857)
* increase efcore version to latest 8.0.7 to resolve security-issue in transitive dependency in System.Text.Json
* fix(offersubscription): skip optional autosetupprovidercallback  if it is not configured (#865)
* add clientPrefix  to workers appsettings (#870)
* fix: enhance subscription/provider endpoint with external Service data (#867)
Refs: #841
* fix(sdDoc): set process step to skipped if ClearinghouseConnectDisabled is true (#874)
Refs: #792
* build(deps): bump MimeKit from 4.3.0 to 4.7.1 (#833)
eclipse-tractusx/portal#369
* build(deps): bump MimeKit from 4.3.0 to 4.7.1 in /tests/endtoend
Bumps MimeKit from 4.3.0 to 4.7.1.
---
updated-dependencies:
- dependency-name: MimeKit
  dependency-type: direct:production
...
* chore: upgrade mimekit in sendmail project
* chore: update dependencies file
---------
* upgrade implicit dependencies on System.Text.Json (#875)
* Serilog.Settings.Configuration to 8.0.2
* remove redundant dependencies on Microsoft.Extensions.Hosting
* bump framework version to 2.4.2 after merge of main
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Norbert Truchsess <norbert.truchsess@t-online.de>
Co-authored-by: Phil Schneider <info@philschneider.de>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Evelyn Gurschler <evelyn.gurschler@bmw.de>
Reviewed-By: Evelyn Gurschler <evelyn.gurschler@bmw.de>
Reviewed-By: Norbert Truchsess <norbert.truchsess@t-online.de>
Reviewed-By: Phil Schneider <info@philschneider.de>
@evegufy evegufy closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants