Skip to main content

featherbit/config/
mod.rs

1//! Configuration loading and schema types for the gateway's two YAML files:
2//! `system.yaml` (process-level settings: listener, timeouts, admin, logging)
3//! and `gateway.yaml` (routes and node-graph policies). All values support
4//! `${ENV_VAR:-default}` interpolation, resolved at different times by file:
5//! `system.yaml` is text-interpolated at load by [`load_yaml_with_env`];
6//! `gateway.yaml` is loaded **raw** by [`load_yaml`] — placeholders stay in
7//! the stored config (which the Admin API serves to the Web UI, so resolved
8//! secrets never leak there) and are resolved at the point of consumption:
9//! plugin node config at graph-compile time ([`interpolate_env_json`]), route
10//! match rules when the route table is built, consumer credentials when the
11//! consumer store is built.
12
13mod gateway;
14mod loader;
15mod resolve;
16mod system;
17mod warnings;
18
19pub use loader::{interpolate_env, interpolate_env_json, load_yaml, load_yaml_with_env};
20// featherbit is a binary crate, so `pub` exports nothing externally: re-exports
21// consumed only by `#[cfg(test)]` code read as unused in the bin build.
22#[allow(unused_imports)]
23pub use gateway::{
24    EdgeConfig, GatewayConfig, MatchRule, NodeConfig, PluginConfigDef, PolicyConfig, Position,
25    RouteConfig, StoreConfig, StoreTlsConfig, SupernodeConfig,
26};
27#[allow(unused_imports)]
28pub use resolve::resolve_plugin_configs;
29#[allow(unused_imports)]
30pub use system::{
31    normalize_domain, parse_duration, AcmeConfig, AcmeEabConfig, AcmeSlot, AcmeStorageConfig,
32    AdminConfig, ConfigSourceKind, DebugConfig, EtcdConfig, LoggingConfig, McpConfig, McpScope,
33    McpTokenConfig, SniCert, SniRoute, StreamListenerConfig, StreamProtocol, StreamUpstreamConfig,
34    SystemConfig, TimeoutConfig, TlsConfig, MCP_MIN_TOKEN_LEN,
35};
36pub use warnings::collect_template_warnings;