Architecture
EdgeTrust sits between official CDN / edge IP publications and Laravel's TrustProxies configuration.
Layers
- Providers — fetch and parse official IP list endpoints (
ProxyProvider/AbstractProvider). - Validation — reject invalid, empty, or dangerous ranges (
IpRangeValidator). - Archives — bundled JSON (+ checksums) shipped with the package (
ArchiveManager). - Repositories — resolve ranges for
bundled,runtime, orhybridmodes. - ProxyManager — facade target that merges providers, custom ranges, excludes, and cache.
- Laravel integration —
EdgeTrust::proxies(), optionalTrustProxiesmiddleware, Artisan commands, scheduled sync.
Request path vs sync path
text
HTTP request → TrustProxies → ProxyManager::proxies()
→ cache / last-known-good / bundled archives
✗ never hits remote provider HTTP APIs
edge-trust:sync → providers fetch → validate → cache / archivesKeeping fetches off the request hot path is a hard design rule.
Modes
See Modes. Hybrid is the recommended default: try runtime freshness, fall back safely.
Automation
GitHub Actions workflow .github/workflows/update-proxies.yml refreshes bundled archives daily, runs tests, bumps a patch version, and releases only when ranges change and validation passes.