Skip to main content

NoETL Gateway

The NoETL Gateway is a Rust-based API gateway that provides authentication, authorization, GraphQL compatibility, and authenticated REST proxy access to the NoETL platform.

:::info Source Code For development documentation, local setup, and code details, see the Gateway Crate README. :::

Architecture​

┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Browser │────▶│ Cloudflare │────▶│ Gateway │────▶│ NoETL │
│ │ │ (Proxy) │ │ (GKE/K8s) │ │ Server │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
│ │ │ │
│ ▼ │ ▼
│ ┌────────────┐│ ┌─────────────┐
│ │ NATS K/V ││ │ PostgreSQL │
│ │ (sessions) ││ │ (auth) │
└───────────────────────────┴────────────┘│ └─────────────┘
(Authentication) │
┌────────┘
▼
┌─────────────┐
│ Auth0 │
│ (Identity) │
└─────────────┘

Session Caching with NATS K/V​

The Gateway uses NATS K/V as a fast session cache to avoid calling NoETL playbooks for every authenticated request:

Gateway Request → Check NATS K/V → Cache Hit? → Use cached session (sub-ms)
→ Cache Miss? → Call playbook → Refresh cache

Benefits:

  • Sub-millisecond session lookups from NATS K/V
  • Reduced load on NoETL server and PostgreSQL
  • PostgreSQL remains source of truth for session data
  • Automatic cache refresh via playbooks

Key Features​

  • Auth0 Integration: OAuth2/OIDC authentication via Auth0 Universal Login
  • Session Caching: Fast session lookups via NATS K/V cache
  • Session Management: Session tokens managed via NoETL playbooks (PostgreSQL source of truth)
  • GraphQL Compatibility: Authenticated executePlaybook and proxy helpers for clients that prefer GraphQL
  • REST Proxy: Canonical /noetl/* forwarding to NoETL server /api/*
  • CORS Support: Configurable cross-origin resource sharing
  • Stateless Design: No direct database connections

Agent and MCP Execution​

Gateway does not call MCP servers directly. It authenticates the client and forwards canonical execution requests to NoETL:

POST /noetl/execute
{
"path": "automation/agents/kubernetes/runtime",
"workload": {
"method": "tools/call",
"tool": "pods_list_in_namespace",
"arguments": { "namespace": "noetl" }
},
"resource_kind": "agent"
}

The NoETL server dispatches the playbook, the worker executes kind: mcp, and the resulting activity is tracked in NoETL execution state. This keeps GUI terminal commands, external API calls, and scheduled jobs on the same agent-as-playbook audit path.

Gateway's typed GraphQL executePlaybook mutation also accepts resourceKind; use agent for catalog entries registered as agent playbooks.

API Endpoints​

Public Endpoints​

EndpointMethodDescription
/healthGETHealth check
/api/auth/loginPOSTAuth0 token login
/api/auth/validatePOSTValidate session
/api/auth/check-accessPOSTCheck playbook permissions
/api/runtime/contractGETGateway route and execution contract

Protected Endpoints (Require Authentication)​

EndpointMethodDescription
/graphqlPOSTExecute playbooks via GraphQL
/graphqlGETGraphiQL playground
/noetl/{path}GET/POST/PUT/DELETE/PATCHProxy to NoETL server API

Real-time Callbacks (SSE)​

EndpointMethodDescription
/eventsGETSSE connection for real-time playbook results
/api/internal/callback/asyncPOSTWorker callback for async results
/api/internal/progressPOSTWorker progress updates

Documentation​

GuideDescription
Deployment GuideBuilding, deploying to GKE, static IP setup
Helm ReferenceComplete Helm chart configuration
Auth0 SetupAuth0 application and integration
Auth IntegrationAuth playbooks and session management
Async CallbacksSSE/WebSocket real-time playbook results
Cloudflare SetupDNS, SSL, caching configuration
API Usage GuideHow to authenticate and call playbooks

Quick Start​

Deploy to GKE​

noetl run automation/iap/gcp/deploy_gke_stack.yaml \
--set project_id=YOUR_PROJECT_ID \
--set deploy_gateway=true \
--set create_cluster=false \
--set deploy_noetl=false

Local Development​

# Run gateway locally
cd crates/gateway
cargo run

# Environment variables
export ROUTER_PORT=8090
export NOETL_BASE_URL=http://localhost:8082
export CORS_ALLOWED_ORIGINS=http://localhost:3000

Test with Port Forward​

# Port forward to deployed gateway
kubectl port-forward -n gateway svc/gateway 8091:80

# Test health
curl http://localhost:8091/health