Translate api not working for http call
Tested an allow policy where the user groups are retrieved with http call from the Entitlements service:
package osdu.partition["osdu"].test_translate_api_3
import data.osdu.instance.entitlements
entitlementsApiResponse := entitlements.groups
permissionSet := {e | e := entitlementsApiResponse.body.groups[_].email}
allow {
input.operation == ["view", "create", "update", "delete", "purge"][_]
input.record.acl.owners[_] == permissionSet[_]
}
With the following input data:
{
"query": "data.osdu.partition[\"osdu\"].test_translate_api_3.allow == true",
"input": {
"operation": "view",
"groups": [
"data.default.owners@osdu.example.com",
"data.default.viewers@osdu.example.com"
]
},
"unknowns": [
"input.record"
]
}
The translate api returns the following error msg:
{
"detail": "An error occurred when talking translate service. An exception of type AssertionError occurred. Arguments:\n()"
}
It should return the following:
{
"query": {
"bool": {
"should": [
{
"bool": {
"filter": [
{
"terms": {
"acl.owners": [
"data.default.owners@osdu.example.com",
"data.default.viewers@osdu.example.com",
...
]
}
}
]
}
}
]
}
}
}
Edited by Dadong Zhou