wget https://openpolicyagent.org/downloads/latest/opa_windows_amd64.exe
First, create your policy files in .rego
and place them in ./bundles
directory.
Now build the .rego
file with opa
executable command (opa.exe).
opa build bundles/Example.rego
opa build opa/policies/ -o opa/bundles/bundle.tar.gz
this will generate ./bundles/bundles.tar.gz
file that will be mounted to nginx
web server, where opa engine
will read the policies from.
after building the .rego
file it will be automatically mounted to nginx
where the opa engine can execute it.
So, to test the policy just execute the following curl
curl --location 'http://localhost:8181/v1/data/httpapi/authz' \
--header 'Content-Type: application/json' \
--data '{
"input": {
"user": "charlie",
"path": ["finance", "salary", "alice"],
"method": "GET"
}
}'
after writing your .proto
file, you should compile it with mvn
to get the java classes needed for development.
mvn clean package
1- open postman app
2- go to New
3- select grpc