Add rego-rules' validation in "Create partition policy" requests
We send the following request:
PUT {{baseurl}}/api/policy/v1/policies/osdu/partition/osdu/storage-viewer.rego
with the file with content:
package osdu.partition["osdu"].storage-viewer
allow = true {
input.operation == "view"
"service.storage.admin"==input.groups[j]
}
And we start receiving the following errors from OPA:
{level: error, msg: Bundle load failed: 1 error occurred: storage-viewer.rego:1: rego_parse_error: unexpected ident token: expected number package osdu.partition["osdu"].storage-viewer ^, name: osdu/partition/osdu, plugin: bundle}
OPA service stops working because of a malformed rego-rule, and this problem affects other core services.
It seems that Policy service shouldn't let rego-files pass that could break OPA service.