Skip to content

Concepts and taxonomy ​

This page is the vocabulary of Dwara: the named concepts an operator works with, how they classify, and how they relate. Read it once to orient yourself; every other guide assumes these terms. For the exhaustive field list, see the configuration schema; for how a request flows through these concepts, see the architecture overview.

The three axes ​

Every Dwara deployment is described along three independent axes. Keep them separate in your head and most configuration questions answer themselves:

  1. Edition — which features exist at all. One codebase ships two editions: OSS (the default, Apache-2.0) and Enterprise (built with the ent cargo feature, activated by a signed license). Enterprise features are the ones that span multiple gateway instances or need external infrastructure. See Editions.
  2. Capability — which optional surfaces are active in this build. There are no compile-time feature packs: the only cargo features are ent (Enterprise), the test-only loom, and the optional cel-jit accelerator. Advanced surfaces (the proxy-wasm host and native filter chain, CEL, Cedar/OPA, aggregation, OpenAPI response validation, the MCP admin server, ...) compile into every build; the ones whose dispatch or config wiring has not landed yet are scaffolded. See scaffolded surfaces.
  3. Config — what this particular gateway does. A single strict YAML file declares the routing chain, identity, policy, and observability. This page is mostly about this axis.

A feature that is Enterprise-only is inert-but-accepted in an OSS build (it parses and validates, then is ignored). A scaffolded surface is accepted too — where a config block exists it parses and validates, but nothing executes it yet. The two look identical in the config and differ only in behavior — know which axis you are on.

The core routing chain ​

Traffic flows through a fixed chain of named entities, each referencing the next by name:

EntityWhat it isOwns
ListenerA bind address + port (+ optional TLS). The front door.TLS material, protocol (http/https/h2/h2c/tcp/udp), listener-scoped policy and authorization
RouteA match rule + an action. Decides what to do with a request that reached a listener.Path/host/method/header/query/cookie matching, the action, and route-level blocks (CORS, transforms, limits, ...)
ServiceA named target grouping one or more upstreams. The unit a route points at.The upstream (or a weighted split across upstreams), sticky sessions, service-scoped policy
UpstreamA pool of endpoints with shared resilience settings.Endpoints, load-balancing strategy, health checks, circuit breaker, retries, timeouts, connection caps
EndpointA single address:port backend.Nothing — it is the leaf

A request resolves to at most one route; that route names one service; that service names one upstream (or a split across several); that upstream picks one endpoint per attempt. Names are unique within their kind and referenced by string — there is no nesting. See Routing and Configuration.

Route actions ​

A route's action decides where the response comes from:

  • proxy — forward to the service/upstream (with an optional path rewrite). The common case.
  • redirect — answer a 3xx with a constructed Location, no upstream.
  • respond — answer directly with a status/body/headers, no upstream (synthetic health checks, deprecation notices).
  • mock — serve a canned response without contacting any upstream, with an optional artificial delay (contract tests, demos).
  • ai — translate and forward to an AI provider through the AI adapter pack (requires the ai config block; see AI gateway).
  • nano_service — run a WASM module to generate the response directly, no upstream (see Nano-services).

Route-level blocks ​

These are not policy attachments — each is a single optional block on the route itself: cors, compression, limits, transforms, masking, security_headers, cache, maintenance, deprecation, waf, graphql, websocket, plugins, request_validation, fault_injection, mirror, slo, oidc_login, grpc_web, translation (protocol translation), openapi (response validation), filter_chain (phase overrides). Each has its own guide; see the sidebar under Routing and request handling.

Identity and access ​

Consumers and credentials ​

A consumer is a named caller of your gateway — an application, a team, an agent. A consumer carries:

  • credentials — the secret(s) it authenticates with (API key, Basic, JWT, mTLS cert, HMAC signing key). See Secrets for the ${...} reference form that keeps secret bytes out of config files.
  • groups — group memberships used by authorization rules.
  • type — the principal kind: user (default) or agent. Agent consumers get AI-specific controls (token budgets, MCP tool allowlists).
  • priority — a 0-10 load-shedding priority class.
  • quotas — daily/monthly request budgets over the durable state store. See Quotas.
  • policies / authorization — consumer-scoped policy and authz (the most-specific precedence level).

Credentials and consumers are separate so one consumer can hold several credential families, and one credential format (e.g. one JWKS) can map to many consumers.

Authentication methods ​

How a consumer proves identity. Each is a credential family:

MethodWhat it checksGuide
API keya shared secret in a header/querySecurity
HTTP BasicRFC 7617 username/passwordSecurity
JWT (JWKS)a Bearer token verified against a JWKS endpointSecurity
mTLS client certa verified client certificate mapped to a consumermTLS
HMAC request signingper-request HMAC-SHA256 signatureHMAC signing
OIDCBearer introspection (RFC 7662) or browser login + PKCEOpenID Connect

The gateway can also act as an OAuth2 client-credentials client toward an upstream — that is upstream authn, not consumer authn.

Authorization ​

Authorization is the what may this caller do layer, evaluated after authentication. It is a five-level precedence chain, most-specific first, deny-anywhere-wins:

consumer > route > service > listener > global

Each level can carry allow/deny rules over consumers, groups, JWT scopes/claims, IP ACLs, and GeoIP gates. A dry_run flag turns any level into monitor-only. External policy engines (Cedar, OPA) plug in at the same levels when the cedar capability is compiled in. See Authorization rules, Cedar authz, and OPA authz.

Policy ​

A policy is a named, reusable bundle of traffic-control rules. Policies are declared once at the top level and attached by name at one or more scopes. All applicable levels' rules AND together.

A policy bundle can contain any combination of:

