https://github.com/swisscom/apisix-opa-plugin
https://github.com/swisscom/apisix-opa-plugin
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/swisscom/apisix-opa-plugin
- Owner: swisscom
- License: other
- Created: 2021-11-10T14:24:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T12:06:03.000Z (about 3 years ago)
- Last Synced: 2025-04-15T10:19:28.427Z (about 1 year ago)
- Language: Go
- Size: 24.4 KB
- Stars: 6
- Watchers: 13
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apisix-opa-plugin
An Open Policy Agent plugin for [Apache APISIX](https://apisix.apache.org/)
## Remarks
This plugin requires the `OPA_URL` environment variable to be set. As per
[external-plugin FAQ](https://apisix.apache.org/docs/apisix/external-plugin/#when-managing-by-apisix-the-runner-cant-access-my-environment-variable)
the `nginx_config` configuration must be set to forward this environment variable to the runner,
otherwise it will be hidden.
To do so, the APISIX configuration should include a similar snippet of configuration:
```yaml
nginx_config:
envs:
- OPA_URL
```
## Plugin Configuration
When setting up the plugin on APISIX, provide a configuration
similar to the following:
```json
{
"conf": [
{
"name": "opa",
"value": "{\"rule_path\": \"com.swisscom.ini.dna.nb/rule1\"}"
}
],
"disable": false
}
```