Read-only mirror of https://github.com/swisscom/apisix-opa-plugin — Swisscom. Issues & pull requests at the source.
  • Go 96%
  • Makefile 2.6%
  • Dockerfile 1.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2021-11-12 11:02:38 +01:00
.dockerignore feat: complete OPA integration 2021-11-11 16:33:52 +01:00
.gitignore feat: complete OPA integration 2021-11-11 16:33:52 +01:00
auth.go fix: OPA requests and responses are now correctly handled 2021-11-12 11:02:38 +01:00
auth_test.go feat: complete OPA integration 2021-11-11 16:33:52 +01:00
Dockerfile feat: complete OPA integration 2021-11-11 16:33:52 +01:00
go.mod feat: complete OPA integration 2021-11-11 16:33:52 +01:00
go.sum feat: complete OPA integration 2021-11-11 16:33:52 +01:00
input.go fix: OPA requests and responses are now correctly handled 2021-11-12 11:02:38 +01:00
LICENSE chore: add license 2021-11-10 15:28:03 +01:00
main.go feat: add basic code 2021-11-11 12:14:05 +01:00
Makefile feat: complete OPA integration 2021-11-11 16:33:52 +01:00
README.md docs: remove misleading example 2021-11-12 10:10:58 +01:00
result.go feat: complete OPA integration 2021-11-11 16:33:52 +01:00

apisix-opa-plugin

An Open Policy Agent plugin for Apache APISIX

Remarks

This plugin requires the OPA_URL environment variable to be set. As per external-plugin FAQ 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:

nginx_config:
  envs:
  - OPA_URL

Plugin Configuration

When setting up the plugin on APISIX, provide a configuration similar to the following:

{
  "conf": [
    {
      "name": "opa",
      "value": "{\"rule_path\": \"com.swisscom.ini.dna.nb/rule1\"}"
    }
  ],
  "disable": false
}