Architecture Overview
Current Production & Target Data Plane β Verified against
stoa-platform/stoa(main)
STOA Platform is an open-source, cloud-native, multi-tenant gateway platform built for both traditional APIs and AI agents. This document separates two explicit views:
- Current Production Stack β What runs today on
stoa-platform/stoamain - Target Envoy Data Plane (ADR-073) β How L4/L7 proxy duties are converging onto upstream Envoy while STOA retains the Control Plane, authorization, MCP protocol layer, and Link control loop
Current Production Architectureβ
Core Services on mainβ
| Component | Endpoint / Scope | Lifecycle | Stack |
|---|---|---|---|
| Developer Portal | portal.<domain> | β Production | React 19, TypeScript (portal/) |
| Admin Console | console.<domain> | β Production | React 19, TypeScript (control-plane-ui/) |
| Control Plane API | api.<domain> | β Production | Python 3.11, FastAPI, SQLAlchemy (control-plane-api/) |
| STOA Gateway | mcp.<domain> / :8080 | β Production / Maintenance (ADR-073) | Rust, Tokio, axum, tonic (stoa-gateway/) |
STOA Link (stoa-connect) | On-premise / cluster agent (:8090) | Route adapters implemented (Kong/Gravitee/webMethods) / Opt-in Envoy ADS | Go 1.25 (stoa-go/cmd/stoa-connect) |
stoactl CLI | Operator workstation / CI | β
Production (built from stoa-go/) | Go 1.25 (stoa-go/cmd/stoactl) |
stoa-operator | In-cluster (GatewayInstance, GatewayBinding) | π§ͺ Beta | Python, Kopf (stoa-operator/) |
| Keycloak | auth.<domain> (stoa realm) | β Production | Keycloak 26 (ADR-074) |
| OpenBao | Internal Vault HTTP API | π Partial rollout | OpenBao 2.7.2, MPL 2.0 (ADR-075) |
| Redpanda | Internal cluster network only | β Production | Redpanda / Kafka API (ADR-005) |
| PostgreSQL | Internal cluster network only | β Production | PostgreSQL 15 (full Compose / prod catalog) or 16 (R1 quickstart/), shared schema (tenant_id) |
| Observability | Internal / operator ingress | β Production | Prometheus, Grafana, OpenSearch, Data Prepper, Tempo |
Key Architectural Guarantees Implemented on mainβ
- Single-realm tenant identity (ADR-074): One shared Keycloak realm (
stoa), one top-level Keycloak group per tenant (/<tenant_id>,setup_tenant_group), verifiedtenant_idJWT claims (Claims::tenant_id()/require_tenanton the gateway andrequire_tenant_accessin Python, withenforce_tenant_isolationas the RustRbacPolicyboolean setting), and a shared PostgreSQL schema filtered bytenant_id(retiring the older realm-per-tenant draft in ADR-026). - Fail-closed gateway posture (ADR-070):
stoa-gatewayverifies Ed25519-signed per-tenant policy bundles (STOA_POLICY_BOOT_TENANTS), enforcesSTOA_MCP_AUDIENCE, and maintains a durable audit WAL spool (STOA_AUDIT_SPOOL_DIR). - MCP
2025-11-25& Contract Routes: Streamable HTTP (POST /mcp), SSE (/mcp/sse), opt-in WebSocket (/mcp/wsviaSTOA_WEBSOCKET_ENABLED=true), and transactional REST + MCP route registration (POST /admin/contracts). - Multi-Gateway Orchestration (ADR-035): The Control Plane provides 6 Python gateway adapters (Kong, Gravitee, webMethods, Apigee, AWS API Gateway, Azure APIM), while the on-site
stoa-connectGo agent implements route adapters for Kong, Gravitee (no Gravitee client in production yet; HTTP409route conflicts are masked), and webMethods, plus explicit opt-in Envoy loopback ADS β Link policy application is rejected (unsupportedinpolicy_contract.go) for Kong and Gravitee, and active for webMethods and Envoy ADS v1 filters (cors,rate_limit,ip_filter), without routing deployment commands over Kafka. - No Redis Dependency: Rate-limiting, JWKS, and token caches operate in-process; STOA does not deploy or require Redis.
Public Git Repositoriesβ
| Repository | Purpose |
|---|---|
stoa-platform/stoa | Monorepo: Control Plane API, UIs, stoa-gateway, stoa-go (stoactl + stoa-connect), stoa-operator, quickstart/, deploy/docker-compose/, and Helm charts (charts/stoa-platform, charts/stoa-observability) |
stoa-platform/stoa-docs | Documentation site (docs.gostoa.dev) |
stoa-platform/stoa-web | Landing site (gostoa.dev) |
(Note: Helm charts live inside stoa-platform/stoa/charts/; there is no separate active stoa-helm chart release repository.)
Synchronization Flowβ
Target Data Plane Architecture (ADR-073)β
Rather than building a custom kernel/eBPF proxy or rewriting the Control Plane in Go, ADR-073 delegates commodity L4/L7 proxy functions (TLS/mTLS, HTTP/1-2-3, connection pooling, retries, circuit breaking) to upstream Envoy while keeping STOA's differentiators in dedicated processes:
Delivered Building Blocks vs Pending Migration on mainβ
| Capability | Status on main | Implementation Proof |
|---|---|---|
Loopback mTLS xDS ADS server in stoa-connect | β
Implemented (opt-in via STOA_GATEWAY_TYPE=envoy) | stoa-go/cmd/stoa-connect/envoy.go, stoa-go/cmd/stoa-connect/ENVOY.md; translates v1 cors, per-process rate_limit, and direct-peer ip_filter |
gRPC ExtAuthzService in stoa-gateway | β
Implemented (opt-in via STOA_EXT_AUTHZ_GRPC_ADDR, STOA_EXT_AUTHZ_AUDIENCE, and non-empty STOA_EXT_AUTHZ_REQUIRED_SCOPES in prod) | stoa-gateway/src/authz/ext_authz_grpc.rs, stoa-gateway/src/config/loader.rs:212-223 (validates JWT, tenant_id, audience/scopes & DecisionEngine; distinct from MCP tool-permission JWS checks) |
| Offline Envoy + Link + gRPC acceptance harness | π§ͺ Manual offline harness (workflow_dispatch) | docs/testing/o1-offline-envoy.md, .github/workflows/o1-envoy-real-proof.yml (real Envoy + Link + independent gRPC Check witness + synthetic auth/SQLite; not an automated per-PR CI check or live Rust ExtAuthzService/JWT test) |
| Full policy translator parity | π§ In progress | jwt_validation, OIDC, logging, caching, and transform are not yet translated into Envoy filters by stoa-connect |
Streaming ext_proc & standalone MCP split | π Planned (ADR-073) | Token metering / guardrail ext_proc and decoupling MCP from standalone proxy listener |
| Default Helm & Compose topology cut-over | π Planned | charts/stoa-platform and deploy/docker-compose/ still deploy stoa-gateway directly as the default ingress gateway |
See Data Plane Architecture for line-level code references and migration phases.
Deployed Kubernetes CRDs (gostoa.dev/v1alpha1)β
Five Custom Resource Definitions are shipped today in charts/stoa-platform/crds/ under the gostoa.dev/v1alpha1 API group:
- Watched by
stoa-gateway(STOA_K8S_ENABLED=true, compiled with thek8sCargo feature):Tool,ToolSet,Skill - Reconciled by
stoa-operator:GatewayInstance,GatewayBinding
apiVersion: gostoa.dev/v1alpha1
kind: Tool
metadata:
name: billing-api
namespace: stoa-system
spec:
displayName: Billing API
description: Query customer invoices
endpoint: https://billing.internal.example.com/v1/invoices
method: GET
inputSchema:
type: object
properties:
customer_id:
type: string
---
apiVersion: gostoa.dev/v1alpha1
kind: GatewayInstance
metadata:
name: prod-edge-mcp
namespace: stoa-system
spec:
displayName: Production Edge MCP Gateway
gatewayType: stoa_edge_mcp
environment: prod
baseUrl: https://mcp.example.com
See the Kubernetes CRDs Reference for complete schemas and enforced enum values.
Technology Stack Comparisonβ
| Layer | Current Production (main) | Target Evolution |
|---|---|---|
| L4/L7 Data Plane | stoa-gateway (Rust, Tokio, axum β Maintenance) | Upstream Envoy + stoa-connect loopback mTLS ADS (ADR-073) |
| Authorization Engine | In-process Rust middleware + OPA + signed policies (ADR-070) | Rust ExtAuthzService gRPC server called by Envoy (STOA_EXT_AUTHZ_GRPC_ADDR) |
| MCP Protocol Layer | Integrated in stoa-gateway (Rust) | Dedicated Rust MCP service behind Envoy |
| Control Plane API | Python 3.11, FastAPI | Python 3.11, FastAPI |
| CLI & Link Agent | Go 1.25 (stoactl, stoa-connect) | Go 1.25 (stoactl, stoa-connect / STOA Link) |
| Kubernetes Operator | Python, Kopf (stoa-operator, Beta) | Python, Kopf (stoa-operator) |
| Frontend | React 19, TypeScript, Tailwind | React 19, TypeScript, Tailwind |
| Database | PostgreSQL 15 / 16 (shared schema, tenant_id) | PostgreSQL 15 / 16 (ADR-074) |
| Event Backbone | Redpanda (Kafka API, internal only) | Redpanda (ADR-005) |
| Identity | Keycloak 26 (single stoa realm, tenant groups) | Keycloak 26 (ADR-074) |
| Secrets | OpenBao 2.7.2 / Vault HTTP API (partial rollout) | Full OpenBao / Vault HTTP API coverage (ADR-075) |
| Observability | Prometheus, Grafana, OpenSearch, Data Prepper, Tempo | OpenTelemetry-native metrics, logs, and traces |
Security Zonesβ
| Zone | Trust Level | Components |
|---|---|---|
| External | Untrusted | API Clients, AI Agents, Browser UIs |
| DMZ | Semi-trusted | Ingress Controller, stoa-gateway, Envoy + stoa-connect |
| Internal | Trusted | Control Plane API, stoa-operator, Keycloak, PostgreSQL, Redpanda, OpenBao, OpenSearch |
Key security principles:
- Redpanda/Kafka has zero external exposure (ADR-005)
- Multi-tenant isolation uses a single
stoaKeycloak realm, per-tenant groups, and verifiedtenant_idJWT claims (ADR-074) - Gateway tool authorization fails closed on missing or invalid signed policy bundles (ADR-070)
- Declarative GitOps delivery with Argo CD (ADR-007) and digest-pinned Helm images
- Secrets managed through the Vault HTTP API backend: OpenBao by default (ADR-075)
Related Documentsβ
- Data Plane Architecture β Detailed Envoy + STOA Link +
ext_authzarchitecture - Gateway Deployment Modes β
edge-mcp,sidecar,proxy, andshadow - Architecture Decision Records (ADRs) β Full decision log
- Kubernetes CRDs Reference β
gostoa.dev/v1alpha1schemas