Files
osint/app/Providers/AppServiceProvider.php
T

42 lines
1.6 KiB
PHP
Raw Normal View History

2026-07-20 10:22:05 +03:00
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Support\Facades\RateLimiter;
2026-07-20 10:22:05 +03:00
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Self-imposed limits so bulk-running lookups doesn't hammer the
// free public infrastructure these runners depend on. ip-api.com's
// limit (45/min) is theirs; the rest are courtesy limits of ours.
RateLimiter::for('osint-runner:ip-api', fn () => Limit::perMinute(45));
RateLimiter::for('osint-runner:crtsh', fn () => Limit::perMinute(30));
RateLimiter::for('osint-runner:whois', fn () => Limit::perMinute(20));
RateLimiter::for('osint-runner:sherlock', fn () => Limit::perMinute(10));
RateLimiter::for('osint-runner:theharvester', fn () => Limit::perMinute(5));
2026-07-20 11:49:09 +03:00
RateLimiter::for('osint-runner:holehe', fn () => Limit::perMinute(15));
2026-07-20 11:59:20 +03:00
RateLimiter::for('osint-runner:gravatar', fn () => Limit::perMinute(45));
RateLimiter::for('osint-runner:dns', fn () => Limit::perMinute(60));
// OpenCorporates' free tier is 50 requests/day, 200/month — this
// matches their real quota (not a courtesy limit) to protect the
// configured token from getting exhausted or suspended.
RateLimiter::for('osint-runner:opencorporates', fn () => Limit::perDay(50));
2026-07-20 10:22:05 +03:00
}
}