pub struct ProxyConfig {Show 15 fields
pub upstream: UpstreamConfig,
pub descriptors: Vec<DescriptorSource>,
pub listen: ListenConfig,
pub service: ServiceConfig,
pub aliases: Vec<AliasConfig>,
pub openapi: Option<OpenApiConfig>,
pub auth: Option<AuthConfig>,
pub shield: Option<ShieldConfig>,
pub oidc_discovery: Option<OidcDiscoveryConfig>,
pub maintenance: MaintenanceConfig,
pub cors: CorsConfig,
pub logging: LoggingConfig,
pub metrics_classes: Vec<MetricsClassConfig>,
pub forwarded_headers: Vec<String>,
pub streaming: StreamingConfig,
}Expand description
Top-level proxy configuration (loaded from YAML).
This and the wiring structs below (UpstreamConfig, ListenConfig,
ServiceConfig, DescriptorSource) are intentionally NOT
#[non_exhaustive]: embedding consumers build them programmatically with
runtime values. The leaf auth/shield/oidc config structs are
#[non_exhaustive] instead, since those are deserialized, not hand-built.
Fields§
§upstream: UpstreamConfigUpstream gRPC service(s).
descriptors: Vec<DescriptorSource>Proto descriptor sources.
listen: ListenConfigListen addresses.
service: ServiceConfigService identity (for health endpoint, metrics namespace).
aliases: Vec<AliasConfig>Path aliases (e.g., /oauth2/* → /v1/oauth2/*).
openapi: Option<OpenApiConfig>OpenAPI generation.
auth: Option<AuthConfig>Auth configuration (JWT, forward auth, AuthZ).
shield: Option<ShieldConfig>Rate limiting (Shield).
oidc_discovery: Option<OidcDiscoveryConfig>OIDC discovery (optional — for IdP proxies).
maintenance: MaintenanceConfigMaintenance mode.
cors: CorsConfigCORS configuration.
logging: LoggingConfigLogging.
metrics_classes: Vec<MetricsClassConfig>Metrics endpoint classification (path patterns → class labels).
forwarded_headers: Vec<String>Headers to forward from HTTP to gRPC metadata.
streaming: StreamingConfigServer-streaming response behavior.
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn from_yaml_str(yaml: &str) -> Result<Self>
pub fn from_yaml_str(yaml: &str) -> Result<Self>
Parse configuration from a YAML string.
Useful for embedding the proxy: load a baked-in config (e.g. via
include_str!) without touching the filesystem.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate cross-field constraints that the type system can’t express.
Called automatically by from_yaml_str; call it
directly when building a ProxyConfig programmatically so the same
invariants are enforced on the embedded path.
Sourcepub fn parse_rate(rate: &str) -> Option<u32>
pub fn parse_rate(rate: &str) -> Option<u32>
Parse rate string like “20/min” → requests per window.
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
Source§impl<'de> Deserialize<'de> for ProxyConfig
impl<'de> Deserialize<'de> for ProxyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnsafeUnpin for ProxyConfig
impl UnwindSafe for ProxyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request