PHPackages                             aurabx/harmony-dsl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. aurabx/harmony-dsl

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

aurabx/harmony-dsl
==================

TOML Schema DSL definitions for Harmony Proxy configuration files

1.10.0(4mo ago)039MITRust

Since Nov 6Pushed 4mo agoCompare

[ Source](https://github.com/aurabx/harmony-dsl)[ Packagist](https://packagist.org/packages/aurabx/harmony-dsl)[ Docs](https://github.com/aurabx/harmony-dsl)[ RSS](/packages/aurabx-harmony-dsl/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (9)Used By (0)

Harmony Configuration Schema DSL
================================

[](#harmony-configuration-schema-dsl)

Installation
------------

[](#installation)

### PHP (Composer)

[](#php-composer)

Install via Composer:

```
composer require aurabx/harmony-dsl
```

### Rust (Cargo)

[](#rust-cargo)

Add to your `Cargo.toml`:

```
[dependencies]
harmony-dsl = "1.10"
```

Usage
-----

[](#usage)

### PHP

[](#php)

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);
```

### Rust

[](#rust)

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)?;
```

Quick Start
-----------

[](#quick-start)

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).

Files
-----

[](#files)

FilePurpose`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-remote-ingress-schema.toml`Schema for remote ingress catalogues shared between gateways`harmony-schema-guide.md`Implementation guide and API design implicationsWhat is the Schema DSL?
-----------------------

[](#what-is-the-schema-dsl)

The Schema DSL is a **declarative language written in TOML** that describes:

- Configuration file structure (tables, fields, types)
- Validation rules (required fields, enums, ranges)
- Default values and conditional requirements
- Documentation (descriptions for every element)

### Why Use a DSL?

[](#why-use-a-dsl)

1. **Single Source of Truth** - One schema definition used by both Rust and PHP
2. **Automatic Validation** - Catch config errors before deployment
3. **API Contract** - Defines what the Runbeam Cloud API needs to store/serve
4. **Code Generation** - Generate structs, DTOs, and templates from schemas
5. **Documentation** - Schema includes human-readable descriptions

Key Concepts
------------

[](#key-concepts)

### Config Hierarchy

[](#config-hierarchy)

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.)

```

### Pattern Matching

[](#pattern-matching)

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.

How This Guides API Design
--------------------------

[](#how-this-guides-api-design)

### Data Model

[](#data-model)

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

```

### Example Schema Definition

[](#example-schema-definition)

```
[[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:

- A required `[proxy]` table
- A required `id` field (string)
- An optional `log_level` field (string, defaults to "error", must be one of 5 values)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance76

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

8

Last Release

133d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/996e93220fb89bfaaa8bafad3ec296da3e6bb40acfcc2701fc8a7ed491848885?d=identicon)[xtfer](/maintainers/xtfer)

---

Top Contributors

[![xtfer](https://avatars.githubusercontent.com/u/40190?v=4)](https://github.com/xtfer "xtfer (43 commits)")

---

Tags

schemavalidationproxyDSLHarmonytoml

### Embed Badge

![Health badge](/badges/aurabx-harmony-dsl/health.svg)

```
[![Health](https://phpackages.com/badges/aurabx-harmony-dsl/health.svg)](https://phpackages.com/packages/aurabx-harmony-dsl)
```

###  Alternatives

[opis/json-schema

Json Schema Validator for PHP

64236.9M186](/packages/opis-json-schema)[romaricdrigon/metayaml

Using \[Yaml|Xml|json\] schemas files to validate \[Yaml|Xml|json\]

103306.5k8](/packages/romaricdrigon-metayaml)[evaisse/php-json-schema-generator

A JSON Schema Generator.

20298.5k1](/packages/evaisse-php-json-schema-generator)[romegasoftware/laravel-schema-generator

Generate TypeScript Zod validation schemas from Laravel validation rules

288.2k](/packages/romegasoftware-laravel-schema-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
