Validation
Every fetched or loaded IP set passes through validation before it becomes trusted by Laravel.
Goals
- Prevent accidentally trusting the entire Internet
- Reject empty or corrupt payloads
- Ensure updates are atomic and reversible on failure
- Detect unexpected drift via checksums and change-percent guards
Non-global rejection
EdgeTrust refuses ranges that would trust all traffic, including:
0.0.0.0/0::/0
Controlled by validation.reject_non_global (default true). Custom ranges can optionally allow non-global checks via reject_non_global_custom.
Minimum prefix counts
Each provider can require a minimum number of valid prefixes so a truncated upstream payload fails loudly:
'validation' => [
'min_prefixes_default' => 1,
'min_prefixes' => [
'cloudflare' => 5,
'aws_cloudfront' => 10,
'fastly' => 3,
'bunny' => 10,
'google_cloud' => 10,
'arvancloud' => 1,
],
],Change-percent guards
Large unexpected swings in prefix count relative to the previous archive / cache can be rejected:
'max_change_percent_default' => 50.0,
'max_change_percent' => [
// 'cloudflare' => 40.0,
],Use --force on edge-trust:sync / edge-trust:update to bypass these guards when you intentionally accept a large shift.
Checksums
When archives.verify_checksums is enabled, EdgeTrust verifies digest metadata for bundled archives. Mismatched checksums abort the load.
Atomic updates
Validated data is written carefully so readers never observe a half-written archive. If validation or the write fails, EdgeTrust preserves the previous archive / last-known-good data.
Manual validation
php artisan edge-trust:validate
php artisan edge-trust:validate --provider=arvancloudRuns validation against currently resolved ranges. Useful in CI and after manual edits.
Failure behavior
| Event | Result |
|---|---|
| Invalid CIDR syntax | Range rejected / update aborted |
| Global range detected | Update aborted (when configured) |
| Below min prefix count | Update aborted |
| Change percent exceeded | Update aborted (unless --force) |
| Checksum mismatch | Archive load aborted |
| Network / HTTP error (runtime) | No overwrite; hybrid falls back |
More operational detail: Security.