FieldControlsGuide
rate_limitsstacked GCRA rate-limit rules (windows)Traffic policy
timeoutsrequest/connect/read timeoutsTraffic policy
adaptiveEWMA-driven rate-limit tuning from upstream error ratesTraffic policy
anomalystatistical anomaly scoring of abusive requestsTraffic policy
token_budgetAI token budget (per-minute / per-day caps)AI token budgets
dry_runmonitor mode for the bundle's rate-limit rulesTraffic policy

Attachment scopes ​

Policies attach at five scopes, matching the authorization precedence chain: global (global_policies), listener, service, route, and consumer. Consumer-level always wins; deny-anywhere- wins across the chain. See the request pipeline for where each stage runs.

Resilience ​

Resilience settings live on the upstream (they describe how to talk to a pool of endpoints), not on policies:

SettingWhat it doesGuide
retriesbounded per-request retry attempts with exponential backoffTraffic policy
timeoutsper-attempt and overall timeout budgetsTraffic policy
breakerper-upstream circuit breaker (opens the whole pool)Traffic policy
healthpassive health / outlier detection (eject bad endpoints)Operations
active_healthsynthetic HTTP/TCP probes per endpointOperations
connection_cap / max_pendingoutbound connection and queue limits (default 256 each)Operations
slow_start_msramp-up window for newly-added endpointsOperations
load_balancerstrategy: round-robin, least-connections, peak-EWMA, ...Routing

Gateway-wide resilience that is not per-upstream: max_concurrent_ requests (a concurrency cap with 503 load shedding), admission queues (bounded queueing under pressure), and request hedging (fire a duplicate after a latency threshold). See Admission queues and Request hedging.

AI gateway ​

When the top-level ai block is present, routes may use the ai action and a separate taxonomy applies. See AI gateway for the overview.

EntityWhat it is
ProviderAn upstream that carries AI traffic (OpenAI, Anthropic, Gemini, OpenAI-compatible). Named in ai.providers[] and referenced by models.
Model aliasThe model value a client sends; maps to a provider + provider-side model id. Supports failover, canary splits, A/B tests, and routing policies.
Credential poolA set of API keys for one provider with rotation + 429 quarantine (Enterprise).
Routing policyA named strategy for choosing among model targets: FallbackChain (cheap-first escalation) or LatencyCost (static config-based selection).
Token budgetPer-consumer or per-policy cap on provider-reported tokens (per-minute / per-day).
GuardrailsPrompt-injection / PII / banned-content / schema enforcement, prompt + response phases.
GovernancePer-team model allowlists with shadow audit.
Prompt loggingOpt-in, redacted, sampled prompt/response capture with retention.
Semantic cacheEmbedding-similarity cache (HNSW ANN + external embedding service; compiled into the OSS build).
ExperimentsPrompt versioning, A/B model comparison, regression evals, feedback ingestion.
MCP gatewayModel Context Protocol server/router: tool routing to upstreams, session management, auth.
A2AAgent-to-agent protocol support with Agent Card parsing.

Observability and analytics ​

ConceptWhat it isGuide
Access logsStructured JSON logs with request IDsObservability
MetricsPrometheus /metrics on every listenerObservability
TracingOptional OTLP trace + metrics export (capability)OTel metrics export
Analytics storeEmbedded SQLite: raw access records + rollups + retentionAnalytics
Analytics streamNDJSON firehose of every completed request to an external sinkAnalytics stream
WebhooksAlert/event envelopes for state changes (breaker, ejection, config)Alert webhooks
Synthetic monitoringActive probes that feed health and SLO metricsSynthetic monitoring
Replay debuggingRecord routing decisions per request, replay them offline against a new configReplay debugging

Extensibility ​

Three plugin families, unified under one dispatch chain:

FamilyWhat it isGuide
Proxy-WasmThe proxy-wasm host: community Kong/Envoy filters run unmodified (capability wasm)Proxy-Wasm plugins
Native pluginsA Rust filter trait compiled into the binary (capability plugins)Native plugins
Nano-servicesWASM route handlers — a route action that runs a WASM module to generate the responseNano-services

Plugins are declared at the top level and referenced by name from routes' plugins field. See Plugin lifecycle.

State and lifecycle ​

ConceptWhat it is
SnapshotThe immutable, compiled view of config the gateway serves from. Swapped atomically behind an ArcSwap.
GenerationA monotonic id assigned to each successful publish. Visible via GET /config and the config_generation metric.
Config pipelineparse -> validate -> compile -> publish. Every config source (file, SIGHUP, admin API, controller stream) runs the same pipeline. A failure at any stage never replaces the running snapshot.
Hot reloadDebounced file-watch or SIGHUP triggers the pipeline; in-flight requests keep their original generation.
State storeOptional embedded SQLite holding durable identity state: consumers, credentials, quota counters.
Admin listenerOptional mTLS-only management surface: GET/PATCH /config, /health, /stats.

See Operations and Hot reload.

Enterprise fleet concepts ​

These only exist in the Enterprise edition and concern coordinating many gateways:

ConceptWhat it isGuide
Control plane (dwara-controller)Leader-elected; compiles config generations and pushes them to edges over gRPCCP/DP split
Data plane (dwara-edge)A gateway instance fed by the controller; caches the last generationCP/DP split
Config convergenceFleet-wide consistent config state, backed by RedisConfig convergence
Redis backendShared GCRA buckets, distributed cache, convergence stateRedis rate limiter
WorkspaceA multi-tenant boundary with its own config, RBAC, and auditWorkspaces
Federated analyticsEdge-to-controller analytics aggregation over gRPCEnterprise
Service meshSidecar mode with SPIFFE/SPIRE mTLS identity (capability mesh)Service mesh

Where to go next ​