Skip to content

feat: add rate limiting with Bucket4j per endpoint tier - #8

Merged
MarkADom merged 2 commits into
developfrom
feature/rate-limiting
Jun 8, 2026
Merged

MarkADom merged 2 commits into
developfrom
feature/rate-limiting

Conversation

@MarkADom

@MarkADom MarkADom commented Jun 8, 2026

Copy link
Copy Markdown
Owner

feat: add rate limiting

Changes

  • RateLimitTier — defines limits per endpoint (IP_LOOKUP: 30/min, GEO_SEARCH: 60/min)
  • RateLimit — custom annotation to declare tier per controller method
  • RateLimitService — resolves bucket per client (X-Forwarded-For + IP fallback)
  • RateLimitInterceptor — intercepts requests and enforces limits
  • WebConfig — registers interceptor for /api/v1/geo/**

Response Headers

  • X-RateLimit-Limit — max requests allowed
  • X-RateLimit-Remaining — requests remaining
  • Retry-After — seconds until reset (on 429)

Testing

  • 30 requests → 200
  • 31st request → 429

@MarkADom
MarkADom merged commit caa457e into develop Jun 8, 2026
1 check passed
@MarkADom
MarkADom deleted the feature/rate-limiting branch June 8, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant