pub struct IpRestriction {
pub allowed_cidrs: Option<Vec<String>>,
}Expand description
IpRestriction : IPRestriction defines IP-based access controls for an API key. When allowed_cidrs is non-empty, only requests from IPs matching at least one CIDR range are permitted. Empty allowed_cidrs means no IP restriction (all IPs allowed). IP restrictions apply to root API key and imported key verification only; derived tokens (JWT/macaroon) are stateless and not subject to IP checks.
Fields§
§allowed_cidrs: Option<Vec<String>>allowed_cidrs is a list of CIDR ranges that are allowed to use this key. Supports both IPv4 (e.g., "10.0.0.0/8") and IPv6 (e.g., "2001:db8::/32"). If empty, all IPs are allowed (no restriction).
Implementations§
Source§impl IpRestriction
impl IpRestriction
Sourcepub fn new() -> IpRestriction
pub fn new() -> IpRestriction
IPRestriction defines IP-based access controls for an API key. When allowed_cidrs is non-empty, only requests from IPs matching at least one CIDR range are permitted. Empty allowed_cidrs means no IP restriction (all IPs allowed). IP restrictions apply to root API key and imported key verification only; derived tokens (JWT/macaroon) are stateless and not subject to IP checks.
Trait Implementations§
Source§impl Clone for IpRestriction
impl Clone for IpRestriction
Source§fn clone(&self) -> IpRestriction
fn clone(&self) -> IpRestriction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IpRestriction
impl Debug for IpRestriction
Source§impl Default for IpRestriction
impl Default for IpRestriction
Source§fn default() -> IpRestriction
fn default() -> IpRestriction
Source§impl<'de> Deserialize<'de> for IpRestriction
impl<'de> Deserialize<'de> for IpRestriction
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>,
Source§impl PartialEq for IpRestriction
impl PartialEq for IpRestriction
Source§fn eq(&self, other: &IpRestriction) -> bool
fn eq(&self, other: &IpRestriction) -> bool
self and other values to be equal, and is used by ==.