Skip to content

Feat/oauth rate limiting#446

Open
roshankumar0036singh wants to merge 2 commits into
Dev-Card:mainfrom
roshankumar0036singh:feat/oauth-rate-limiting
Open

Feat/oauth rate limiting#446
roshankumar0036singh wants to merge 2 commits into
Dev-Card:mainfrom
roshankumar0036singh:feat/oauth-rate-limiting

Conversation

@roshankumar0036singh
Copy link
Copy Markdown
Contributor

OAuth Rate Limiting

Add rate limiting to OAuth endpoints to prevent brute force attacks and token guessing.

Changes

  • New oauthRateLimit plugin with per-IP bucket strategy
  • OAuth callbacks: 5 req/min (strict)
  • OAuth start: 10 req/min (moderate)
  • Applied to GitHub & Google OAuth flows

Fixes

Closes issue: #443

- Create oauthRateLimit plugin with per-IP bucket strategy
- Apply stricter rate limits to OAuth callback endpoints (5 req/min)
- Apply moderate rate limits to OAuth start endpoints (10 req/min)
- Prevent brute force attacks and token guessing
- Add per-user fallback for authenticated requests
- Fixes: No Rate Limiting on OAuth Endpoints
- Fix off-by-one error: use >= instead of > for count checks
- Add Retry-After HTTP header to 429 responses (standard approach)
- Add type declaration merging for decorator properties
- Remove as any casts from auth routes
- Document cache:10000 reasoning in comments
@roshankumar0036singh
Copy link
Copy Markdown
Contributor Author

@Harxhit reveiw this plz

@Harxhit Harxhit added the gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. label Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants