Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/9/add-rate-limits #51

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

AmirAgassi
Copy link
Member

What's Included

  • Added RateLimiter middleware to rate limit API requests.
  • Added rate limits for authentication and general API routes:
    • Auth Routes: 20 requests per 5 minutes, blocked for 15 minutes when limited.
    • Global API Routes: 100 requests per minute, blocked for 5 minutes when limited.
  • Added test middleware for setting IPs, aiding rate limit tests.

📁 Files Affected:

  • internal/middleware/ratelimit.go
  • internal/server/auth.go
  • internal/server/auth_test.go
  • internal/server/index.go
  • internal/server/test_helpers.go
  • main.go

@AmirAgassi AmirAgassi self-assigned this Nov 12, 2024
Copy link

github-actions bot commented Nov 12, 2024

Test Results ✅

Status: success
Coverage: 36.4%
OS: Linux

Test Details
  • Triggered by: @AmirAgassi
  • Commit: c464f05
  • Branch: refs/pull/51/merge
  • Workflow: Run Tests

@AmirAgassi AmirAgassi merged commit 5da1e0a into main Nov 12, 2024
1 check passed
@juancwu juancwu deleted the 45-be-implement-rate-limiting-for-api-endpoints branch November 15, 2024 06:43
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.

BE: Implement Rate Limiting for API Endpoints
1 participant