1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! IP Access Control System
//!
//! A decoupled IP-based access control system for the gateway.
//!
//! # Features
//!
//! - **IP Allowlist**: Only allow requests from specific IPs
//! - **IP Blocklist**: Block requests from specific IPs
//! - **CIDR Support**: Support for IP ranges using CIDR notation
//! - **Middleware**: Actix-web middleware for request filtering
//! - **Dynamic Updates**: Update rules at runtime
//!
//! # Architecture
//!
//! The IP access control system follows these principles:
//! - **Decoupled**: Independent of other security systems
//! - **Performant**: Efficient IP matching using prefix trees
//! - **Flexible**: Support for both allowlist and blocklist modes
//! - **Configurable**: Fine-grained control over behavior
//!
//! # Quick Start
//!
//! ```rust,ignore
//! use litellm_rs::core::ip_access::{IpAccessControl, IpAccessConfig, IpAccessMode};
//!
//! let config = IpAccessConfig::default()
//! .with_mode(IpAccessMode::Allowlist)
//! .allow_ip("192.168.1.0/24")
//! .allow_ip("10.0.0.1");
//!
//! let access_control = IpAccessControl::new(config)?;
//!
//! // Check if an IP is allowed
//! if access_control.is_allowed("192.168.1.100") {
//! println!("Access granted");
//! }
//! ```
// Re-export main types
pub use IpAccessConfig;
pub use IpAccessControl;
pub use ;
pub use ;