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 Hub - Policy Template Update #43

Open
jjeroch opened this issue Feb 20, 2024 · 1 comment
Open

Policy Hub - Policy Template Update #43

jjeroch opened this issue Feb 20, 2024 · 1 comment
Assignees

Comments

@jjeroch
Copy link
Contributor

jjeroch commented Feb 20, 2024

Summary

Update the policy hub used policy template for the endpoint

POST /api/policy-hub/policy-content
GET /api/policy-hub/policy-content

USAGE

{
    "@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/v1.0.0/"
        }
      ],
      "@type": "Policy",
      "profile": "cx-policy:profile2405",
      "permission": [
        {
          "action": "use",
          "constraint": {
                    "and": [
            {
              "leftOperand": "cx-policy:FrameworkAgreement",
              "operator": "eq",
              "rightOperand": "traceability:v1.0"
            },
            {
              "leftOperand": "cx-policy:ContractReference",
              "operator": "eq",
              "rightOperand": "{inputValue}"
            },
            {
              "leftOperand": "cx-policy:UsagePurpose",
              "operator": "eq",
              "rightOperand": "{policy value}"
            }
          ]
        }
      ]
    }
  }

ACCESS

{
    "@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/v1.0.0/"
        }
      ],
      "@type": "Policy",
      "profile": "cx-policy:profile2405",
      "permission": [
        {
          "action": "use",
          "constraint": {
                    "or": [
              {
              "leftOperand": "BusinessPartnerNumber",
              "operator": {
              "@id": "eq"
              },
              "odrl:rightOperand": "{BPNL value submitted by the user or regex}"
              },
               {
              "leftOperand": "BusinessPartnerNumber",
              "operator": {
              "@id": "eq"
              },
              "rightOperand": "{BPNL value submitted by the user or regex}"
              },
               {
              "leftOperand": "BusinessPartnerNumber",
              "operator": {
              "@id": "eq"
              },
              "rightOperand": "{BPNL value submitted by the user or regex}"
              }
          ]
        }
      ]
    }
  }

Special Request only for the POST /api/policy-hub/policy-content endpoint:

Additionally to the generic structure - the support of "OR" constraintOperand for usage constraints are not supported for now.
Since this is in general allowed but not used by catena-x; i suggest instead of deleting the code to comment out the option to set an "OR" connection.
Note: access policies with an "OR" connection are still allowed (as shared above)

@jjeroch
Copy link
Contributor Author

jjeroch commented Mar 13, 2024

@AnuragNagpure suggesting to start this ticket last

Phil91 pushed a commit that referenced this issue Apr 16, 2024
Reviewed-By: Phil Schneider <info@philschneider.de>
Refs: #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: IN REVIEW
Development

No branches or pull requests

2 participants