-
Notifications
You must be signed in to change notification settings - Fork 245
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 Definition API accepts policy that causes exception when calling catalog and refuses other policy #3687
Comments
Thanks for your contribution 🔥 We will take a look asap 🚀 |
You are not specifying the {
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"@id": "test_data_medical(1).json_policy",
"policy": {
"@type": "set",
"@context": "http://www.w3.org/ns/odrl.jsonld",
"permission": [
{
"target": "test_data_medical(1).json",
"action": "transform",
"constraints": [
{
"leftOperand": "product",
"operator": "eq",
"rightOperand": "allergy",
"comment": "keep_data"
},
{
"leftOperand": "product",
"operator": "eq",
"rightOperand": " symptoms",
"comment": "keep_data"
},
{
"leftOperand": "product",
"operator": "eq",
"rightOperand": " previous sickness",
"comment": "keep_data"
}
]
}
],
"prohibition": [
{
"target": "test_data_medical(1).json",
"action": "transform",
"constraint": [
{
"leftOperand": "dateTime",
"operator": "eq",
"rightOperand": "2024-05-12",
"comment": "save_until"
}
]
}
],
"obligation": [
{
"target": "test_data_medical(1).json",
"action": "transform",
"constraint": [
{
"leftOperand": "resolution",
"operator": "eq",
"rightOperand": "allergy:2",
"comment": "abstractLvl"
},
{
"leftOperand": "resolution",
"operator": "eq",
"rightOperand": " symptoms:1",
"comment": "abstractLvl"
},
{
"leftOperand": "resolution",
"operator": "eq",
"rightOperand": " previous sickness:3",
"comment": "abstractLvl"
}
]
},
{
"target": "test_data_medical(1).json",
"action": "transform",
"constraint": [
{
"leftOperand": "product",
"operator": "eq",
"rightOperand": "allergy",
"comment": "differantialPrivacy"
},
{
"leftOperand": "product",
"operator": "eq",
"rightOperand": " symptoms",
"comment": "differantialPrivacy"
}
]
}
]
}
} note: when you get error like these is because the json-ld library is not able to expand the body, eventually you can try it out on the json-ld playground manually |
I get the same response for that. <title>Error 400 Bad Request</title>HTTP ERROR 400 Bad Request
Powered by Jetty:// 11.0.16 |
could you please add some details, as edc version? any stack traces? OS? |
I am on EDC release 0.3.1, Windows 10. I have slightly edited the http dataplane and my goal is to pass the variables of the contract onto my dataplane. the stack trace is:
|
EDC is not fully supported to run on windows machine, please run it into a containered environment on linux. |
It should have been solved by #3670, could you try it again with the latest main commit? |
This issue is stale because it has been open for 14 days with no activity. |
This issue was closed because it has been inactive for 7 days since being marked as stale. |
1 similar comment
This issue was closed because it has been inactive for 7 days since being marked as stale. |
When calling the policy definition API with:
curl -d '{ "@context": { "edc": "https://w3id.org/edc/v0.0.1/ns/", "odrl": "http://www.w3.org/ns/odrl/2/" }, "@id": "test_data_medical(1).json_policy", "policy": { "@type": "set", "@context": "http://www.w3.org/ns/odrl.jsonld", "permission": [{"target":"test_data_medical(1).json", "action": "transform","constraints": [{ "leftOperand": "product", "operator": "eq", "rightOperand": "allergy", "comment": "keep_data"},{ "leftOperand": "product", "operator": "eq", "rightOperand": " symptoms", "comment": "keep_data"},{ "leftOperand": "product", "operator": "eq", "rightOperand": " previous sickness", "comment": "keep_data"}]}], "prohibition":[{"target":"test_data_medical(1).json", "action": "transform","constraint": [{ "leftOperand": "dateTime", "operator": "eq", "rightOperand": "2024-05-12", "comment": "save_until"}]}], "obligation":[{"target":"test_data_medical(1).json", "action": "transform","constraint": [{ "leftOperand": "resolution", "operator": "eq", "rightOperand": "allergy:2", "comment": "abstractLvl"},{ "leftOperand": "resolution", "operator": "eq", "rightOperand": " symptoms:1", "comment": "abstractLvl"},{ "leftOperand": "resolution", "operator": "eq", "rightOperand": " previous sickness:3", "comment": "abstractLvl"}]},{"target":"test_data_medical(1).json", "action": "transform","constraint": [{ "leftOperand": "product", "operator": "eq", "rightOperand": "allergy", "comment": "differantialPrivacy"},{ "leftOperand": "product", "operator": "eq", "rightOperand": " symptoms", "comment": "differantialPrivacy"}]}] } }' -H 'content-type: application/json' http://localhost:19193/management/v2/assets \ -s | jq
Expected behavior: accepting the policy
Real behavior:
<title>Error 400 Bad Request</title>`
HTTP ERROR 400 Bad Request
Powered by Jetty:// 11.0.16
`
Without adding the "context" in the policy and using my own made up strings as constarints, the policy is accepted. However when trying to call the catalog, it return that "action" is Null and crashes.
The text was updated successfully, but these errors were encountered: