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

Add BPN to UsagePolicyException tombstone from CatalogOffer #404

Closed
5 tasks
mkanal opened this issue Feb 1, 2024 · 6 comments
Closed
5 tasks

Add BPN to UsagePolicyException tombstone from CatalogOffer #404

mkanal opened this issue Feb 1, 2024 · 6 comments
Assignees
Labels
api api specific issues

Comments

@mkanal
Copy link
Contributor

mkanal commented Feb 1, 2024

As business app
I want BPNL for a UsagePolicyException tombstone
so that am able to assign a tombstone with UsagePolicyException and policy to a BPNL

Hints / Details

  • org.eclipse.tractusx.irs.edc.client.EDCCatalogFacade#mapToCatalogItems
  • catalog.getProperties().containsKey(JsonLdConfiguration.NAMESPACE_EDC_PARTICIPANT_ID

Outcome / Acceptance Criteria

Outcome

  • ...

Acceptance Criteria

  • In case UsagePolicyException is thrown, BPN is written to UsagePolicyException tombstone if available
  • businessPartnerNumber is provided inside an UsagePolicyException tombstone if CatalogOffer provides edc:participantId
  • businessPartnerNumber is null if edc:participantId is not provided CatalogOffer
"tombstones": [
  {
    "catenaXId": "urn:uuid:6ce41c0b-c84a-46b0-b4c4-78fce958663d",
    "endpointURL": null,
    "businessPartnerNumber": "<businessPartnerNumber>",
    "policy": {},
    "processingError": {
       "processStep": "UsagePolicyValidation", 
       "errorDetail": "Consumption of asset (itemId) is not permitted as the required catalog offer policies do not comply with defined IRS policies.",
       "lastAttempt": "2024-01-17T09:02:36.648055745Z",
       "retryCounter": 3
    }
  }
],

Out of Scope

  • ...
@mkanal mkanal added this to IRS Feb 1, 2024
@github-project-automation github-project-automation bot moved this to inbox in IRS Feb 1, 2024
@mkanal mkanal changed the title Add BPN from CatalogOffer if Policy Add BPN to tombstone from CatalogOffer Feb 1, 2024
@mkanal mkanal changed the title Add BPN to tombstone from CatalogOffer Add BPN to UsagePolicyException tombstone from CatalogOffer Feb 1, 2024
@jzbmw
Copy link
Contributor

jzbmw commented Feb 5, 2024

Image

@ds-jhartmann
Copy link
Contributor

ds-jhartmann commented Feb 5, 2024

Since we handle the UsagePolicyException at SubmodelDelegate and RelationshipDelegate level, we already have the BPNL of the company, where we want to request data from, available.
By using this BPNL, we do not have the need to extract it from the Catalog and can add it to the tombstone directly.

@ds-jhartmann
Copy link
Contributor

ds-jhartmann commented Feb 5, 2024

An additional point to consider is adding the BPNL to the tombstone message instead of adding another field. If we keep adding field which are only filled in specific cases, the tombstone object will become messy soon. Son instead of

"tombstones": [
  {
    "catenaXId": "urn:uuid:6ce41c0b-c84a-46b0-b4c4-78fce958663d",
    "endpointURL": null,
    "businessPartnerNumber": "<businessPartnerNumber>",
    "policy": {},
    "processingError": {
       "processStep": "UsagePolicyValidation", 
       "errorDetail": "Consumption of asset (itemId) is not permitted as the required catalog offer policies do not comply with defined IRS policies.",
       "lastAttempt": "2024-01-17T09:02:36.648055745Z",
       "retryCounter": 3
    }
  }
],

it would be

  {
    "catenaXId": "urn:uuid:6ce41c0b-c84a-46b0-b4c4-78fce958663d",
    "endpointURL": null,
    "policy": {},
    "processingError": {
       "processStep": "UsagePolicyValidation", 
       "errorDetail": "Consumption of asset (itemId) is not permitted for company <businessPartnerNumber>, as the required catalog offer policies do not comply with defined IRS policies.",
       "lastAttempt": "2024-01-17T09:02:36.648055745Z",
       "retryCounter": 3
    }
  }

@jzbmw jzbmw added the api api specific issues label Feb 14, 2024
@jzbmw jzbmw removed the status in IRS Feb 14, 2024
@jzbmw jzbmw moved this to backlog in IRS Feb 14, 2024
@mkanal mkanal moved this from backlog to next in IRS Feb 20, 2024
@ds-ext-kmassalski ds-ext-kmassalski moved this from next to wip in IRS Feb 23, 2024
@ds-ext-kmassalski ds-ext-kmassalski moved this from wip to review in IRS Feb 27, 2024
@ds-alexander-bulgakov
Copy link
Contributor

Hi @ds-ext-kmassalski,
as discussed in the daily please provide a testdatafile with an asset which can be used for automated tests. Thank you!

@ds-alexander-bulgakov
Copy link
Contributor

Testdata was provided and tavern test created in branch #404-create-tavern-tests. Once the feature is successfully deployt on DEV the test can be run.

@ds-ext-kmassalski
Copy link
Contributor

PR's with impl:
catenax-ng#790

Test data:
catenax-ng#796

done - In case UsagePolicyException is thrown, BPN is written to UsagePolicyException tombstone if available
done - businessPartnerNumber is provided inside an UsagePolicyException tombstone if CatalogOffer provides edc:participantId
done - businessPartnerNumber is null if edc:participantId is not provided CatalogOffer

ds-jhartmann pushed a commit that referenced this issue Mar 4, 2024
…pted-policy

feat(impl):[#404] not accepted policy testdata
ds-jhartmann added a commit that referenced this issue Mar 4, 2024
#404 Testdata for not accepted policy
@jzbmw jzbmw moved this from review to done in IRS Mar 4, 2024
@mkanal mkanal closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api api specific issues
Projects
Status: done
Development

No branches or pull requests

5 participants