aiwaf 0.1.9.0.7__tar.gz → 0.1.9.0.9__tar.gz

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.

Potentially problematic release.


This version of aiwaf might be problematic. Click here for more details.

Files changed (39) hide show
  1. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/PKG-INFO +1 -1
  2. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/__init__.py +1 -1
  3. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/middleware.py +4 -4
  4. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/storage.py +16 -0
  5. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf.egg-info/PKG-INFO +1 -1
  6. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/pyproject.toml +1 -1
  7. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/setup.py +1 -1
  8. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/LICENSE +0 -0
  9. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/README.md +0 -0
  10. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/apps.py +0 -0
  11. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/blacklist_manager.py +0 -0
  12. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/decorators.py +0 -0
  13. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/__init__.py +0 -0
  14. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/__init__.py +0 -0
  15. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/add_exemption.py +0 -0
  16. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/add_ipexemption.py +0 -0
  17. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/aiwaf_diagnose.py +0 -0
  18. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/aiwaf_logging.py +0 -0
  19. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/aiwaf_reset.py +0 -0
  20. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/clear_cache.py +0 -0
  21. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/debug_csv.py +0 -0
  22. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/detect_and_train.py +0 -0
  23. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/diagnose_blocking.py +0 -0
  24. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/regenerate_model.py +0 -0
  25. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/setup_models.py +0 -0
  26. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/test_exemption.py +0 -0
  27. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/management/commands/test_exemption_fix.py +0 -0
  28. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/middleware_logger.py +0 -0
  29. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/models.py +0 -0
  30. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/resources/model.pkl +0 -0
  31. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/templatetags/__init__.py +0 -0
  32. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/templatetags/aiwaf_tags.py +0 -0
  33. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/trainer.py +0 -0
  34. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf/utils.py +0 -0
  35. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf.egg-info/SOURCES.txt +0 -0
  36. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf.egg-info/dependency_links.txt +0 -0
  37. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf.egg-info/requires.txt +0 -0
  38. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/aiwaf.egg-info/top_level.txt +0 -0
  39. {aiwaf-0.1.9.0.7 → aiwaf-0.1.9.0.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiwaf
3
- Version: 0.1.9.0.7
3
+ Version: 0.1.9.0.9
4
4
  Summary: AI-powered Web Application Firewall
5
5
  Home-page: https://github.com/aayushgauba/aiwaf
6
6
  Author: Aayush Gauba
@@ -1,6 +1,6 @@
1
1
  default_app_config = "aiwaf.apps.AiwafConfig"
2
2
 
3
- __version__ = "0.1.9.0.7"
3
+ __version__ = "0.1.9.0.9"
4
4
 
5
5
  # Note: Middleware classes are available from aiwaf.middleware
6
6
  # Import them only when needed to avoid circular imports during Django app loading
@@ -135,12 +135,12 @@ class IPAndKeywordBlockMiddleware:
135
135
 
136
136
 
137
137
  class RateLimitMiddleware:
138
- WINDOW = 10 # seconds
139
- MAX = 20 # soft limit
140
- FLOOD = 40 # hard limit
141
-
142
138
  def __init__(self, get_response):
143
139
  self.get_response = get_response
140
+ # Make rate limiting configurable via Django settings
141
+ self.WINDOW = getattr(settings, "AIWAF_RATE_WINDOW", 10) # seconds
142
+ self.MAX = getattr(settings, "AIWAF_RATE_MAX", 20) # soft limit
143
+ self.FLOOD = getattr(settings, "AIWAF_RATE_FLOOD", 40) # hard limit
144
144
 
145
145
  def __call__(self, request):
146
146
  if is_exempt(request):
@@ -111,6 +111,11 @@ class ModelBlacklistStore:
111
111
  except Exception as e:
112
112
  print(f"Error unblocking IP {ip}: {e}")
113
113
 
114
+ @staticmethod
115
+ def remove_ip(ip):
116
+ """Remove IP from blacklist (alias for unblock_ip)"""
117
+ ModelBlacklistStore.unblock_ip(ip)
118
+
114
119
  @staticmethod
115
120
  def get_all_blocked_ips():
116
121
  """Get all blocked IPs"""
@@ -171,6 +176,17 @@ class ModelExemptionStore:
171
176
  except Exception:
172
177
  return []
173
178
 
179
+ @staticmethod
180
+ def get_all():
181
+ """Get all exempted IP entries as dictionaries"""
182
+ _import_models()
183
+ if IPExemption is None:
184
+ return []
185
+ try:
186
+ return list(IPExemption.objects.values('ip_address', 'reason', 'created_at'))
187
+ except Exception:
188
+ return []
189
+
174
190
  class ModelKeywordStore:
175
191
  @staticmethod
176
192
  def add_keyword(keyword):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiwaf
3
- Version: 0.1.9.0.7
3
+ Version: 0.1.9.0.9
4
4
  Summary: AI-powered Web Application Firewall
5
5
  Home-page: https://github.com/aayushgauba/aiwaf
6
6
  Author: Aayush Gauba
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aiwaf"
3
- version = "0.1.9.0.7"
3
+ version = "0.1.9.0.9"
4
4
  description = "AI-powered Web Application Firewall"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -9,7 +9,7 @@ long_description = (HERE / "README.md").read_text(encoding="utf-8")
9
9
 
10
10
  setup(
11
11
  name="aiwaf",
12
- version="0.1.9.0.7",
12
+ version="0.1.9.0.9",
13
13
  description="AI‑driven, self‑learning Web Application Firewall for Django",
14
14
  long_description=long_description,
15
15
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes