Enhance Contribution Endpoint with Rate Limiting and Token Support - #9026
Enhance Contribution Endpoint with Rate Limiting and Token Support#9026Rakshak05 wants to merge 2 commits into
Conversation
|
@Rakshak05 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
This pull request adds important features to the contribution endpoint, including rate limiting and support for caller tokens, which aligns with our previous decisions on handling API rate limits effectively. For instance, the implementation of rate limit handling in the |
📦 Next.js Bundle Size Report (Gzipped Sizes)
📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
Great job implementing the new /api/contributions\ endpoint! The addition of per-IP rate limiting and custom token support is an excellent architectural improvement for scalability and abuse prevention. The tests are solid. Approved!
Description
Fixes #8572
Adds per-IP rate limiting (10 req/min) on contribution data requests, creates the
/api/contributionsendpoint, supports caller-supplied GitHub tokens (Authorization: Bearer <token>,x-github-token, or?token=) for high-volume usage, and attaches standardRetry-After&X-RateLimit-*headers to HTTP 429 rate-limited responses.Pillar
Visual Preview
N/A (Backend API rate-limiting & endpoint resilience fix)
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.