@push.rocks/smartproxy 17.0.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -213,8 +213,8 @@ export class RouteManager extends plugins.EventEmitter {
213
213
  }
214
214
 
215
215
  // Check blocked IPs first
216
- if (security.blockedIps && security.blockedIps.length > 0) {
217
- for (const pattern of security.blockedIps) {
216
+ if (security.ipBlockList && security.ipBlockList.length > 0) {
217
+ for (const pattern of security.ipBlockList) {
218
218
  if (this.matchIpPattern(pattern, clientIp)) {
219
219
  return false; // IP is blocked
220
220
  }
@@ -222,8 +222,8 @@ export class RouteManager extends plugins.EventEmitter {
222
222
  }
223
223
 
224
224
  // If there are allowed IPs, check them
225
- if (security.allowedIps && security.allowedIps.length > 0) {
226
- for (const pattern of security.allowedIps) {
225
+ if (security.ipAllowList && security.ipAllowList.length > 0) {
226
+ for (const pattern of security.ipAllowList) {
227
227
  if (this.matchIpPattern(pattern, clientIp)) {
228
228
  return true; // IP is allowed
229
229
  }
@@ -63,16 +63,15 @@ export class SecurityManager {
63
63
  }
64
64
 
65
65
  /**
66
- * Check if an IP is authorized using forwarding security rules
66
+ * Check if an IP is authorized using security rules
67
67
  *
68
68
  * This method is used to determine if an IP is allowed to connect, based on security
69
- * rules configured in the forwarding configuration. The allowed and blocked IPs are
70
- * typically derived from domain.forwarding.security.allowedIps and blockedIps through
71
- * DomainConfigManager.getEffectiveIPRules().
69
+ * rules configured in the route configuration. The allowed and blocked IPs are
70
+ * typically derived from route.security.ipAllowList and ipBlockList.
72
71
  *
73
72
  * @param ip - The IP address to check
74
- * @param allowedIPs - Array of allowed IP patterns from forwarding.security.allowedIps
75
- * @param blockedIPs - Array of blocked IP patterns from forwarding.security.blockedIps
73
+ * @param allowedIPs - Array of allowed IP patterns from security.ipAllowList
74
+ * @param blockedIPs - Array of blocked IP patterns from security.ipBlockList
76
75
  * @returns true if IP is authorized, false if blocked
77
76
  */
78
77
  public isIPAuthorized(ip: string, allowedIPs: string[], blockedIPs: string[] = []): boolean {
@@ -94,10 +93,10 @@ export class SecurityManager {
94
93
  * Check if the IP matches any of the glob patterns from security configuration
95
94
  *
96
95
  * This method checks IP addresses against glob patterns and handles IPv4/IPv6 normalization.
97
- * It's used to implement IP filtering based on the forwarding.security configuration.
96
+ * It's used to implement IP filtering based on the route.security configuration.
98
97
  *
99
98
  * @param ip - The IP address to check
100
- * @param patterns - Array of glob patterns from forwarding.security.allowedIps or blockedIps
99
+ * @param patterns - Array of glob patterns from security.ipAllowList or ipBlockList
101
100
  * @returns true if IP matches any pattern, false otherwise
102
101
  */
103
102
  private isGlobIPMatch(ip: string, patterns: string[]): boolean {