analytics-platform 0.3.9__tar.gz → 0.3.10__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.
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/PKG-INFO +1 -1
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/core.py +18 -1
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/firewall.py +3 -1
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform.egg-info/PKG-INFO +1 -1
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/pyproject.toml +1 -1
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/LICENSE +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/README.md +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/__init__.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/_env.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/analytics.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/audit.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/calls.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/celery.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/challenge.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/crawlers.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/django.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/dramatiq.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/errors.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/flags.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/forms.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/inventory.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/maintenance.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/performance.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/posture.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/proxy.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/queries.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/queues.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/request_rules.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/resources.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/rq.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform/start.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform.egg-info/SOURCES.txt +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform.egg-info/dependency_links.txt +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform.egg-info/top_level.txt +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/setup.cfg +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_calls_queues.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_celery.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_challenge.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_checkin.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_crawlers.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_errors.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_firewall.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_hardening.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_headers.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_limits.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_page_limits.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_proxy.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_proxy_answer.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_queries.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_redis.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_request_rules.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_resources.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_rq_dramatiq.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_start.py +0 -0
- {analytics_platform-0.3.9 → analytics_platform-0.3.10}/tests/test_static_late.py +0 -0
|
@@ -23,7 +23,7 @@ import urllib.error
|
|
|
23
23
|
import urllib.parse
|
|
24
24
|
import urllib.request
|
|
25
25
|
|
|
26
|
-
VERSION = "0.3.
|
|
26
|
+
VERSION = "0.3.10"
|
|
27
27
|
TIMEOUT = 5
|
|
28
28
|
MIN_SYNC = 30
|
|
29
29
|
RETRY = 60
|
|
@@ -447,6 +447,23 @@ def header(headers, name):
|
|
|
447
447
|
_PATH_SAFE = "/:@!$&'()*+,;=-._~"
|
|
448
448
|
|
|
449
449
|
|
|
450
|
+
_ABSOLUTE = re.compile(r"^[a-zA-Z][a-zA-Z0-9+.-]*://[^/?#]*")
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
def origin_form(target):
|
|
454
|
+
"""The request target as the app routes it: an absolute-form one ("GET
|
|
455
|
+
http://host/admin", sent as if to a proxy) is routed by its path, so it is
|
|
456
|
+
cut to "/admin"; matched as written it began "http:" and missed every rule
|
|
457
|
+
on "/admin". "*" and a target already "/..." are kept as they are."""
|
|
458
|
+
text = str(target or "")
|
|
459
|
+
if not text or text.startswith("/") or text == "*":
|
|
460
|
+
return text
|
|
461
|
+
rest, count = _ABSOLUTE.subn("", text, count=1)
|
|
462
|
+
if not count:
|
|
463
|
+
return text
|
|
464
|
+
return rest if rest.startswith("/") else "/" + rest
|
|
465
|
+
|
|
466
|
+
|
|
450
467
|
def request_target(path, query="", raw=None):
|
|
451
468
|
"""The request target as the visitor sent it, query string and all, which
|
|
452
469
|
is what the request rules match (sdk/protocols/firewall.md): the Node and
|
|
@@ -19,7 +19,7 @@ import time
|
|
|
19
19
|
from datetime import datetime, timezone
|
|
20
20
|
|
|
21
21
|
from . import challenge as browser_check
|
|
22
|
-
from .core import Periodic, RETRY, header
|
|
22
|
+
from .core import Periodic, RETRY, header, origin_form
|
|
23
23
|
from .request_rules import MAX_TEXT, _decode_once, compile_limits, compile_rules, match_limits, match_request, normalize_target, prepare
|
|
24
24
|
|
|
25
25
|
PROTOCOL = 1
|
|
@@ -572,6 +572,7 @@ class Firewall:
|
|
|
572
572
|
request's headers) are for the browser check: rule "challenge",
|
|
573
573
|
status 503, answered with challenge_page()."""
|
|
574
574
|
allow = {"action": "allow", "rule": "", "status": 200}
|
|
575
|
+
path = origin_form(path)
|
|
575
576
|
rules = self.rules
|
|
576
577
|
if not rules or not rules["enabled"]:
|
|
577
578
|
return allow
|
|
@@ -694,6 +695,7 @@ class Firewall:
|
|
|
694
695
|
beacons are never rate-limited, checked or matched against request
|
|
695
696
|
rules. -> the same shape as check()."""
|
|
696
697
|
allow = {"action": "allow", "rule": "", "status": 200}
|
|
698
|
+
path = origin_form(path)
|
|
697
699
|
rules = self.rules
|
|
698
700
|
if not rules or not rules["enabled"]:
|
|
699
701
|
return allow
|
|
@@ -10,7 +10,7 @@ Security = "https://sitegoose.com/security"
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "analytics-platform"
|
|
13
|
-
version = "0.3.
|
|
13
|
+
version = "0.3.10"
|
|
14
14
|
description = "Firewall, error monitoring and server analytics for your Python server, run from your analytics dashboard."
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
requires-python = ">=3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{analytics_platform-0.3.9 → analytics_platform-0.3.10}/analytics_platform.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|