This message was deleted.
# opal
s
This message was deleted.
o
The log clearly shows that OPA rejects the policy provided with a rego_type_error’: ‘multiple default rules named allow found’
OPA Client: unexpected status code: 400, error: {‘code’: ‘invalid_parameter’, ‘message’: ‘error(s) occurred while compiling module(s)’, ‘errors’: [{‘code’: ‘rego_type_error’, ‘message’: ‘multiple default rules named allow found’, ‘location’: {‘file’: ‘Service1/rbac.rego’, ‘row’: 25, ‘col’: 1}}]}
You can use OPA test to validate your Rego before pushing it to Git or bundle server
Also your data source server seems to be serving the data with the wrong mime type: “Attempt to decode JSON with unexpected mimetype: text/html”
s
I was in the assumption that we can use the same rule name multiple times. And in the sample repo Rego file also it is using the same name.
o
You can use the same rule name- but there can only be one default
👍 1
Which I’d say makes sense ☺️
s
And regarding the mime type, I have added application/json in my github webhook. Other than that, do I need to add it anywhere else?
o
The server which you point to with the URL in your data-update should also serve JSON; (unless you use a custom data-fetcher)
This is the URL in the log - “https://9027-183-83-252-7.in.ngrok.io/policy-data
s
Got it thanks alot
😇 1