pub struct Config {Show 16 fields
pub bind: SocketAddr,
pub grpc_bind: Option<SocketAddr>,
pub upstream: String,
pub index: String,
pub tokens: Vec<(String, String)>,
pub require_tls_for_mutation: bool,
pub tls: Option<TlsConfig>,
pub observability: ObservabilityConfig,
pub admin_passthrough: Option<AdminPassthroughConfig>,
pub cursor_affinity_key: Option<String>,
pub passthrough: Option<PassthroughConfig>,
pub header_forwarding: HeaderForwardingConfig,
pub capture: Option<CaptureConfig>,
pub capture_default: bool,
pub fanout: Option<FanoutConfig>,
pub etcd: Option<EtcdConfig>,
}Expand description
The fully validated configuration the binary serves from. Every field is a ready-to-use value object; no further parsing or fallbacks happen downstream.
Fields§
§bind: SocketAddrThe HTTP ingress bind address.
grpc_bind: Option<SocketAddr>The optional gRPC ingress bind address (off when None).
upstream: StringThe upstream OpenSearch base URL for the single configured cluster.
index: StringThe shared physical index the reference tenancy writes into.
tokens: Vec<(String, String)>The token -> principal auth map; empty means permissive dev mode.
require_tls_for_mutation: boolWhether a body-mutating request is refused over cleartext (NFR-S1). True
(enforce) unless allow_cleartext_mutation opts out.
tls: Option<TlsConfig>TLS termination settings, or None for cleartext ingress.
observability: ObservabilityConfigObservability + control-plane settings.
admin_passthrough: Option<AdminPassthroughConfig>Admin (_cat/_cluster/_nodes) pass-through policy, or None to reject.
cursor_affinity_key: Option<String>The shared HMAC key enabling scroll/PIT cursor affinity, or None (off).
passthrough: Option<PassthroughConfig>Tenant-agnostic passthrough policy, or None = pure tenancy mode (the
default). Used for a transparent proxy or to pass selected (e.g. not-yet-
onboarded) indices through verbatim while tenant-isolating the rest.
header_forwarding: HeaderForwardingConfigWhich client headers the proxy relays to the upstream when it forwards a request (the verbatim passthrough/admin/cursor paths). Pass-all by default (sidecar trust), minus the mandatory hop-by-hop/framing set.
capture: Option<CaptureConfig>Full-fidelity traffic capture to a Kafka topic, or None (off). Requires
the binary be built with the capture feature; a configured capture
on a binary without it is a loud startup error rather than a silent no-op.
capture_default: boolWhether capture is on for every request before any directive (default
false). false = capture on demand: nothing is teed until a published
capture directive selects requests. true = always-capture (a dedicated
capture/migration proxy). Independent of the sink: it only decides when
to capture; the sink still needs the capture feature + config.
fanout: Option<FanoutConfig>Async fan-out write queue (docs/04 §9), or None (off). Requires the
fanout feature; a configured fan-out on a binary without it is a
loud startup error rather than a silent no-op.
etcd: Option<EtcdConfig>etcd-backed distributed directive store (docs/05 §3), or None to use
the in-memory store + admin publish endpoint. Requires the etcd feature;
a configured etcd on a binary without it is a loud startup error.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load<I: IntoIterator<Item = String>>(
args: I,
) -> Result<Self, ConfigError>
pub fn load<I: IntoIterator<Item = String>>( args: I, ) -> Result<Self, ConfigError>
Loads and validates configuration from the process environment plus
args (CLI flags without the program name). A --config <path> flag, or
the OSPROXY_CONFIG env var, names a config file read as the lowest layer.
§Errors
Returns a ConfigError if a file/flag is malformed, a key is unknown, or
any value fails validation, before any socket is opened.
Sourcepub fn resolve_for_test(pairs: &[(&str, &str)]) -> Result<Self, ConfigError>
pub fn resolve_for_test(pairs: &[(&str, &str)]) -> Result<Self, ConfigError>
Test-only: resolve a Config directly from an in-memory (key, value)
list (canonical keys), skipping the file/env/flag layering. Lets tests and
doc examples exercise validation without touching the process environment.
§Errors
Returns a ConfigError if any value fails validation.