<!-- Generated by website/scripts/sync-docs.mjs from docs/gateways.md. Edit that file, not this one. -->

# API gateways

> Every page of this site: https://dyokto.github.io/opa-authzen-plugin/llms.txt

opa-authzen-plugin can serve as a standards-based PDP behind any API gateway that supports external authorization. The [`example/envoy-gateway/`](https://dyokto.github.io/opa-authzen-plugin/examples/envoy-gateway/) directory demonstrates this pattern with Envoy proxy:

```text
Client → Envoy → ext-authz-bridge → opa-authzen-plugin (AuthZEN PDP)
                                          ↓
                                     OPA Rego policy
```

A thin translation layer (ext-authz-bridge) converts gateway-specific protocols (e.g., Envoy ext_authz gRPC) into AuthZEN evaluation requests. The PDP itself is **gateway-agnostic** — it can serve any AuthZEN-compatible PEP (Kong, AWS API Gateway, Tyk, etc.) without modification.

This differs from [opa-envoy-plugin](https://github.com/open-policy-agent/opa-envoy-plugin), which embeds Envoy's gRPC ext_authz protocol directly into OPA. opa-authzen-plugin uses the [OpenID AuthZEN standard](https://openid.net/specs/authorization-api-1_0.html) as the protocol between the gateway and PDP.

```bash
cd example/envoy-gateway
docker compose up --build
# Test
curl -i -H "X-User: rick" http://localhost:9000/todos    # → 200
curl -i -X POST -H "X-User: jerry" http://localhost:9000/todos  # → 403
```
