Spam Protection Service
Component Detail
Service Layer
low complexity
backend
0
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
Server-side middleware that enforces per-IP and per-email submission rate limits and validates the honeypot field on incoming booking requests. Prevents automated spam and form flooding without requiring CAPTCHA, preserving accessibility for legitimate users.
spam-protection-service
Responsibilities
- Check and increment per-IP request counters using an in-memory or Redis store
- Check and enforce per-email submission limits within a sliding time window
- Reject requests where the honeypot field is populated
- Return 429 Too Many Requests with Retry-After header when limits are exceeded
Interfaces
checkRateLimit(ip: string, email: string): Promise<RateLimitResult>
validateHoneypot(formData: BookingFormData): boolean