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] Enable policy management in Trace-X #965

Closed
5 tasks done
ds-crehm opened this issue May 14, 2024 · 11 comments · Fixed by catenax-ng/tx-traceability-foss#1277, #1083 or #1084
Closed
5 tasks done

[POLICY] Enable policy management in Trace-X #965

ds-crehm opened this issue May 14, 2024 · 11 comments · Fixed by catenax-ng/tx-traceability-foss#1277, #1083 or #1084
Assignees
Labels
backend Backend related issues policy policy management access and usage spillover temporary label for spill over

Comments

@ds-crehm
Copy link
Contributor

ds-crehm commented May 14, 2024

As administrator of Trace-X,
I want create / update / view / delete policy definitions,
so that I can use Trace-X for policy management.

Hints / Details

Acceptance Criteria

  • CREATE policies API implemented (already implemented -> check implementation)
  • GET policies API implemented
  • UPDATE policies API implemented
  • DELETE policies API implemented
  • Policies are validated before sending notifications.

Out of Scope

  • ...
    `

Current policy layout

{
    "@context": {
        "@vocab": "https://w3id.org/edc/v0.0.1/ns/"
    },
    "@id": "<POLICY-ID>",
    "policy": {
        "@context": [
            "https://www.w3.org/ns/odrl.jsonld",
            {
                "cx-policy": "https://w3id.org/catenax/policy/"
            }
        ],
        "@type": "Policy",
        "profile": "cx-policy:profile2405",
        "permission": [
            {
                "action": "use",
                "constraint": {
                    "and": [
                        {
                            "leftOperand": "cx-policy:FrameworkAgreement",
                            "operator": "eq",
                            "rightOperand": "traceability:1.0"
                        },
                        {
                            "leftOperand": "cx-policy:UsagePurpose",
                            "operator": "eq",
                            "rightOperand": "cx.core.industrycore:1"
                        }
                    ]
                }
            }
        ]
    }
}
@ds-crehm ds-crehm added backend Backend related issues policy policy management access and usage labels May 14, 2024
@mkanal mkanal changed the title [Backend] Enable policy management in Trace-X [POLICY] Enable policy management in Trace-X May 14, 2024
@ds-crehm
Copy link
Contributor Author

Left operand, operator, right operator, type:

  • Are those free-text fields or do we need to get those from somewhere? (where?)

@RazvanZmau RazvanZmau added the spillover temporary label for spill over label May 28, 2024
@ds-mwesener
Copy link
Contributor

We decided together with @mkanal to load the content of the dropdown fields from static file in frontend.

@ds-crehm
Copy link
Contributor Author

Tested on E2E:
Please check the error messages and fix them:
grafik

  • when trying to create a policy that already exists (this is a 400 bad request instead)
  • when trying to delete a policy that doesn't exist
  • when trying to change a policy that doesn't exist

@ds-crehm ds-crehm reopened this Jun 14, 2024
@ds-crehm
Copy link
Contributor Author

Error messages will be fixed in IRS. Since this API uses the IRS responses, the error messages will be fixed here as well.
Ready for review.

@ds-crehm ds-crehm assigned mkanal and unassigned ds-mwesener and ds-crehm Jun 19, 2024
@mkanal
Copy link
Contributor

mkanal commented Jun 19, 2024

@ds-crehm could you please link/provide bug ticket where error message will be fixed. Thank you

@ds-mwesener
Copy link
Contributor

ds-mwesener commented Jun 20, 2024

Hi @ds-crehm I was able to fix the error responses.

Bad Request example:

Image

Not found example:

Image

Ready for your test, it is already installed on e2e.

@ds-crehm
Copy link
Contributor Author

Tested on E2E-A: Looks good to me. Error messages are understandable and readable now, same as in your screenshots.
Ready for review.

@ds-crehm ds-crehm reopened this Jun 21, 2024
@ds-crehm ds-crehm assigned mkanal and unassigned ds-mwesener and ds-crehm Jun 21, 2024
@mkanal
Copy link
Contributor

mkanal commented Jun 21, 2024

Hi @ds-crehm I was able to fix the error responses.

Bad Request example:

Image

Not found example:

Image

Ready for your test, it is already installed on e2e.

There is a typo for 404 message instead "Policy with id 'abc' doesn't exists." this is correct "Policy with policyId 'abc' doesn't exist.

@mkanal mkanal assigned ds-mwesener and unassigned mkanal Jun 21, 2024
@mkanal
Copy link
Contributor

mkanal commented Jun 21, 2024

@ds-mwesener please fix typo in 404 result message. Rest is good and ready for acceptanace.

@ds-mwesener
Copy link
Contributor

Issue has been fixed. Has now same error message as IRS:

Image

@mkanal
Copy link
Contributor

mkanal commented Jun 26, 2024

PO acceptance in behalf of @jzbmw.
Validation of policies is done in policy store and later on in frontend using policy hub.

@mkanal mkanal closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues policy policy management access and usage spillover temporary label for spill over
Projects
Status: done
4 participants