#[non_exhaustive]pub enum SsrfReason {
NonHttps,
IpLiteral,
InvalidUrl,
Loopback,
Private,
Imds,
MulticastOrReserved,
CrossAuthority,
}Expand description
Stable, machine-readable reason an SSRF check rejected a target.
Surfaced by the SsrfPolicy::classify_url / SsrfPolicy::classify_ip
/ SsrfPolicy::classify_redirect family so callers can react
programmatically — and so language bindings can map a rejection to a
typed exception — instead of string-matching the free-form detail
message. Maps to RFC-ACDP-0006 §7 / RFC-ACDP-0008 §4.8.
#[non_exhaustive]: future spec revisions may add ranges; match with a
wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NonHttps
URL scheme is not https (and allow_http is off).
IpLiteral
URL embeds an IP literal; a hostname (forcing DNS) is required.
InvalidUrl
URL could not be parsed, has no host, or has an invalid hostname.
Loopback
Loopback range — IPv4 127.0.0.0/8 or IPv6 ::1.
Private
Private range — RFC 1918 (10/8, 172.16/12, 192.168/16),
CGNAT 100.64/10, or IPv6 ULA fc00::/7.
Imds
Link-local / cloud instance-metadata reach — IPv4 169.254.0.0/16
(incl. 169.254.169.254), IPv6 fe80::/10, and the NAT64
well-known prefix 64:ff9b::/96 (which can translate to IMDS).
MulticastOrReserved
Multicast or otherwise reserved/unusable range (0.0.0.0/8,
192.0.0.0/24, 198.18.0.0/15, 224.0.0.0/4, 240.0.0.0/4,
IPv6 multicast / unspecified).
CrossAuthority
A redirect target whose scheme, host, or effective port differs from the originating request’s authority (RFC-ACDP-0006 §7.5).
Implementations§
Trait Implementations§
Source§impl Clone for SsrfReason
impl Clone for SsrfReason
Source§fn clone(&self) -> SsrfReason
fn clone(&self) -> SsrfReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SsrfReason
Source§impl Debug for SsrfReason
impl Debug for SsrfReason
Source§impl Display for SsrfReason
impl Display for SsrfReason
impl Eq for SsrfReason
Source§impl PartialEq for SsrfReason
impl PartialEq for SsrfReason
Source§fn eq(&self, other: &SsrfReason) -> bool
fn eq(&self, other: &SsrfReason) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SsrfReason
Auto Trait Implementations§
impl Freeze for SsrfReason
impl RefUnwindSafe for SsrfReason
impl Send for SsrfReason
impl Sync for SsrfReason
impl Unpin for SsrfReason
impl UnsafeUnpin for SsrfReason
impl UnwindSafe for SsrfReason
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.