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

Policy API response parameter rightOperand is wrong #970

Closed
ds-mwesener opened this issue May 14, 2024 · 11 comments · Fixed by #1206
Closed

Policy API response parameter rightOperand is wrong #970

ds-mwesener opened this issue May 14, 2024 · 11 comments · Fixed by #1206
Assignees
Labels
bug Something isn't working

Comments

@ds-mwesener
Copy link
Contributor

ds-mwesener commented May 14, 2024

Blocked by #1173

Description

IRS Policy Store /irs/policies returns wrong parameter for object type: Constraint.rightOperand.

Current behaviour

{ "validUntil": "2024-09-30T23:59:59.99Z", "payload": { "@context": { "odrl": "http://www.w3.org/ns/odrl/2/" }, "@id": "65797805-e6f4-463d-824e-f7986f5f039f", "policy": { "policyId": "65797805-e6f4-463d-824e-f7986f5f039f", "createdOn": "2024-05-14T15:07:34.653578619Z", "validUntil": "2024-09-30T23:59:59.99Z", "permissions": [ { "action": "USE", "constraint": { "and": [ { "leftOperand": "cx-policy:FrameworkAgreement", "operator": { "@id": "eq" }, "odrl:rightOperand": "traceability:1.0" }, { "leftOperand": "cx-policy:UsagePurpose", "operator": { "@id": "eq" }, "odrl:rightOperand": "cx.core.industrycore:1" } ], "or": null } } ] } }

Expected behavior

rightOperand should not have "odrl:" as prefix.

Steps to reproduce the Bug

Call the irs policy store api.

@github-project-automation github-project-automation bot moved this to inbox in Trace-X May 14, 2024
@ds-mwesener ds-mwesener changed the title Policy API respone parameter rightOperand is wrong Policy API response parameter rightOperand is wrong May 14, 2024
@mkanal mkanal added the bug Something isn't working label Jun 17, 2024
@mkanal mkanal removed this from Trace-X Jun 21, 2024
@mkanal mkanal added this to IRS Jun 21, 2024
@github-project-automation github-project-automation bot moved this to inbox in IRS Jun 21, 2024
@mkanal mkanal added this to Trace-X Jun 21, 2024
@github-project-automation github-project-automation bot moved this to inbox in Trace-X Jun 21, 2024
@mkanal mkanal moved this from inbox to backlog in IRS Jun 21, 2024
@dsmf
Copy link

dsmf commented Jun 21, 2024

Outcome:

  • No matter what is stored the rightOperand is returned without odrl prefix
  • Unit test: ConstraintTest.canReadPermissionsWithDifferentRightOperandAttributeNames

How to test:

  • Create a policy with odrl prefix present
  • Execute GET policies request
  • There should be no odrl prefix anymore

  • tested locally
  • tested on DEV

PR: eclipse-tractusx/item-relationship-service#725

@mkanal mkanal moved this from backlog to next in IRS Jun 21, 2024
@dsmf dsmf moved this from next to wip in IRS Jun 21, 2024
@ds-jhartmann ds-jhartmann moved this from wip to test in IRS Jun 24, 2024
@ds-kgassner
Copy link

Successfully tested - approved from my side

@ds-jhartmann ds-jhartmann moved this from test to review in IRS Jun 25, 2024
@mkanal
Copy link
Contributor

mkanal commented Jun 26, 2024

PO acceptance in behalf of @jzbmw
LGFM

@mkanal mkanal closed this as completed Jun 26, 2024
@mkanal mkanal moved this from review to done in IRS Jun 26, 2024
@mkanal mkanal moved this from inbox to next in Trace-X Jun 26, 2024
@ds-mwesener ds-mwesener moved this from next to test in Trace-X Jul 2, 2024
@ds-mwesener
Copy link
Contributor Author

ds-mwesener commented Jul 2, 2024

HI, since this change is not included in the current release, we need to have the latest release from irs included in trace-x. Currently there is no release existing. This has been adressed to @ds-jhartmann which will provide the latest one. For the updates after IRS created the release I will derive a story.

@ds-lcapellino
Copy link
Contributor

The same problem causes a missing rightOperand when trying to create a policy via TraceX Frontend.

Image

@ds-mwesener ds-mwesener moved this from test to wip in Trace-X Jul 5, 2024
@ds-mwesener ds-mwesener added the BLOCKED Issues are blocked by other issues label Jul 5, 2024
@ds-mwesener ds-mwesener moved this from wip to test in Trace-X Jul 8, 2024
@ds-mwesener
Copy link
Contributor Author

Hi @ds-crehm please validate. Latest IRS has been installed, therefore this is ready to test.

@ds-mwesener ds-mwesener removed the BLOCKED Issues are blocked by other issues label Jul 8, 2024
@ds-crehm
Copy link
Contributor

ds-crehm commented Jul 8, 2024

Tested on E2E:
Right operands are now properly created in the backend and shown in the detail view / edit view:
grafik

However, in the table view, the right operand is still not shown:
grafik
Please fix that.

@ds-crehm ds-crehm reopened this Jul 8, 2024
@ds-crehm ds-crehm moved this from test to wip in Trace-X Jul 8, 2024
@ds-crehm ds-crehm assigned ds-mmaul and unassigned dsmf and ds-crehm Jul 8, 2024
@ds-jhartmann
Copy link
Contributor

Hi @ds-crehm @ds-mwesener is this an IRS Policy Store API Issue or can this be fixed in the trace-foss frontend?

@mkanal
Copy link
Contributor

mkanal commented Jul 9, 2024

image

@mkanal mkanal moved this from done to wip in IRS Jul 9, 2024
@mkanal mkanal moved this from wip to done in IRS Jul 9, 2024
@mkanal mkanal closed this as completed Jul 9, 2024
@ds-mwesener
Copy link
Contributor Author

Hi @ds-jhartmann / @mkanal topic will be adressed by trace-x. @ds-mmaul will fix this issue.

ds-mwesener added a commit that referenced this issue Jul 10, 2024
…se-rightOperand-fix

bug(policy): 970 fix hidden right operand
@ds-mmaul ds-mmaul moved this from wip to test in Trace-X Jul 10, 2024
@ds-crehm
Copy link
Contributor

In the table view, the right operand is shown now as well.
grafik
Ready for review.

@ds-crehm ds-crehm reopened this Jul 10, 2024
@ds-crehm ds-crehm moved this from test to review in Trace-X Jul 10, 2024
@ds-crehm ds-crehm assigned mkanal and unassigned ds-mmaul and ds-crehm Jul 10, 2024
@mkanal mkanal moved this from review to done in Trace-X Jul 18, 2024
@mkanal mkanal closed this as completed Jul 18, 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
Status: done
Status: done
Development

Successfully merging a pull request may close this issue.

8 participants