pub struct RateLimitingSecurityConfig {Show 16 fields
pub enabled: bool,
pub requests_per_second: u32,
pub burst_size: u32,
pub auth_start_max_requests: u32,
pub auth_start_window_secs: u64,
pub auth_callback_max_requests: u32,
pub auth_callback_window_secs: u64,
pub auth_refresh_max_requests: u32,
pub auth_refresh_window_secs: u64,
pub auth_logout_max_requests: u32,
pub auth_logout_window_secs: u64,
pub failed_login_max_attempts: u32,
pub failed_login_lockout_secs: u64,
pub requests_per_second_per_user: Option<u32>,
pub redis_url: Option<String>,
pub trust_proxy_headers: bool,
}Expand description
Per-endpoint and global rate limiting configuration for [security.rate_limiting].
Fields§
§enabled: boolEnable rate limiting
requests_per_second: u32Global request rate cap (requests per second, per IP)
burst_size: u32Burst allowance above the steady-state rate
auth_start_max_requests: u32Auth initiation endpoint — max requests per window
auth_start_window_secs: u64Auth initiation window in seconds
auth_callback_max_requests: u32OAuth callback endpoint — max requests per window
auth_callback_window_secs: u64OAuth callback window in seconds
auth_refresh_max_requests: u32Token refresh endpoint — max requests per window
auth_refresh_window_secs: u64Token refresh window in seconds
auth_logout_max_requests: u32Logout endpoint — max requests per window
auth_logout_window_secs: u64Logout window in seconds
failed_login_max_attempts: u32Failed login attempts before lockout
failed_login_lockout_secs: u64Duration of failed-login lockout in seconds
requests_per_second_per_user: Option<u32>Per-authenticated-user request rate in requests/second.
Defaults to 10× requests_per_second if not set.
redis_url: Option<String>Redis URL for distributed rate limiting (optional — falls back to in-memory)
trust_proxy_headers: boolTrust X-Real-IP / X-Forwarded-For headers for client IP extraction.
Set to true only when FraiseQL is deployed behind a trusted reverse proxy
(e.g. nginx, Cloudflare, AWS ALB) that sets these headers.
Enabling without a trusted proxy allows clients to spoof their IP address.
Trait Implementations§
Source§impl Clone for RateLimitingSecurityConfig
impl Clone for RateLimitingSecurityConfig
Source§fn clone(&self) -> RateLimitingSecurityConfig
fn clone(&self) -> RateLimitingSecurityConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RateLimitingSecurityConfig
impl Debug for RateLimitingSecurityConfig
Source§impl Default for RateLimitingSecurityConfig
impl Default for RateLimitingSecurityConfig
Source§impl<'de> Deserialize<'de> for RateLimitingSecurityConfigwhere
RateLimitingSecurityConfig: Default,
impl<'de> Deserialize<'de> for RateLimitingSecurityConfigwhere
RateLimitingSecurityConfig: Default,
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 RateLimitingSecurityConfig
impl RefUnwindSafe for RateLimitingSecurityConfig
impl Send for RateLimitingSecurityConfig
impl Sync for RateLimitingSecurityConfig
impl Unpin for RateLimitingSecurityConfig
impl UnsafeUnpin for RateLimitingSecurityConfig
impl UnwindSafe for RateLimitingSecurityConfig
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 moreSource§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::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().