pub struct TargetPolicy {
pub allowed: Vec<String>,
pub denied: Vec<String>,
pub block_private: bool,
}Expand description
Operator-defined domain allow/deny list applied to every outbound target
(extract URLs and each redirect hop). denied wins over allowed; an
empty allowed list permits any host. Matching is case-insensitive and
covers subdomains (e.g. example.com matches www.example.com).
Fields§
§allowed: Vec<String>Domains always allowed; empty permits any host.
denied: Vec<String>Domains always denied; denied wins over allowed.
block_private: boolRefuse private/loopback/link-local destinations (SSRF guard).
false is for intranet operators only; default true.
Implementations§
Source§impl TargetPolicy
impl TargetPolicy
Sourcepub fn from_security(sec: &SecurityConfig) -> Self
pub fn from_security(sec: &SecurityConfig) -> Self
Build from the operator’s security configuration section. These
lists were previously dead config; they are now enforced.
Sourcepub fn domain_allowed(&self, host: &str) -> bool
pub fn domain_allowed(&self, host: &str) -> bool
Whether an outbound target host passes the allow/deny policy.
Trait Implementations§
Source§impl Clone for TargetPolicy
impl Clone for TargetPolicy
Source§fn clone(&self) -> TargetPolicy
fn clone(&self) -> TargetPolicy
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 TargetPolicy
impl Debug for TargetPolicy
Auto Trait Implementations§
impl Freeze for TargetPolicy
impl RefUnwindSafe for TargetPolicy
impl Send for TargetPolicy
impl Sync for TargetPolicy
impl Unpin for TargetPolicy
impl UnsafeUnpin for TargetPolicy
impl UnwindSafe for TargetPolicy
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