Harmony configuration is validated against a set of schemas defined in the harmony-dsl project. These schemas enforce structure, types, enums, and validation rules across all configuration files.
Configuration validation happens when Harmony loads TOML files. The schemas define:
- Structure: Which sections and fields are valid
- Types: Integer, string, boolean, array, table
- Constraints: Required fields, min/max values, pattern matching, enums
- Defaults: Default values when fields are omitted
- Relationships: How fields in one section relate to others
Schemas are defined in harmony-dsl and exported for use by:
- harmony-proxy (Rust): Runtime validation during startup and hot-reload
- runbeam (Laravel): Backend validation when receiving configuration from cloud API
- runbeam-sdk (Rust SDK): Shared type definitions
Defines the main gateway configuration file structure.
Location: projects/harmony-dsl/harmony-config-schema.toml
Main Tables:
| Table | Purpose | Pattern | Required |
|---|---|---|---|
proxy |
Core proxy settings (id, paths, limits) | Fixed | Yes |
provider.* |
Provider configurations for resource resolution | Pattern | No |
management |
Management API settings | Fixed | No |
network.* |
Network interface configurations | Pattern | No |
network.*.http |
HTTP/1.x and HTTP/2 listener settings | Nested | No |
network.*.http3 |
HTTP/3 (QUIC) listener settings | Nested | No |
logging |
File logging and log level configuration | Fixed | No |
runbeam |
[DEPRECATED] Legacy Runbeam Cloud settings | Fixed | No |
Proxy Table Fields:
id(string, required): Unique proxy identifierpipelines_path(string, default: "pipelines"): Directory for pipeline configstransforms_path(string, default: "transforms"): Directory for transform specsmesh_path(string, default: "mesh"): Directory for mesh configurationsjwks_cache_duration_hours(integer, default: 24, range: 1-168): JWKS cache durationrequired_env_vars(array of strings): Environment variables required at startupsensitive_field_patterns(array of strings): Field patterns to mask in logsprimary_provider(string, default: "runbeam"): Primary provider for cloud polling
Provider Pattern Fields:
Provider names must match ^[a-z0-9_-]+$.
api(string, required for remote providers): Base URL for provider APIpoll_interval_secs(integer, default: 30, range: 0-3600): Polling interval in seconds
Special case: The local provider is implicit and doesn't require [provider.local] section.
Content Limits Table:
All fields under [proxy.content_limits]:
max_body_size(integer, default: 10485760, min: 1024): Max request body in bytesmax_csv_rows(integer, default: 10000, min: 1): Max CSV rows to parsemax_xml_depth(integer, default: 100, range: 1-1000): Max XML nesting depthmax_multipart_files(integer, default: 10, min: 1): Max files per multipart requestmax_form_fields(integer, default: 1000, min: 1): Max form fields per request
Defines pipeline configuration file structures (endpoints, backends, middleware).
Location: projects/harmony-dsl/harmony-pipeline-schema.toml
Main Tables:
| Table | Purpose | Pattern | Required |
|---|---|---|---|
pipelines.* |
Pipeline definitions | Pattern | No |
pipelines.*.mesh.ingress.* |
Ingress definitions within pipelines | Nested Pattern | No |
pipelines.*.mesh.egress.* |
Egress definitions within pipelines | Nested Pattern | No |
endpoints.* |
Endpoint definitions | Pattern | No |
backends.* |
Backend definitions | Pattern | No |
middleware.* |
Middleware configurations | Pattern | No |
services.* |
Service type registrations | Pattern | No |
Pipeline Mesh Ingress Fields:
Nested at [pipelines.<name>.mesh.ingress.<name>]:
type(string, required, enum: "http", "http3"): Protocol typemode(string, default: "default", enum: "default", "mesh"): Request modeendpoint(string, optional): Optional endpoint override (defaults to first endpoint)urls(array of strings, required, min: 1): URLs that map to this ingressdescription(string, optional): Human-readable descriptionenabled(boolean, default: true): Whether ingress is active
Pipeline Mesh Egress Fields:
Nested at [pipelines.<name>.mesh.egress.<name>]:
type(string, required, enum: "http", "http3"): Protocol typemode(string, default: "default", enum: "default", "mesh"): Request modebackend(string, optional): Optional backend override (defaults to first backend)description(string, optional): Human-readable descriptionenabled(boolean, default: true): Whether egress is active
Defines mesh configuration file structures for inter-proxy communication.
Location: projects/harmony-dsl/harmony-mesh-schema.toml
Main Tables:
| Table | Purpose | Pattern | Required |
|---|---|---|---|
mesh.* |
Mesh definitions | Pattern | No |
Mesh Table Fields:
Mesh names must match ^[a-z0-9_-]+$.
id(string, optional): Unique identifier for this meshtype(string, required, enum: "http", "http3"): Protocol type for mesh communicationprovider(string, required, enum: "local", "runbeam"): Mesh providerauth_type(string, default: "jwt", enum: "jwt"): Authentication typejwt_secret(string, optional): HS256 shared secret for JWT signing/verificationjwt_private_key_path(string, optional): Path to RSA private key (PEM format)jwt_public_key_path(string, optional): Path to RSA public key (PEM format)jwks_url(string, optional): JWKS endpoint URL for Runbeam provideringress(array of strings, required, min: 1): Ingress referencesegress(array of strings, required, min: 1): Egress referencesdescription(string, optional): Human-readable descriptionenabled(boolean, default: true): Whether mesh is active
Ingress Reference Syntax:
Ingress array supports multiple formats:
- Bare name:
my_ingress→ resolves to local ingress - Explicit local:
local.name.my_ingress→ explicit local lookup - Provider ID:
runbeam.id.abc123→ provider-wide ID lookup - Full path:
runbeam.partner.ingress.name.api→ full provider reference
Defines remote ingress catalogue entries for mesh networking.
Location: projects/harmony-dsl/harmony-remote-ingress-schema.toml
Main Tables:
| Table | Purpose | Pattern | Required |
|---|---|---|---|
remote_ingress.* |
Remote ingress entries | Pattern | No |
Remote Ingress Fields:
urls(array of strings, required, min: 1): List of URLs served by remote ingress
When Harmony loads configuration:
- Parse TOML: Load and parse TOML files
- Validate Structure: Check against schema constraints
- All required fields present
- Field types match schema
- Enum values are valid
- Numeric constraints (min, max) are met
- Pattern constraints (
^[a-z0-9_-]+$) match
- Validate References: Verify cross-references are valid
- Ingress references valid endpoints (if specified)
- Egress references valid backends (if specified)
- Mesh ingress/egress arrays reference valid definitions
- Resolve Paths: Expand relative paths (pipelines_path, mesh_path, etc.)
- Hot-Reload: On file change, repeat validation before applying
Failed validation causes:
- Startup: Application fails to start with error details
- Hot-Reload: Configuration reverts to previous state, error logged
Each schema has a version field (e.g., version = "1.11.0"):
- Major: Breaking changes (e.g., required field added, enum removed)
- Minor: Backward-compatible additions (new optional fields)
- Patch: Documentation or constraint refinements
Current versions:
- harmony-config-schema: 1.11.0
- harmony-pipeline-schema: 1.11.0
- harmony-mesh-schema: 1.11.0
- harmony-remote-ingress-schema: 1.10.0
required: Must be present and non-emptyoptional: Can be omitted or emptyenum: Must be one of specified values (e.g.,["http", "http3"])pattern: Must match regex (e.g.,^[a-z0-9_-]+$)
required: Must be present and valid integeroptional: Can be omitted (uses default if specified)min/max: Value must be within range (inclusive)
required: Must be presentoptional: Can be omitted (uses default if specified)default: Value used if omitted
array_item_type: Type of array elements (string, integer, etc.)required: Array must be present and non-empty (usemin_items)min_items: Minimum number of items requiredmax_items: Maximum number of items allowed
pattern: Field name pattern for dynamic tables (e.g.,provider.*)pattern_constraint: Regex for field names in pattern tablesrequired_if: Conditional requirement (e.g.,enabled == true)
- Mesh Configuration - Comprehensive guide to mesh configuration
- Providers - Provider configuration and reference resolution
- Resource References - Reference syntax guide
- Configuration - Main configuration documentation
- Schema source files:
projects/harmony-dsl/harmony-*-schema.toml - Harmony-DSL README:
projects/harmony-dsl/README.md - Config loading:
projects/harmony-proxy/src/config/config.rs