pub struct GuardedClientConfig {
pub trusted_hosts: Vec<String>,
pub allow_loopback: bool,
pub max_redirects: usize,
pub timeout: Option<Duration>,
pub connect_timeout: Duration,
pub user_agent: Option<String>,
}Expand description
Bounds applied to every request a guarded client makes.
trusted_hosts mirrors the SYSTEMPROMPT_TRUSTED_HTTP_HOSTS allowance the
parse-time guard honours: a host named there keeps working even when it
resolves inside a blocked range, which is what lets an operator point the
platform at an internal service on purpose. allow_loopback covers
localhost for local development; literal loopback addresses never reach
the resolver and are governed by the parse-time guard alone.
Fields§
§trusted_hosts: Vec<String>§allow_loopback: bool§max_redirects: usize§timeout: Option<Duration>§connect_timeout: Duration§user_agent: Option<String>Implementations§
Source§impl GuardedClientConfig
impl GuardedClientConfig
pub const fn with_timeout(self, timeout: Duration) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub const fn with_max_redirects(self, max_redirects: usize) -> Self
pub fn with_trusted_hosts(self, trusted_hosts: Vec<String>) -> Self
pub const fn deny_loopback(self) -> Self
Trait Implementations§
Source§impl Clone for GuardedClientConfig
impl Clone for GuardedClientConfig
Source§fn clone(&self) -> GuardedClientConfig
fn clone(&self) -> GuardedClientConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GuardedClientConfig
impl Debug for GuardedClientConfig
Auto Trait Implementations§
impl Freeze for GuardedClientConfig
impl RefUnwindSafe for GuardedClientConfig
impl Send for GuardedClientConfig
impl Sync for GuardedClientConfig
impl Unpin for GuardedClientConfig
impl UnsafeUnpin for GuardedClientConfig
impl UnwindSafe for GuardedClientConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
Converts
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> ⓘ
Converts
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