| Crates.io | harmony-dsl |
| lib.rs | harmony-dsl |
| version | 1.9.0 |
| created_at | 2025-11-06 03:15:02.505285+00 |
| updated_at | 2025-12-07 04:38:02.288241+00 |
| description | TOML Schema DSL definitions for Harmony Proxy configuration files |
| homepage | https://github.com/aurabx/harmony-dsl |
| repository | https://github.com/aurabx/harmony-dsl |
| max_upload_size | |
| id | 1919010 |
| size | 47,856 |
Install via Composer:
composer require aurabx/harmony-dsl
Add to your Cargo.toml:
[dependencies]
harmony-dsl = "1.8"
The package provides TOML schema definitions as data files. Access them directly from your PHP application:
$configSchemaPath = __DIR__ . '/vendor/aurabx/harmony-dsl/harmony-config-schema.toml';
$pipelineSchemaPath = __DIR__ . '/vendor/aurabx/harmony-dsl/harmony-pipeline-schema.toml';
// Load and parse the schema files with your TOML parser
$configSchema = parse_toml_file($configSchemaPath);
$pipelineSchema = parse_toml_file($pipelineSchemaPath);
The schema files are embedded as string constants in the crate:
use harmony_dsl::{CONFIG_SCHEMA, PIPELINE_SCHEMA};
// Access the schema contents as &str
let config_schema = CONFIG_SCHEMA;
let pipeline_schema = PIPELINE_SCHEMA;
// Parse with your TOML parser
let config: toml::Value = toml::from_str(config_schema)?;
let pipeline: toml::Value = toml::from_str(pipeline_schema)?;
This directory contains the TOML Schema DSL definitions for Harmony Proxy configuration files. These schemas enable cross-language validation between Rust (harmony-proxy) and PHP (Runbeam Cloud API).
| File | Purpose |
|---|---|
dsl.md |
DSL specification and field reference |
harmony-config-schema.toml |
Schema for main config files (config.toml) |
harmony-pipeline-schema.toml |
Schema for pipeline files (pipelines/*.toml) |
harmony-schema-guide.md |
Implementation guide and API design implications |
The Schema DSL is a declarative language written in TOML that describes:
Harmony uses a two-level configuration system:
config.toml ← Main gateway config
├── [proxy] ← Core settings (ID, logging, paths)
├── [network.*] ← Network definitions (HTTP listeners, WireGuard)
├── [management] ← Management API config
├── [storage] ← Storage backend (filesystem, S3)
└── [services.*] ← Service type registry
pipelines/*.toml ← Pipeline configs (loaded from config.pipelines_path)
├── [pipelines.*] ← Pipeline routing definitions
├── [endpoints.*] ← Endpoint configs (how requests arrive)
├── [backends.*] ← Backend configs (where requests go)
└── [middleware.*] ← Middleware instances (transform, auth, etc.)
Tables with wildcard names match multiple instances:
# Schema: network.*
# Matches: [network.default], [network.management], [network.vpn]
This is crucial for dynamic configurations where users can define multiple networks, pipelines, endpoints, etc.
The schemas define what the Runbeam Cloud API needs to store in the database:
gateways
├── id
├── code
├── config_toml ← Validated against harmony-config-schema.toml
└── pipelines
├── name
└── config_toml ← Validated against harmony-pipeline-schema.toml
[[table]]
name = "proxy"
required = true
description = "Core proxy configuration"
[[table.field]]
name = "id"
type = "string"
required = true
description = "Unique gateway identifier"
[[table.field]]
name = "log_level"
type = "string"
required = false
default = "error"
enum = ["trace", "debug", "info", "warn", "error"]
description = "Logging verbosity"
This defines:
[proxy] tableid field (string)log_level field (string, defaults to "error", must be one of 5 values)