# openid/authzen architecture

> Architecture diagram of the GitHub repository openid/authzen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openid/authzen
- Repository: https://github.com/openid/authzen

## Overview

AuthZEN is a standards and interoperability repository. The supplied README describes authorization APIs and profiles, while the available source tree centers on runnable interop applications: a Todo client/backend, an identity-provider demo, a search demo, and API-gateway adapters. The graph emphasizes the Todo authorization path and preserves these distinct branches. Edges are limited to relationships shown in excerpts or documented in the README; unsampled integrations are not inferred.

Main entry points: [`interop/authzen-todo-application/src/App.tsx`](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/App.tsx) (Todo application), [`interop/authzen-todo-backend/src/server.ts`](https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/server.ts) (Todo HTTP backend), [`interop/authzen-todo-application/src/hooks/useTodos.ts`](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/hooks/useTodos.ts) (Todo data hooks), [`interop/authzen-api-gateways`](https://github.com/openid/authzen/tree/main/interop/authzen-api-gateways) (Gateway integrations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_todo["Todo Interop"]
  node_todo_app["Todo application<br/>[App.tsx]"]
  node_todo_controls["Todo controls<br/>[Todos.tsx]"]
  node_todo_create["Create todo<br/>[CreateTodo.tsx]"]
  node_todo_settings["AuthZEN settings"]
  node_todo_config["Gateway and PDP config<br/>[ConfigContext.tsx]"]
  node_todo_auth["Client authentication<br/>[AuthContext.tsx]"]
  node_todo_hooks["Todo data hooks<br/>[useTodos.ts]"]
  node_todo_api["Todo API client<br/>[todoApi.ts]"]
  node_todo_backend["Todo HTTP backend<br/>[server.ts]"]
  node_todo_store[("Todo store<br/>[store.ts]")]
  node_todo_directory[("User directory<br/>[directory.ts]")]
  node_todo_authz["Authorization checks<br/>[auth.ts]"]
  node_stateful_service["Stateful PDP adapter"]
  node_openfga["OpenFGA adapter<br/>[openfga.ts]"]
end

subgraph group_identity["Identity Demo"]
  node_idp_handler["OIDC login handler"]
  node_idp_ui["ID token and audit UI"]
  node_audit_log["Audit log view<br/>[audit-log.tsx]"]
end

subgraph group_search["Search Demo"]
  node_search_app["Search demo interface<br/>[_layout.tsx]"]
  node_search_routes["Search and resource routes<br/>[resource.tsx]"]
  node_search_pdp["Search PDP client<br/>[callPdp.ts]"]
end

subgraph group_adapters["Gateway Adapters"]
  node_gateway_adapters["Gateway integrations"]
  node_aws_adapter["AWS API Gateway<br/>[authzen.mjs]"]
  node_envoy_adapter["Envoy authorizer<br/>[authzen.go]"]
  node_tyk_adapter["Tyk plugin<br/>[authzen.go]"]
  node_zuplo_adapter["Zuplo module<br/>[authzen.ts]"]
end

subgraph group_shared["Authorization Services"]
  node_pdp["AuthZEN PDP"]
end

node_user(("Todo user"))

node_user -->|"uses"| node_todo_app
node_todo_app -->|"renders"| node_todo_controls
node_todo_app -->|"renders"| node_todo_create
node_todo_app -->|"renders"| node_todo_settings
node_todo_app -->|"reads todos"| node_todo_hooks
node_todo_settings -->|"reads settings"| node_todo_config
node_todo_hooks -->|"gets gateway config"| node_todo_config
node_todo_hooks -->|"calls"| node_todo_api
node_todo_controls -->|"uses"| node_todo_hooks
node_todo_create -->|"uses"| node_todo_hooks
node_todo_app -->|"reads identity"| node_todo_auth
node_todo_api -.->|"HTTP requests"| node_todo_backend
node_todo_backend -->|"reads and writes"| node_todo_store
node_todo_backend -->|"looks up users"| node_todo_directory
node_todo_backend -->|"checks access"| node_todo_authz
node_todo_authz -->|"evaluates access"| node_pdp
node_todo_backend -->|"creates adapter"| node_stateful_service
node_stateful_service -->|"selects OpenFGA"| node_openfga
node_openfga -.->|"updates tuples"| node_pdp
node_idp_handler -.->|"externalizes authorization"| node_pdp
node_idp_ui -->|"renders preview"| node_audit_log
node_user -.->|"authenticates"| node_idp_handler
node_search_app -.->|"hosts routes"| node_search_routes
node_search_routes -.->|"requests decisions"| node_search_pdp
node_gateway_adapters -.->|"includes"| node_aws_adapter
node_gateway_adapters -.->|"includes"| node_envoy_adapter
node_gateway_adapters -.->|"includes"| node_tyk_adapter
node_gateway_adapters -.->|"includes"| node_zuplo_adapter

click node_todo_app "https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/App.tsx"
click node_todo_controls "https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/components/Todos.tsx"
click node_todo_create "https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/components/CreateTodo.tsx"
click node_todo_settings "https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/components/AuthZENSettings.tsx"
click node_todo_config "https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/context/ConfigContext.tsx"
click node_todo_auth "https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/context/AuthContext.tsx"
click node_todo_hooks "https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/hooks/useTodos.ts"
click node_todo_api "https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/api/todoApi.ts"
click node_todo_backend "https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/server.ts"
click node_todo_store "https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/store.ts"
click node_todo_directory "https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/directory.ts"
click node_todo_authz "https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/auth.ts"
click node_stateful_service "https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/statefulAuthorizationService.ts"
click node_openfga "https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/stateful/openfga.ts"
click node_idp_handler "https://github.com/openid/authzen/blob/main/interop/authzen-idp/app/lib/create-idp-handler.ts"
click node_idp_ui "https://github.com/openid/authzen/blob/main/interop/authzen-idp/app/components/id-token.client.tsx"
click node_audit_log "https://github.com/openid/authzen/blob/main/interop/authzen-idp/app/components/audit-log.tsx"
click node_search_app "https://github.com/openid/authzen/blob/main/interop/authzen-search-demo/app/_layout.tsx"
click node_search_routes "https://github.com/openid/authzen/blob/main/interop/authzen-search-demo/app/routes/resource.tsx"
click node_search_pdp "https://github.com/openid/authzen/blob/main/interop/authzen-search-demo/app/lib/callPdp.ts"
click node_gateway_adapters "https://github.com/openid/authzen/tree/main/interop/authzen-api-gateways"
click node_aws_adapter "https://github.com/openid/authzen/blob/main/interop/authzen-api-gateways/aws-api-gateway/authzen.mjs"
click node_envoy_adapter "https://github.com/openid/authzen/blob/main/interop/authzen-api-gateways/envoy-gateway/authzen-external-authorizer/authzen.go"
click node_tyk_adapter "https://github.com/openid/authzen/blob/main/interop/authzen-api-gateways/tyk-gateway/plugins/authzen.go"
click node_zuplo_adapter "https://github.com/openid/authzen/blob/main/interop/authzen-api-gateways/zuplo-gateway/modules/authzen.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_todo_app,node_todo_controls,node_todo_create,node_todo_settings,node_todo_config,node_todo_auth,node_todo_hooks,node_todo_api,node_todo_backend,node_todo_store,node_todo_directory,node_todo_authz,node_stateful_service,node_openfga,node_user toneBlue
class node_idp_handler,node_idp_ui,node_audit_log toneAmber
class node_search_app,node_search_routes,node_search_pdp toneMint
class node_gateway_adapters,node_aws_adapter,node_envoy_adapter,node_tyk_adapter,node_zuplo_adapter toneRose
class node_pdp toneIndigo
```

## Components

### Todo Interop

- [Todo application](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/App.tsx): `interop/authzen-todo-application/src/App.tsx`
- [Todo controls](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/components/Todos.tsx): `interop/authzen-todo-application/src/components/Todos.tsx`
- [Create todo](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/components/CreateTodo.tsx): `interop/authzen-todo-application/src/components/CreateTodo.tsx`
- [AuthZEN settings](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/components/AuthZENSettings.tsx): `interop/authzen-todo-application/src/components/AuthZENSettings.tsx`
- [Gateway and PDP config](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/context/ConfigContext.tsx): `interop/authzen-todo-application/src/context/ConfigContext.tsx`
- [Client authentication](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/context/AuthContext.tsx): `interop/authzen-todo-application/src/context/AuthContext.tsx`
- [Todo data hooks](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/hooks/useTodos.ts): `interop/authzen-todo-application/src/hooks/useTodos.ts`
- [Todo API client](https://github.com/openid/authzen/blob/main/interop/authzen-todo-application/src/api/todoApi.ts): `interop/authzen-todo-application/src/api/todoApi.ts`
- [Todo HTTP backend](https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/server.ts): `interop/authzen-todo-backend/src/server.ts`
- [Todo store](https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/store.ts): `interop/authzen-todo-backend/src/store.ts`
- [User directory](https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/directory.ts): `interop/authzen-todo-backend/src/directory.ts`
- [Authorization checks](https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/auth.ts): `interop/authzen-todo-backend/src/auth.ts`
- [Stateful PDP adapter](https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/statefulAuthorizationService.ts): `interop/authzen-todo-backend/src/statefulAuthorizationService.ts`
- [OpenFGA adapter](https://github.com/openid/authzen/blob/main/interop/authzen-todo-backend/src/stateful/openfga.ts): `interop/authzen-todo-backend/src/stateful/openfga.ts`

### Identity Demo

- [OIDC login handler](https://github.com/openid/authzen/blob/main/interop/authzen-idp/app/lib/create-idp-handler.ts): `interop/authzen-idp/app/lib/create-idp-handler.ts`
- [ID token and audit UI](https://github.com/openid/authzen/blob/main/interop/authzen-idp/app/components/id-token.client.tsx): `interop/authzen-idp/app/components/id-token.client.tsx`
- [Audit log view](https://github.com/openid/authzen/blob/main/interop/authzen-idp/app/components/audit-log.tsx): `interop/authzen-idp/app/components/audit-log.tsx`

### Search Demo

- [Search demo interface](https://github.com/openid/authzen/blob/main/interop/authzen-search-demo/app/_layout.tsx): `interop/authzen-search-demo/app/_layout.tsx`
- [Search and resource routes](https://github.com/openid/authzen/blob/main/interop/authzen-search-demo/app/routes/resource.tsx): `interop/authzen-search-demo/app/routes/resource.tsx`
- [Search PDP client](https://github.com/openid/authzen/blob/main/interop/authzen-search-demo/app/lib/callPdp.ts): `interop/authzen-search-demo/app/lib/callPdp.ts`

### Gateway Adapters

- [Gateway integrations](https://github.com/openid/authzen/tree/main/interop/authzen-api-gateways): `interop/authzen-api-gateways`
- [AWS API Gateway](https://github.com/openid/authzen/blob/main/interop/authzen-api-gateways/aws-api-gateway/authzen.mjs): `interop/authzen-api-gateways/aws-api-gateway/authzen.mjs`
- [Envoy authorizer](https://github.com/openid/authzen/blob/main/interop/authzen-api-gateways/envoy-gateway/authzen-external-authorizer/authzen.go): `interop/authzen-api-gateways/envoy-gateway/authzen-external-authorizer/authzen.go`
- [Tyk plugin](https://github.com/openid/authzen/blob/main/interop/authzen-api-gateways/tyk-gateway/plugins/authzen.go): `interop/authzen-api-gateways/tyk-gateway/plugins/authzen.go`
- [Zuplo module](https://github.com/openid/authzen/blob/main/interop/authzen-api-gateways/zuplo-gateway/modules/authzen.ts): `interop/authzen-api-gateways/zuplo-gateway/modules/authzen.ts`

### Authorization Services

- **AuthZEN PDP**

### Other components

- **Todo user**

## Connections

- Todo user → Todo application: uses (evidence: `README.md`)
- Todo application → Todo controls: renders (evidence: `interop/authzen-todo-application/src/App.tsx`)
- Todo application → Create todo: renders (evidence: `interop/authzen-todo-application/src/App.tsx`)
- Todo application → AuthZEN settings: renders (evidence: `interop/authzen-todo-application/src/App.tsx`)
- Todo application → Todo data hooks: reads todos (evidence: `interop/authzen-todo-application/src/App.tsx`)
- AuthZEN settings → Gateway and PDP config: reads settings (evidence: `interop/authzen-todo-application/src/components/AuthZENSettings.tsx`)
- Todo data hooks → Gateway and PDP config: gets gateway config (evidence: `interop/authzen-todo-application/src/hooks/useTodos.ts`)
- Todo data hooks → Todo API client: calls (evidence: `interop/authzen-todo-application/src/hooks/useTodos.ts`)
- Todo controls → Todo data hooks: uses (evidence: `interop/authzen-todo-application/src/components/Todos.tsx`)
- Create todo → Todo data hooks: uses (evidence: `interop/authzen-todo-application/src/components/CreateTodo.tsx`)
- Todo application → Client authentication: reads identity (evidence: `interop/authzen-todo-application/src/App.tsx`)
- Todo API client → Todo HTTP backend: HTTP requests (evidence: `README.md`)
- Todo HTTP backend → Todo store: reads and writes (evidence: `interop/authzen-todo-backend/src/server.ts`)
- Todo HTTP backend → User directory: looks up users (evidence: `interop/authzen-todo-backend/src/server.ts`)
- Todo HTTP backend → Authorization checks: checks access (evidence: `interop/authzen-todo-backend/src/server.ts`)
- Authorization checks → AuthZEN PDP: evaluates access (evidence: `interop/authzen-todo-backend/src/auth.ts`)
- Todo HTTP backend → Stateful PDP adapter: creates adapter (evidence: `interop/authzen-todo-backend/src/server.ts`)
- Stateful PDP adapter → OpenFGA adapter: selects OpenFGA (evidence: `interop/authzen-todo-backend/src/statefulAuthorizationService.ts`)
- OpenFGA adapter → AuthZEN PDP: updates tuples
- OIDC login handler → AuthZEN PDP: externalizes authorization
- ID token and audit UI → Audit log view: renders preview (evidence: `interop/authzen-idp/app/components/id-token.client.tsx`)
- Todo user → OIDC login handler: authenticates
- Search demo interface → Search and resource routes: hosts routes
- Search and resource routes → Search PDP client: requests decisions
- Gateway integrations → AWS API Gateway: includes (evidence: `interop/authzen-api-gateways/aws-api-gateway/authzen.mjs`)
- Gateway integrations → Envoy authorizer: includes
- Gateway integrations → Tyk plugin: includes
- Gateway integrations → Zuplo module: includes
