API Container Images

Open Policy Agent Examples

The Open Policy Agent (OPA , pronounced "oh-pa") is an open source, general-purpose policy engin that unifies policy enforcement across the stack.

This repository centralize various static and dynamic based policies to demonstrate the power of OPA.

Running exercises

Clone this repostory

git clone https://github.com/fjudith/open-policy-agent-exercices opa-exercices
cd opa-exercices

Create a Python virtual environment

virtualenv .venv
./.venv/bin/activate

API

Flask based basic RESTFul API

pushd "./api/01_basic_flask_restful_api"
pip install -r ./requirements.txt
opa run -s "./apiserver.rego" & \
python "./apiserver.py"

Bottlepy based basic RESTFul API

pushd "./api/01_basic_bottle_restful_api"
pip install -r ./requirements.txt
opa run -s "./apiserver.rego" & \
python "./apiserver.py"