#[non_exhaustive]pub struct GatewayConfig {Show 18 fields
pub port: u16,
pub grpc_port: u16,
pub max_connections: usize,
pub request_timeout: DurationStr,
pub cors_enabled: bool,
pub cors_origins: Vec<String>,
pub quiet_paths: Vec<String>,
pub max_body_size: SizeStr,
pub max_json_body_size: SizeStr,
pub max_file_size: SizeStr,
pub tls: TlsConfig,
pub max_multipart_fields: usize,
pub security_headers: bool,
pub hsts: bool,
pub trusted_proxies: Vec<String>,
pub max_jobs_per_request: usize,
pub max_result_size_bytes: usize,
pub max_json_depth: usize,
}Expand description
Gateway configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.port: u16HTTP port.
grpc_port: u16gRPC port for inter-node communication (reserved for future use).
This port is registered in the cluster node info but a gRPC listener is not yet started. It will be used for efficient binary inter-node RPC in a future release.
max_connections: usizeMaximum concurrent connections.
request_timeout: DurationStrRequest timeout duration (e.g. “30s”, “1m”).
cors_enabled: boolEnable CORS handling.
cors_origins: Vec<String>Allowed CORS origins.
quiet_paths: Vec<String>Routes excluded from request logs, metrics, and traces.
Defaults to ["/_api/health", "/_api/ready"]. Set to [] to monitor everything.
max_body_size: SizeStrMaximum request body size for multipart uploads (e.g. “100mb”, “1gb”). Defaults to “20mb”.
max_json_body_size: SizeStrMaximum JSON request body size for RPC endpoints (e.g. “1mb”, “5mb”). Defaults to “1mb”.
max_file_size: SizeStrDefault per-file cap for multipart uploads (e.g. “10mb”, “200mb”).
Applies when a mutation does not declare its own max_size. Set to
the same value as max_body_size to disable the per-file guard.
Defaults to “10mb”.
tls: TlsConfigTLS configuration for the gateway listener.
max_multipart_fields: usizeMaximum file fields in a single multipart upload.
security_headers: boolAdd standard security headers (X-Content-Type-Options, X-Frame-Options) to all responses.
hsts: boolEnable HTTP Strict Transport Security header. Off by default since local development uses plain HTTP.
trusted_proxies: Vec<String>IP ranges of trusted reverse proxies (e.g. ["10.0.0.0/8", "172.16.0.0/12"]).
When set, X-Forwarded-For is only trusted if the connecting peer IP
matches one of these ranges. When empty (default), the peer socket IP
is always used and forwarding headers are ignored.
max_jobs_per_request: usizeMaximum number of background jobs a single mutation request may dispatch. Prevents a single mutation from enqueuing an unbounded number of jobs and exhausting the job table. Defaults to 10.
max_result_size_bytes: usizeMaximum serialized response size in bytes. Responses exceeding this limit are rejected before being written to the wire. Defaults to 10 MiB.
max_json_depth: usizeMaximum JSON nesting depth for incoming request bodies. Requests with deeper nesting are rejected before deserialization to prevent stack exhaustion. Defaults to 64.
Trait Implementations§
Source§impl Clone for GatewayConfig
impl Clone for GatewayConfig
Source§fn clone(&self) -> GatewayConfig
fn clone(&self) -> GatewayConfig
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 GatewayConfig
impl Debug for GatewayConfig
Source§impl Default for GatewayConfig
impl Default for GatewayConfig
Source§impl<'de> Deserialize<'de> for GatewayConfig
impl<'de> Deserialize<'de> for GatewayConfig
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 GatewayConfig
impl RefUnwindSafe for GatewayConfig
impl Send for GatewayConfig
impl Sync for GatewayConfig
impl Unpin for GatewayConfig
impl UnsafeUnpin for GatewayConfig
impl UnwindSafe for GatewayConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more