pub struct SecurityConfig {
pub allowed_origins: Vec<String>,
pub max_body_size: usize,
pub request_timeout: Duration,
pub expose_error_details: bool,
}Expand description
Security configuration for the ADK server.
Fields§
§allowed_origins: Vec<String>Allowed origins for CORS (empty = allow all, which is NOT recommended for production)
max_body_size: usizeMaximum request body size in bytes (default: 10MB)
request_timeout: DurationRequest timeout duration (default: 30 seconds)
expose_error_details: boolWhether to include detailed error messages in responses (default: false for production)
Implementations§
Source§impl SecurityConfig
impl SecurityConfig
Sourcepub fn development() -> Self
pub fn development() -> Self
Create a development configuration (permissive CORS, detailed errors)
Sourcepub fn production(allowed_origins: Vec<String>) -> Self
pub fn production(allowed_origins: Vec<String>) -> Self
Create a production configuration with specific allowed origins
Trait Implementations§
Source§impl Clone for SecurityConfig
impl Clone for SecurityConfig
Source§fn clone(&self) -> SecurityConfig
fn clone(&self) -> SecurityConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecurityConfig
impl Debug for SecurityConfig
Auto Trait Implementations§
impl Freeze for SecurityConfig
impl RefUnwindSafe for SecurityConfig
impl Send for SecurityConfig
impl Sync for SecurityConfig
impl Unpin for SecurityConfig
impl UnwindSafe for SecurityConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)