集成 Turnstile 人机验证 + Cloudflare R2 事件归档

This commit is contained in:
2569718930@qq.com
2026-06-16 03:40:47 +08:00
parent 9d61d9443d
commit 382bc99f0c
8 changed files with 786 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_frontend_cache_validator_checks_cloudflare_edge_hits():
script = (ROOT / "scripts" / "validate_frontend_cache.sh").read_text(encoding="utf-8")
assert "REQUIRE_CF_CACHE" in script
assert "CF-Cache-Status" in script
assert "cf_cache_status" in script
assert "HIT" in script
assert "MISS" in script
assert "REVALIDATED" in script
assert 'check_cloudflare_cache_hit "/api/cities" "cities edge cache"' in script
assert 'check_cloudflare_cache_hit "/api/scan/terminal?limit=1" "scan terminal edge cache"' in script