I Built an OPA Plugin That Turns It Into an AuthZEN-Compatible PDP
Introduction In my previous article, I did a deep dive into the AuthZEN Authorization API 1.0 spec. It standardizes communication between PEPs and PDPs. You send a JSON request asking "can this sub...

Source: DEV Community
Introduction In my previous article, I did a deep dive into the AuthZEN Authorization API 1.0 spec. It standardizes communication between PEPs and PDPs. You send a JSON request asking "can this subject do this action on this resource?" and get back {"decision": true/false}. So the spec makes sense. But how do you actually use OPA as an AuthZEN-compatible PDP? OPA already has a REST API (POST /v1/data/...), but it doesn't match the AuthZEN API. Different path: AuthZEN uses POST /access/v1/evaluation Different request structure: OPA requires wrapping in {"input": {...}} Different response structure: OPA returns {"result": ...} There's an authzen-proxy in contrib, a Node.js proxy, but it requires a separate process. So I built a plugin that runs the AuthZEN API directly inside the OPA process using OPA's plugin mechanism. Repo: github.com/kanywst/opa-authzen-plugin The OPA Community Discussion Before getting into the code, some context on why this ended up as a plugin. I opened an issue (