Skip to main content

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:

  1. Current Production Stack β€” What runs today on stoa-platform/stoa main
  2. 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​

ComponentEndpoint / ScopeLifecycleStack
Developer Portalportal.<domain>βœ… ProductionReact 19, TypeScript (portal/)
Admin Consoleconsole.<domain>βœ… ProductionReact 19, TypeScript (control-plane-ui/)
Control Plane APIapi.<domain>βœ… ProductionPython 3.11, FastAPI, SQLAlchemy (control-plane-api/)
STOA Gatewaymcp.<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 ADSGo 1.25 (stoa-go/cmd/stoa-connect)
stoactl CLIOperator workstation / CIβœ… Production (built from stoa-go/)Go 1.25 (stoa-go/cmd/stoactl)
stoa-operatorIn-cluster (GatewayInstance, GatewayBinding)πŸ§ͺ BetaPython, Kopf (stoa-operator/)
Keycloakauth.<domain> (stoa realm)βœ… ProductionKeycloak 26 (ADR-074)
OpenBaoInternal Vault HTTP APIπŸ”„ Partial rolloutOpenBao 2.7.2, MPL 2.0 (ADR-075)
RedpandaInternal cluster network onlyβœ… ProductionRedpanda / Kafka API (ADR-005)
PostgreSQLInternal cluster network onlyβœ… ProductionPostgreSQL 15 (full Compose / prod catalog) or 16 (R1 quickstart/), shared schema (tenant_id)
ObservabilityInternal / operator ingressβœ… ProductionPrometheus, 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), verified tenant_id JWT claims (Claims::tenant_id() / require_tenant on the gateway and require_tenant_access in Python, with enforce_tenant_isolation as the Rust RbacPolicy boolean setting), and a shared PostgreSQL schema filtered by tenant_id (retiring the older realm-per-tenant draft in ADR-026).
  • Fail-closed gateway posture (ADR-070): stoa-gateway verifies Ed25519-signed per-tenant policy bundles (STOA_POLICY_BOOT_TENANTS), enforces STOA_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/ws via STOA_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-connect Go agent implements route adapters for Kong, Gravitee (no Gravitee client in production yet; HTTP 409 route conflicts are masked), and webMethods, plus explicit opt-in Envoy loopback ADS β€” Link policy application is rejected (unsupported in policy_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​

RepositoryPurpose
stoa-platform/stoaMonorepo: 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-docsDocumentation site (docs.gostoa.dev)
stoa-platform/stoa-webLanding site (gostoa.dev)

(Note: Helm charts live inside stoa-platform/stoa/charts/; there is no separate active stoa-helm chart release repository.)

Synchronization Flow​

Event Backbone vs Config Sync

Control Plane synchronization is not Kafka-driven (ADR-059). Redpanda/Kafka is strictly internal for asynchronous metering, audit, and error snapshots (ADR-005).


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​

CapabilityStatus on mainImplementation 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 progressjwt_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πŸ“‹ Plannedcharts/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 the k8s Cargo 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​

LayerCurrent Production (main)Target Evolution
L4/L7 Data Planestoa-gateway (Rust, Tokio, axum β€” Maintenance)Upstream Envoy + stoa-connect loopback mTLS ADS (ADR-073)
Authorization EngineIn-process Rust middleware + OPA + signed policies (ADR-070)Rust ExtAuthzService gRPC server called by Envoy (STOA_EXT_AUTHZ_GRPC_ADDR)
MCP Protocol LayerIntegrated in stoa-gateway (Rust)Dedicated Rust MCP service behind Envoy
Control Plane APIPython 3.11, FastAPIPython 3.11, FastAPI
CLI & Link AgentGo 1.25 (stoactl, stoa-connect)Go 1.25 (stoactl, stoa-connect / STOA Link)
Kubernetes OperatorPython, Kopf (stoa-operator, Beta)Python, Kopf (stoa-operator)
FrontendReact 19, TypeScript, TailwindReact 19, TypeScript, Tailwind
DatabasePostgreSQL 15 / 16 (shared schema, tenant_id)PostgreSQL 15 / 16 (ADR-074)
Event BackboneRedpanda (Kafka API, internal only)Redpanda (ADR-005)
IdentityKeycloak 26 (single stoa realm, tenant groups)Keycloak 26 (ADR-074)
SecretsOpenBao 2.7.2 / Vault HTTP API (partial rollout)Full OpenBao / Vault HTTP API coverage (ADR-075)
ObservabilityPrometheus, Grafana, OpenSearch, Data Prepper, TempoOpenTelemetry-native metrics, logs, and traces

Security Zones​

ZoneTrust LevelComponents
ExternalUntrustedAPI Clients, AI Agents, Browser UIs
DMZSemi-trustedIngress Controller, stoa-gateway, Envoy + stoa-connect
InternalTrustedControl 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 stoa Keycloak realm, per-tenant groups, and verified tenant_id JWT 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)

Cookies and privacy

With your permission, we use cookies to measure visits and understand navigation to improve the site.

Learn more

Google Analytics measures visits and useful clicks. Microsoft Clarity provides masked interaction replays. No advertising use. Your choice is saved for six months. You can change or withdraw it at any time using the β€œCookies” button.

Read the audience measurement details