opa run --server \
--addr=0.0.0.0:8080 \
--log-level=debug \
disco03/policy.rego \
disco03/data/vips.rego
List all policies
curl -s http://localhost:8080/v1/policies | jq ".result[].id"
Check our disco03 policy
curl -s http://localhost:8080/v1/policies/disco03/policy.rego | jq -r ".result.raw"
Check default data
curl -s http://localhost:8080/v1/data/disco03/authorized
curl -s http://localhost:8080/v1/data/vips/names
Eval like testing
curl -s -X POST \
-H 'Content-Type: application/x-yaml' \
-H 'Accept: application/json' \
-d 'input:
name: Gauthier
age: 11
gender: Male' \
http://localhost:8080/v1/data/disco03?explain=full \
| jq ".result.authorized"
curl -s -X POST \
-H 'Content-Type: application/x-yaml' \
-H 'Accept: application/json' \
-d 'input:
name: Arnaud
age: 40
gender: Male' \
http://localhost:8080/v1/data/disco03?explain=full \
| jq ".result.authorized"
curl -s -X POST \
-H 'Content-Type: application/x-yaml' \
-H 'Accept: application/json' \
-d 'input:
name: Lorie
age: 40
gender: Female' \
http://localhost:8080/v1/data/disco03?explain=full \
| jq ".result.authorized"
curl -s -X POST \
-H 'Content-Type: application/x-yaml' \
-H 'Accept: application/json' \
-d 'input:
name: Chantal
age: 79
gender: Female' \
http://localhost:8080/v1/data/disco03?explain=full \
| jq ".result.authorized"