Skip to content

fix: No rate limiting on the API-key-authenticated local coding sync #1869

Open
Aditya8369 wants to merge 4 commits into
Priyanshu-byte-coder:mainfrom
Aditya8369:1690
Open

fix: No rate limiting on the API-key-authenticated local coding sync #1869
Aditya8369 wants to merge 4 commits into
Priyanshu-byte-coder:mainfrom
Aditya8369:1690

Conversation

@Aditya8369
Copy link
Copy Markdown

Rate limiting added to POST /api/local-coding/sync keyed by the sha256 hash of the bearer API key (fixed window: 20 requests per 60s). When exceeded, the endpoint now returns 429 with { error: "Rate limit exceeded" } and a Retry-After header.

Updated files:

src/app/api/local-coding/sync/route.ts (added in-memory + Upstash-backed limiter; applied only to POST)
test/local-coding-sync.test.ts (added test asserting 21st POST returns 429; mocked Upstash config to force in-memory)

closes #1690

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@Aditya8369 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:security GSSoC type bonus: security (+20 pts) type:testing GSSoC type bonus: tests (+10 pts) labels Jun 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Aditya8369
Copy link
Copy Markdown
Author

@Priyanshu-byte-coder please check this one

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level:intermediate GSSoC: Intermediate difficulty (35 pts) labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:intermediate GSSoC: Intermediate difficulty (35 pts) type:bug GSSoC type bonus: bug fix type:security GSSoC type bonus: security (+20 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] No rate limiting on the API-key-authenticated local coding sync endpoint

2 participants