rubyforgood / rubyforgood/casa

Add rate limiting to /api/v1/users/sign_in endpoint

Open
#6,211 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codethechange no-issue-activity
Dominant language
Ruby
Stars
381
Forks
542
Avg merge
3d 15h
Merged PRs (30d)
47

Description

Part of epic #3942

What type of user does this affect?
  • volunteers
How should it operate? ⚙️🛠️

Endpoint should now have rate limits.

No more than 5 requests every 60 seconds is allowed to /api/v1/users/sign_in from a given ip or email.

Acceptance Criteria
  • ip is throttled on the above criteria in config/initializers/rack_attack.rb
  • Email is throttled on the above criteria config/initializers/rack_attack.rb
Helpful Links

Rake::Attack Documentation ( Scroll down to "Throttling" header )
Rake::Attack file in this Codebase

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with config/initializers/rack_attack.rb and the Rack::Attack throttling documentation linked in the issue. Trace how /api/v1/users/sign_in identifies the request IP and email, then verify the acceptance criteria: each is limited to 5 requests per 60 seconds. Check the existing test structure for rate-limiting coverage and add or run the relevant tests if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
api, authentication, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.