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

Simple filterExpression with constraint does not work (BusinessPartnerNumber = "something") #430

Open
napfernandes opened this issue Sep 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@napfernandes
Copy link

Current Behavior

Hi all! I'm creating an access policy to be used among some of my contracts, and I want to re-use the same policy for some of them. I'm able to create the policy with the following request body:

{
  "@context": {
    "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
  },
  "@id": "{{POLICY_DEFINITION_ID}}",
  "policy": {
    "@context": "http://www.w3.org/ns/odrl.jsonld",
    "@type": "Set",
    "@id": "{{POLICY_DEFINITION_ID}}",
    "odrl:permission": [
      {
        "odrl:action": "USE",
        "odrl:constraint": {
            "@type": "LogicalConstraint",
            "odrl:and": [{
                "@type": "Constraint",
              "odrl:leftOperand": "BusinessPartnerNumber",
              "odrl:operator": {
                "@id": "odrl:eq"
              },
              "odrl:rightOperand": "BPNL123"
            }]   
        }
      }
    ]
  }
}

Which gives me an IdResponse like:

{
    "@type": "IdResponse",
    "@id": "4fe7d4f3-9890-4cd9-9e1e-671faf8ba39b",
    "createdAt": 1726832897018,
    "@context": {
        "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
        "edc": "https://w3id.org/edc/v0.0.1/ns/",
        "tx": "https://w3id.org/tractusx/v0.0.1/ns/",
        "tx-auth": "https://w3id.org/tractusx/auth/",
        "cx-policy": "https://w3id.org/catenax/policy/",
        "odrl": "http://www.w3.org/ns/odrl/2/"
    }
}

When I try to query by its ID using POST /management/v3/policydefinitions/request, it works seamsly:
image

However, the same query does not work when I try to query it by its BusinessPartnerNumber:
image

It brings back this Error validating schema: Field BusinessPartnerNumber not found on type class org.eclipse.edc.connector.controlplane.policy.spi.PolicyDefinition.

Where can I find this validation schema details? I was browsing the current repository but could not find anything mentioning that, nor the Swagger has any example for such.

I'm following the Swagger specs are provided in the following link:
https://app.swaggerhub.com/apis/eclipse-tractusx-bot/tractusx-edc/0.8.0-rc3

My EDC is on version 0.7.3.

Thank you all!

@napfernandes napfernandes added the bug Something isn't working label Sep 20, 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
None yet
Development

No branches or pull requests

1 participant