Skip to content

Add rate limiting to solution submission and voting endpoints #36

Description

@Mkalbani

Description

With the queue system, comments, and voting/ranking endpoints now live, the API has no protection against spam submissions or vote manipulation. Add endpoint-level rate limiting so a single user or IP can't flood the queue or skew rankings through rapid repeated requests.

Acceptance Criteria

  • @nestjs/throttler (or equivalent) integrated at the module level
  • Stricter limits applied to POST /solutions, POST /solutions/:id/vote, and POST /comments than to read endpoints
  • Rate-limit config values (window, max requests) are environment-configurable, not hardcoded
  • Exceeding the limit returns a 429 with a Retry-After header, not a generic error
  • Existing auth service (from the websocket JWT work) is used to key limits per-user where a valid JWT is present, falling back to IP for anonymous requests
  • Integration tests cover both throttled and non-throttled request paths

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions