Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anderseknert/opa-policy-composition
Example policies demonstrating policy composition.
https://github.com/anderseknert/opa-policy-composition
opa open-policy-agent rego
Last synced: about 1 month ago
JSON representation
Example policies demonstrating policy composition.
- Host: GitHub
- URL: https://github.com/anderseknert/opa-policy-composition
- Owner: anderseknert
- Created: 2021-03-24T21:06:15.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T19:11:07.000Z (7 months ago)
- Last Synced: 2024-10-14T15:56:58.953Z (3 months ago)
- Topics: opa, open-policy-agent, rego
- Language: Open Policy Agent
- Homepage:
- Size: 6.84 KB
- Stars: 6
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# opa-policy-composition
Example policies demonstrating policy composition in Rego. These example accompany the [blog post](https://blog.styra.com/blog/dynamic-policy-composition-for-opa) on the same topic as found on the [Styra](https://www.styra.com) blog.
## Running
`opa run --server --set default_decision=/main/decision .`
Query OPA (use team1-3 as input, and try removing the `explain` attribute):
`curl -d '{"resource": "volume", "explain": true}' http://localhost:8181`
Or if you prefer using `opa eval`:
```shell
opa eval -f pretty -d . 'data.main.decision with input as {"resource": "volume", "explain": true}'
```