Expand description
Configuration schema v1 for the gateway (frozen domain vocabulary).
The types in this module model the source form of a dwara configuration file. Compilation into a runtime snapshot is a later concern (config-compile pipeline); here we define strict, self-describing types:
- every struct rejects unknown fields (
deny_unknown_fields), - field order follows declaration order on serialization,
- the root type
Gatewayexports a JSON Schema viaschemars.
YAML <-> typed conversions are provided by parse_gateway (YAML text to
typed value, with path-precise error messages) and gateway_to_yaml
(typed value back to normalized YAML text). Round-trip guarantee:
parse_gateway(gateway_to_yaml(cfg)) always succeeds and yields a value
that serializes to the identical normalized text (stable normalization,
not byte-identity with the original input).
Submodules carry the parts of the config CONTRACT that are more than
serde shapes: credentials defines the credential selector/stored-hash
formats every credential holder must agree on plus the ${...}
secret-reference grammar (DW-045), limits the numeric
bounds validation enforces, net the trusted-proxy IP/CIDR
grammar shared by validation and the runtime matchers,
versioning the HTTP-date and media-type grammar of the API
versioning aids (DW-048), and transforms the JSON-pointer
grammar and shapes of the request/response transforms and
security-header injection (DW-028). cache carries the
route-scoped response-caching grammar (DW-037), and ai the
AI provider/model grammar of the provider-adapter pack (DW-075).
Modules§
- ai
- The
ai:configuration block (DW-075): AI provider adapters. - cache
- Route-scoped response caching grammar (DW-037, feature analysis 5-Protocol “Response caching”): the config shape of a route’s cache policy and the compiled form the dataplane’s response cache consumes.
- credentials
- Credential hashing: the selector and stored-hash formats of the credential schema contract (DW-018/DW-019, peppered per #124).
- includes
- Config includes and file-based profiles (CFG-01, #180).
- limits
- Schema-validation limits: numeric bounds the config compiler enforces and runtime code must respect.
- mesh
- Service mesh config schema (DW-107).
- net
- Minimal IP/CIDR support for trusted-proxy and IP-ACL matching (DW-009/DW-020).
- quotas
- Pure quota types shared by the state-store and Redis-backed quota implementations (DW-033, DW-155).
- ssrf
- SSRF egress filter (SEC-13).
- transforms
- Request/response transformation grammar (DW-028): the config shapes for header/query manipulation and JSON-pointer body transforms, the shared JSON-Pointer grammar validation and the runtime agree on, and the security-header injection policy (feature analysis 4.12 and the 5-Security “security header injection” row).
- versioning
- API-versioning grammar (DW-048): the two shared vocabularies the
versioning aids need beyond serde shapes — HTTP-dates (RFC 9110
IMF-fixdate) and media types (RFC 9110
type/subtypetokens).
Structs§
- Acme
Config - SEC-02: ACME (Let’s Encrypt) certificate automation configuration. The gateway acts as an ACME client: orders certificates for the configured domains, completes the challenge (HTTP-01 or TLS-ALPN-01), and installs the issued certificates into the hot-reloadable TLS termination/SNI resolver. Renewal runs automatically before expiry.
- Active
Health - Active health check knobs (DW-013). A block with no keys enables HTTP probes with the defaults.
- Adaptive
Rate Limit - Adaptive + origin-driven rate-limit tuning (DW-089,
policies[].adaptive): an EWMA of upstream error rate and latency dynamically scales this policy’s rate-limit quotas at check time (the factor multiplies the effective cost of each request against the GCRA bucket), and upstream-originated signals trigger an immediate backoff. The factor is bounded[min_factor, max_factor](never 0, never unbounded); tightening under stress is faster than relaxing when healthy (asymmetric, so the gateway errs toward protecting upstreams).origin_signalsselects which upstream response signals the controller honors (currentlyretry_after). - Admin
ApiToken - One hashed API token with a role.
- Admin
ApiTokens Config - SEC-01: API token authentication for the admin API. Tokens are
hashed (SHA-256) at rest; the config lists token hashes, not
plaintext tokens. A client presents a token via
Authorization: Bearer <token>. - Admin
Audit Config - SEC-01: Admin audit log configuration.
- Admin
Config - Admin listener configuration (DW-022).
- Admin
Rbac Binding - One certificate-fingerprint-to-role binding.
- Admin
Rbac Config - SEC-01: Admin RBAC configuration. Maps client certificate fingerprints to roles. A valid certificate with no binding is denied (fail-closed).
- Admin
TlsConfig - mTLS material for the admin listener (DW-022). Unlike dataplane
listeners there is no mode: the admin listener always terminates TLS
and always requires a client certificate chaining to
client_ca_file. - Admission
Queue - Bounded admission queue config (DW-053,
gateway.admission_queue). - Agent
Principal - AI-16 (#204): First-class agent principal metadata. Attached to a
Consumerwithconsumer_type: agentto carry agent-specific attribution and permission data. - Analytics
Config - The embedded analytics store config (DW-043,
gateway.analytics). - Analytics
Dimension - One custom analytics dimension (DW-043,
analytics.dimensions[]). - Analytics
Exports - Scheduled usage-report exports (DW-120,
analytics.exports). - Analytics
Insights - ML traffic insights config (DW-092,
analytics.insights). - Analytics
Live Sketches - Live in-process sketches config (DW-092,
analytics.live_sketches). - Analytics
Replay Capture - Replay time-travel debugging capture config (DW-102,
analytics.replay_capture). Opt-in capture of request detail (redacted headers, auth identity) into the raw analytics table for offline replay against candidate configs. The capture reuses the existing fire-and-forget analytics writer path and the existing PII redaction patterns (ai::redaction); body capture is OFF by default (PII risk). - Analytics
Retention - Per-granularity retention (DW-043,
analytics.retention). - Analytics
Sampled Degradation - Sampled degradation config (REL-10, #221). See
AnalyticsConfig::sampled_degradation. - Analytics
Stream Config - Real-time access-record stream (DW-121,
gateway.analytics_stream). - Analytics
Stream Kafka - The Kafka batch sink (SCALE-08, #187,
gateway.analytics_stream.sink.kafka). Produces each flushed batch as NDJSON messages to a Kafka topic via a Kafka REST Proxy (HTTP-based, no native client dependency). The REST Proxy endpoint receives the batch as an HTTP POST with theContent-Type: application/vnd.kafka.binary.v2+jsonmedia type; each NDJSON line becomes a Kafka message value (base64 encoded per the REST Proxy spec). TLS is viahttps://; SASL auth is via headers (e.g.Authorization: Basic ...). - Analytics
Stream Webhook - The webhook batch sink (DW-121,
gateway.analytics_stream.sink.webhook). Same URL/header/retry grammar asgateway.webhooks[](DW-044) — the delivery engine is shared — minus theeventsfilter (a record stream has no kinds to filter: every record goes to the sink). - Anomaly
Policy - Anomaly scoring policy (DW-090,
policies[].anomaly): lightweight statistical detection of abusive request patterns. Each enabled signal produces a normalized [0, 1] score from the request shape (header entropy, header count/bytes, path length/depth, query count, body size, unusual method); the overall score is the average of the configured signals’ scores. A score at or abovethresholdis blocked (403anomaly_blocked) unlessdry_runis set. - Authz
- Route-level authorization rules (DW-020, feature analysis 4.7).
- Body
Schema - A minimal JSON-Schema subset (DW-047) for request-body validation.
- Breaker
Config - Per-upstream circuit breaker knobs (DW-015). All fields default; a
breaker:block with no keys enables the breaker with the defaults. - Canary
Analysis - Auto-canary analysis (DW-091): metrics-driven promotion/rollback of canary split weights. A background controller compares the canary side against the baseline on error rate or latency; on regression it rolls the canary weight back (toward 0), on success it promotes (toward the total weight). Severe regression (>2x the rollback threshold) triggers an immediate rollback to 0. The total weight stays constant: when the canary weight changes, the baseline absorbs the difference, preserving the hash distribution for existing sessions (the DW-040 invariant). Weight changes are TRANSIENT (a Generation swap) and revert on config reload.
- Canary
Rule - One canary analysis rule (DW-091): a metric to compare and the threshold that triggers the rule.
- CertPin
- A single certificate pin: the SHA-256 hash of the upstream certificate’s SubjectPublicKeyInfo (SPKI), as lowercase hex (64 chars). Pinning the SPKI (rather than the full certificate) allows rotation of the leaf certificate as long as the key pair is unchanged.
- Cert
Pinning Config - DW-109 / SEC-04: certificate pinning configuration for an upstream. Holds a list of allowed SPKI SHA-256 hashes (lowercase hex, 64 chars). A peer cert whose SPKI hash matches ANY entry is accepted; otherwise the connection is rejected (fail-closed).
- Compiled
Content Type Filter - Snapshot-compiled form of a compression policy’s content-type prefix
lists (DW-027): every include/exclude entry trimmed and lowercased
once at snapshot-compile time; the request path compares the
response’s (lowercased) media type against the precomputed prefixes
instead of re-normalizing config strings per response. Same
placement rationale as
CompiledCorsOrigins. - Compiled
Cors Origins - Snapshot-compiled form of a
cors.allowed_originslist (DW-027): the wildcard flag plus the normalized form of every specific entry, computed once at snapshot-compile time so the request path never re-parses config strings (per-request work is the request’s own origin only). Lives inconfigbesidenormalize_originbecause the compiled set is the grammar’s runtime consumer:snapshotbuilds it into the route table (snapshot::RouteTable) anddataplane::corsmatches against it. Validation has already rejected entries that do not normalize, so compilation drops nothing on any publishable config; entries that would fail normalization are skipped exactly as the pre-compiled matcher was. - Compiled
Deprecation - Snapshot-compiled form of a
Deprecationblock (DW-048): the emitted header VALUES, precomputed at snapshot-compile time — the HTTP-date strings are parsed once here (never per response) and the RFC 9745 structured date is rendered from the parsed seconds. Lives inconfigbesideCompiledCorsOriginsfor the same reason:snapshotbuilds it into the route table anddataplane::versioningconsumes it. Validation has already rejected unparseable dates, so compilation drops nothing on any publishable config; entries that would fail are skipped exactly like the CORS matcher’s fallback. - Compression
- Route-scoped response compression policy (DW-027, feature analysis 4.13).
- Config
Convergence Config - Config convergence config (DW-054,
gateway.config_convergence). - Config
Error - Error produced when a configuration document fails to parse.
- Consumer
- Identity of an API caller (app/team/user); owns credentials, quotas, and the analytics identity.
- Consumer
Quotas - Per-consumer request budgets (DW-033): daily and/or monthly request caps in fixed UTC calendar windows, counted by the state store’s quota counters. At least one budget must be set and every set budget must be > 0 (validation); a budget of 0 would deny the consumer’s first request and is expressed by omitting the field instead.
- Cors
- Route-scoped CORS policy (DW-027, feature analysis 4.14).
- CrsRule
- SEC-08 (#212): A single OWASP CRS-compatible WAF rule. Each rule has a numeric ID (CRS convention: 9xxxx), a severity level, a phase (1 = request headers, 2 = request body), a list of tags, a regex pattern, and the inspection targets to apply the pattern to. Rules are evaluated in order; matching rules add their severity to the request’s anomaly score. The request is blocked when the score exceeds the configured threshold.
- Deprecation
- Route-level API deprecation policy (DW-048): automates the RFC deprecation signal headers on every response of the route.
- DnsDiscovery
- DNS-based dynamic upstream discovery (DW-042): when present on an
upstream, a background discovery task resolves
hostnamevia DNS, watches the record TTL, and re-resolves when the TTL expires (or atrefresh_interval_s, whichever comes first), updating the upstream’s endpoint set live — without a restart. Theendpointsfield becomes the INITIAL/fallback set: used until the first resolution completes and as a fallback when DNS fails andfail_openis true. When absent, endpoints remain static (the current behavior — no change). - Endpoint
- One
address:portinside an upstream. - Fault
Abort - Abort fault injection (DW-062): short-circuit the request with a configured HTTP status, sampled by percentage.
- Fault
Delay - Delay fault injection (DW-062): inject a fixed delay before forwarding the request, sampled by percentage.
- Fault
Injection - Fault injection configuration (DW-062,
routes[].fault_injection). Percentage-based delays and aborts for chaos testing. A delay injects a fixed latency before the request is forwarded; an abort short-circuits with a configured status without contacting the upstream. Both may be present simultaneously — the abort is evaluated first, and if it does not fire, the delay is applied. - Filter
Chain Config - SCALE-12 (#191): per-phase dry-run configuration. When dry-run is enabled for a phase, the phase executes its checks but does NOT enforce (reject/block). Failures are logged as warnings and the request continues. This enables safe policy rollout: enable a phase in dry-run mode, observe the would-be rejections, then switch to enforcement.
- Fleet
Config - Fleet operations config (DW-098,
gateway.fleet). - Fleet
Upgrade Config - Rolling-upgrade and version-skew policy (DW-098,
gateway.fleet.upgrade). - Fleet
Upgrade Order Entry - A label-selector entry in the upgrade order list.
- Gateway
- Root of a dwara configuration: one gateway process, N listeners, and one compiled config generation.
- Geoip
Config - The GeoIP database config (DW-050,
gateway.geoip). One MaxMind- format database serves both country and ASN predicates (a GeoLite2-Country, GeoLite2-ASN, or combined database — whichever subtrees it carries are the ones the rules can use). The file is opened at startup (a failed open is LOUD but non-fatal: the gateway serves with geo lookups resolving UNKNOWN) and hot-reloaded: the watcher swaps the reader when the file changes, with no restart. - Geoip
Rules - GeoIP allow/deny rules on the effective client IP (DW-050,
authorization.geoip). Countries are ISO 3166-1 alpha-2 codes (case-insensitive in config, compared uppercase); ASNs are plain numbers. Evaluation mirrorsallowed_consumers/denied_consumers: a denied match rejects (403) regardless of the allow lists; a NON-EMPTY allow list admits only matches; empty allow lists constrain nothing. The UNKNOWN case (unresolvable address, no database) matches neither side. - Global
Waf - SEC-08 (#212): Global WAF policy with CRS-compatible rules. When enabled, the rules are evaluated on every request (regardless of route-level WAF config). The anomaly score is accumulated across all matching rules; the request is blocked when the score exceeds the threshold. Rule exclusions can disable specific rules by ID or tag. The paranoia level controls which rules are active (1 = default, 2 = more aggressive, 3 = paranoid, 4 = very paranoid).
- Graphql
Federation - Federation passthrough config (DP-11, #256,
routes[].graphql.federation). - Graphql
Persisted Queries - Persisted-query enforcement config (DW-099,
routes[].graphql.persisted_queries). - Graphql
Translation - REST <-> GraphQL translation config (DW-100,
routes[].translation.graphql). - GrpcWeb
- Route-scoped gRPC-Web policy (DW-101,
routes[].grpc_web). - Grpc
WebDescriptor - A .proto descriptor file entry (DW-101,
routes[].grpc_web.transcoding.descriptors[]). - Grpc
WebTranscoding - gRPC-Web JSON transcoding configuration (DW-101,
routes[].grpc_web.transcoding). - Hedge
Config - Request hedging configuration (DW-063,
upstreams[].retries.hedge). - Hmac
Auth - Gateway-wide HMAC request-signing policy (DW-036). The credential
itself (key id + secret) lives on a consumer
(
credentials: [{type: hmac, ...}]); this block carries the VERIFICATION policy that applies to every signed request. - Http2
Listener Config - HTTP/2 flow-control tuning for a listener (PERF-11, #244,
listeners[].http2). Every field is optional; an omitted field keeps the process-wide default fromDWARA_H2_*env vars. This allows per-listener tuning for streaming (SSE) workloads where larger windows reduce flow-control stalls on long-lived streams. - IpAcl
- IP access control on the effective client IP (DW-020, feature
analysis 4.15). Entries are IP addresses (e.g.
10.1.2.3) or CIDRs (e.g.10.0.0.0/8); anything else fails config validation (the same parser asgateway.trusted_proxies). Evaluation order: thedenylist first (a match rejects with 403 regardless of the allow list), then theallowlist, thendefaultfor IPs matched by neither. - JwtProvider
- One JWT verification provider (DW-019).
- L4Config
- L4 proxying configuration for a
tcporudplistener (DW-103). - License
Config - Enterprise license configuration (DW-032,
gateway.license). - Lifecycle
Config - API lifecycle management config (DW-110,
gateway.lifecycle). - Lifecycle
Journey Config - Journey recorder config (DW-110,
gateway.lifecycle.journey). - Lifecycle
Portal Config - Developer portal config (DW-110,
gateway.lifecycle.portal). - Lifecycle
Portal Spec - One OpenAPI spec source for the developer portal (DW-110,
gateway.lifecycle.portal.specs[]). - Lifecycle
Profiles Config - Environment profile overlays config (DW-110,
gateway.lifecycle.profiles). - Listener
- Entry point: bind address + port + TLS termination (or passthrough) config.
- Listener
Tls - TLS handling for a listener: terminate at the edge or pass through.
- Locality
Context - DW-094 (Ent): the edge’s locality context — its region and zone.
Threaded into the balancer at request time to enable locality-aware
endpoint selection. When both
regionandzoneareNone, the balancer skips locality filtering (the OSS behavior). - Maintenance
- Route maintenance mode (DW-041): a per-route availability state that short-circuits every matched request with a gateway-generated 503.
- Mirror
Config - Shadow traffic mirroring configuration (DW-062,
routes[].mirror). Fire-and-forget duplicate requests to a named mirror upstream; the mirror response is discarded and never impacts the primary request’s latency. A percentage controls sampling. - Mock
Action - A canned response served without any upstream contact (DW-047,
routes[].action.mock). The body comes from eitherbody(an inline string) orbody_file(a path relative to the config file directory); exactly one of the two may be set, or neither for an empty body.delay_mssimulates latency (useful for testing timeouts and retries against a mock). Validation rejects a status outside 100..=599, adelay_msabove 30000, and setting bothbodyandbody_file. - Mtls
Consumer Mapping - mTLS client-certificate consumer mapping (DW-035,
gateway.mtls_consumer_mapping). - Mtls
Fingerprint Mapping - One fingerprint-to-consumer mapping entry (DW-035,
mtls_consumer_mapping.consumers[]). - Mtls
Forward Headers - Identity-forwarding headers for mTLS client auth (DW-035,
gateway.mtls_forward_headers). - Name
Value Match - One query-parameter or cookie criterion: the parameter/cookie must be
present; when
valueis given it must equal that exact string. - Nano
Service Action - A WASM route handler (nano-service) action (DW-106,
routes[].actionwithtype: nano_service). The gateway loads the named WASM module, calls itshandleexport with the serialized request (method, path, headers, body), and returns the response the module produces (status, headers, body). No upstream is contacted. - OAuth2
Client Credentials - OAuth2 client-credentials configuration for an upstream (DW-035,
upstreams[].oauth2_client_credentials). - OAuth2
Mtls - mTLS client certificate for an OAuth2 token endpoint (DW-035,
oauth2_client_credentials.mtls). - Oidc
Login Config - SEC-05: OIDC browser login flow configuration for a route. The gateway redirects unauthenticated browser requests to the IdP, exchanges the authorization code for tokens, sets a session cookie, and validates the cookie on subsequent requests.
- Oidc
Provider - One OIDC provider (DW-034): an OpenID Connect issuer whose Bearer
tokens are validated by token introspection (RFC 7662) rather than
local JWT signature verification. The gateway fetches the issuer’s
discovery document (
{issuer}/.well-known/openid-configuration) to learn the introspection, revocation, authorization, and token endpoints, then introspects presented Bearer tokens (caching the result keyed by token hash with a configurable TTL). The provider also backs the authorization-code + PKCE relying-party flow, token exchange (RFC 8693), and token revocation (RFC 7009). - Open
ApiMeta - OpenAPI import metadata attached to a route (DW-047). No runtime effect; purely for traceability from the generated config back to the source spec operation.
- Passive
Health - Passive health / outlier detection knobs (DW-012). All fields default;
a
health:block with no keys enables ejection with the defaults. - Path
Match - How a route’s path pattern is interpreted.
- Peak
Ewma Config - Peak-EWMA load-balancing tuning (DW-090,
upstreams[].peak_ewma). Only consulted whenload_balancer: peak_ewma; ignored otherwise. - Plugin
Config - A plugin definition (DW-055 / DW-119). Each plugin is either a
proxy-wasm
.wasmmodule loaded at startup (wasm) or a compiled-in native Rust filter (native), run on the request pipeline phases it declares. Routes reference plugins by name. Exactly one ofwasmornativemust be set (validation enforces this). - Plugin
Limits Config - Resource limits for a proxy-wasm plugin (DW-055 decision 4; §9.3).
- Plugin
Registry Config - SCALE-12 (#192)/DW-165: plugin registry configuration. When
present, signatures of
source:-referenced artifacts are verified against the registry’s pinned public keys and resolved artifacts are cached in the registry’s cache directory. This enables fleet-consistent plugin pinning: all gateways in a fleet reference the same registry and get the same signed artifacts. - Plugin
Source Config - SCALE-12 (#192)/DW-165: remote/signed plugin source configuration.
The gateway resolves the .wasm artifact at every publish: cache
lookup first, then a download from
urlon a miss, then SHA-256digestverification (mandatory) and Ed25519signatureverification (when configured) — only then is the artifact loaded. Resolution failures are fail-closed per plugin (Crashed at publish, its routes answer 500), never a partial load. - Policy
- Named reusable rule bundle (rate limit, timeouts, …); attachable at several scopes. Plugin-backed phases arrive with the M3 plugin system.
- Rate
Limit - Local GCRA-style rate limit.
- Rate
Limit Rule - One rate-limit rule (DW-017): a key selector plus one or more stacked
windows.
selectornames the request attributes that form the counter key (all listed attributes are joined into ONE key, so[ip, route]limits each (client IP, route) pair independently);requests_percarries the sustained rates per window (at least one window must be present);burstis the bucket size (defaults to the window’s request count). - Rate
Requests Per - Sustained rates per window (DW-017). At least one field must be set and every set field must be > 0; each set field becomes one stacked GCRA cell (a request must satisfy ALL set windows).
- Redis
Cache Config - Distributed Redis-backed response cache config (SCALE-04, #183,
gateway.redis_cache, ent feature). - Redis
HaConfig - Redis HA and multi-region config (SCALE-11, #248). Embedded in each Redis-backed config block (rate limiter, quotas, cache) to control the connection topology and per-request timeout.
- Redis
Quota Config - Distributed Redis-backed consumer request quotas config (DW-155,
gateway.redis_quotas). - Redis
Rate Limiter Config - Distributed Redis-backed GCRA rate limiter config (DW-031,
gateway.redis_rate_limiter). - Request
Limits - Route-scoped request size limits (DW-027, feature analysis 4.16).
- Request
Validation - Route-scoped request-body validation (DW-047,
routes[].request_validation). - Retry
Config - Upstream retry knobs (DW-014). All fields default; a
retries:block with no keys is equivalent to retries off (attemptsdefaults to 0). - Route
- Match rules (path/host/method/header) plus action and attached policies.
- Route
Graphql - Route-scoped GraphQL awareness config (DW-099,
routes[].graphql). - Route
Match - Matching rules for incoming requests.
- Route
Slo - Per-route SLO objectives (DW-052,
routes[].slo). - Route
Waf - Route-scoped WAF-lite config (DW-051,
routes[].waf). - Route
Websocket - Route-scoped WebSocket policy (DW-039,
routes[].websocket). - Service
- The logical API being exposed: base path, version, default policies; targets exactly one upstream, or a weighted split of upstreams since DW-040 (canary / blue-green).
- Service
Split - Weighted traffic split across upstreams (DW-040,
services[].split): canary releases and blue-green switches at the SERVICE level — each target is a full upstream (its own endpoints, protocol, health, and balancer), so a canary pool is isolated from the stable one by construction. The pick is a deterministic weighted hash (seeService::split): ratios hold statistically per request and exactly per session when sticky affinity is on. - SniRoute
- One SNI-to-upstream routing rule for TLS passthrough.
- Soap
Translation - SOAP/XML translation config (DW-100,
routes[].translation.soap). - Split
Target - One weighted target of a service split (DW-040).
- Sticky
Affinity - Cookie affinity for a service (DW-040,
services[].sticky). - Timeouts
- Timeout hints, in milliseconds.
- TlsCertificate
- One SNI-scoped certificate pair for TLS termination.
- Token
Budget - An AI token budget (DW-078,
policies[].token_budget): limits of TOTALS over windows — provider-reported tokens per minute and/or cost per UTC calendar day, enforced per consumer or shared per policy (team). See theai::budgetmodule docs for the check-then-spend contract. - Translation
- Route-scoped protocol translation policy (DW-100,
routes[].translation). - Upstream
- Load-balancing pool: algorithm, protocol, endpoints.
- Upstream
Locality - DW-094 (Ent): locality-aware routing and data residency configuration
for an upstream. Controls how the balancer uses endpoint
region/zonefields to filter or prefer endpoints. - Upstream
Mtls - SEC-03: upstream mTLS client certificate configuration. Reuses the
two-path shape (cert file + key file) proven by the OAuth2 mTLS
config (
OAuth2Mtls). - Upstream
Pool Config - DP-03: hyper connection-pool and HTTP/2 tuning for an upstream
(
upstreams[].pool). Every field is optional; an omitted field keeps hyper-util’s built-in default (the same value the gateway used before this block existed), so the block is purely additive. Validation rejects zero/negative-forbidden values; the runtime clamps nothing beyond the documented bounds. - Webhook
- One alert/event webhook target (DW-044,
gateway.webhooks[]). Compiled per generation into anevents::webhook::WebhookTarget(secret references resolved at compile time, URL decomposed); see that module for the delivery contract.
Enums§
- Acme
Challenge - ACME challenge type.
- Additional
Properties - The
additionalPropertieskeyword accepts either a boolean or a nested schema; this union models both. - Admin
Role - Admin roles.
- Agent
Permission Level - AI-16 (#204): Agent permission levels for first-class agent
principals. Mirrors the
Permissionenum in the MCP module but lives in config for declarative assignment. - AiEndpoint
- AI-02: which AI endpoint a route serves. The
chatendpoint (the default) uses the full adapter translation pipeline (DW-075). The other endpoints are proxied as a passthrough: the request body is forwarded to the provider’s upstream as-is, and the response is returned as-is. Model governance (allowlist check) still applies using themodelfield from the request body. - AiIngress
Dialect - AI-05 (#195): The client-facing request dialect for an AI route. Determines how the gateway parses the incoming request body.
- Analytics
Export Format - One export output format (DW-120,
analytics.exports.formats[]). Closed set:csv,json,parquet_csv. - Analytics
Export Window - One export schedule kind (DW-120,
analytics.exports.window). Closed set; fixed UTC calendar windows. - Analytics
Stream Sink - The access-record stream’s sink (DW-121,
gateway.analytics_stream.sink). Closed set, internally tagged (type: webhookortype: kafka):webhookships today;kafka(SCALE-08, #187) produces NDJSON batches to a Kafka topic via a Kafka REST Proxy (HTTP-based, no native client dependency). The variant payloads carry their owndeny_unknown_fields, so a misspelled knob inside a sink is still a rejected config. - Anomaly
Signal - One anomaly signal (DW-090). Each produces a normalized [0, 1] sub-score from one request-shape dimension.
- Canary
Metric - The metric a canary rule compares (DW-091).
- Compression
Algorithm - One response compression algorithm (DW-027).
- Consumer
Type - The principal kind of a consumer (DW-113):
user(the default — a human or application calling the gateway) oragent(a bot principal with bot credentials, per-agent quotas/token budgets, tool allowlists, and a session audit trail). Agent traffic is identifiable, governable, and billable; the type threads through Identity into analytics for typed attribution. - Credential
- One authenticator bound to a consumer: API key, JWT issuer/audience binding, mTLS client-certificate match, or HMAC signing key (DW-036).
- Dimension
Source - The source of a custom analytics dimension value (DW-093). The
default (when
sourceis absent) isDimensionSource::Header, preserving the original DW-043 header-only config shape. - Filter
Phase - SCALE-12 (#191): formalized request-pipeline filter phases. The
default order is the order the variants are declared (the same
order the dataplane has always executed them). Per-route
filter_chainoverrides can reorder a subset of these phases; phases not listed in an override keep their default relative order. - HashOn
- What to hash for consistent-hash load balancers (
ip_hashandmaglev). DP-07 (#236): extends the hash key source beyond the client IP to support cookie-based sticky sessions and header-based affinity. - IpAcl
Default - Fallback decision of an
IpAclfor IPs matched by neither list. - Listener
Protocol - Load
Balancer - Locality
Mode - DW-094 (Ent): locality routing mode.
- Origin
Signal - One upstream-originated signal the adaptive controller honors (DW-089).
- Path
Match Kind - Path
Rewrite - Path rewrite applied before proxying (DW-010). Exactly one variant per proxy action; there is no rewrite chaining in v1. All variants operate on the path component only — the inbound query string is re-attached untouched.
- Plugin
Phase - The phases a plugin can hook (DW-055, §9.3 phase contract).
- Probe
Kind - Kind of active health probe.
- Rate
Limit Selector - One attribute of a rate-limit key (DW-017).
- Redis
Topology - Redis deployment topology (SCALE-11, #248). Controls how the
gateway connects to Redis for the distributed rate limiter,
quotas, and shared cache. The default
singlemode uses one Redis URL (the existing behavior).sentinelmode resolves the master through a Sentinel deployment.clustermode connects to a Redis Cluster. - Route
Action - What the gateway does when a route matches.
- TlsMode
- Token
Budget Scope - The budget’s key scope (DW-078).
- Translation
Kind - The protocol translation direction (DW-100,
routes[].translation.kind). - Upstream
Protocol - Version
Skew Policy Config - The version-skew policy, mirroring the CP/DP
cluster_sync::VersionSkewPolicybut living in the config schema (so the gateway config carries it, not just the controller runtime). - Zero
RttPolicy - 0-RTT (early data) acceptance policy for HTTP/3 (DW-088).
Constants§
- ANALYTICS_
DEFAULT_ RETENTION_ MS - Default per-granularity retention (ms), indexed [raw, 1m, 5m, 1h,
1d] — a week of traffic at every granularity a week query wants,
bounded disk at the 1-minute grain (DW-043). Lives in
config(the lowest consuming domain) so both validation and the analytics store read ONE definition. - CURRENT_
CONFIG_ VERSION - CFG-03 (#239): the current config schema version. Increment when
the schema gains a breaking change (removed fields, renamed
fields, changed semantics). The
dwara lintcommand warns when a config’sversionis older than this;dwara migrateupgrades configs to this version. - DEFAULT_
HMAC_ CLOCK_ SKEW_ SECS - Default
hmac_auth.max_clock_skew_secs(±5 minutes, DW-036 §4.6). - DEFAULT_
MAINTENANCE_ RETRY_ AFTER_ SECS - Default
maintenance.retry_after_secs(DW-041). - DEFAULT_
STREAM_ BATCH_ MAX - Default
analytics_stream.batch_max(DW-121): records per flushed batch. - DEFAULT_
STREAM_ BUFFER - Default
analytics_stream.buffer(DW-121): the bounded record channel’s capacity when the block is absent at boot (the stream is always constructed so a live reload can arm it). Lives inconfigwith the retention defaults — the lowest consuming domain — so validation docs, the stream, and the binary read one definition. - DEFAULT_
STREAM_ FLUSH_ MS - Default
analytics_stream.flush_ms(DW-121): maximum batch latency. - DEFAULT_
STREAM_ WEBHOOK_ ATTEMPTS - Default
analytics_stream.sink.webhook.max_attempts(DW-121). - DEFAULT_
STREAM_ WEBHOOK_ BACKOFF_ BASE_ MS - Default
analytics_stream.sink.webhook.backoff_base_ms(DW-121). - DEFAULT_
STREAM_ WEBHOOK_ BACKOFF_ CAP_ MS - Default
analytics_stream.sink.webhook.backoff_cap_ms(DW-121). - DEFAULT_
STREAM_ WEBHOOK_ TIMEOUT_ MS - Default
analytics_stream.sink.webhook.timeout_ms(DW-121): a batch carries up tobatch_maxrecords, so its budget starts heavier than the alert webhook’s 2000 but stays far under the one-minute ceiling. - DEFAULT_
WEBHOOK_ ATTEMPTS - Default
gateway.webhooks[].max_attempts(DW-044). - DEFAULT_
WEBHOOK_ BACKOFF_ BASE_ MS - Default
gateway.webhooks[].backoff_base_ms(DW-044). - DEFAULT_
WEBHOOK_ BACKOFF_ CAP_ MS - Default
gateway.webhooks[].backoff_cap_ms(DW-044). - DEFAULT_
WEBHOOK_ TIMEOUT_ MS - Default
gateway.webhooks[].timeout_ms(DW-044): one shared delivery budget, generous for a remote alerting endpoint, small enough that a hung target cannot pile up deliveries.
Functions§
- gateway_
to_ yaml - Serialize a
Gatewayto normalized YAML text. - json_
schema - Build the JSON Schema for the root
Gatewaytype. - normalize_
origin - Canonical form of one origin (DW-027): lowercase scheme and host,
default port dropped, no userinfo, no path/query — the exact string
the runtime CORS matcher compares request
Originvalues against and validation checks config entries with.Nonewhen the input is not a well-formedhttp(s)origin. Lives inconfig(the lowest consuming domain) so validation (snapshot::validate) and matching (dataplane::cors) share one grammar, the same waynet.rsowns the IP/CIDR grammar. - parse_
gateway - Parse a YAML configuration document into a
Gateway, rejecting invalid input with path-precise error messages.