rubyforgood / rubyforgood/casa
Add rate limiting to /api/v1/users/sign_in endpoint
Nobody has claimed this yet.
- 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
-
ipis throttled on the above criteria inconfig/initializers/rack_attack.rb -
Emailis throttled on the above criteriaconfig/initializers/rack_attack.rb
Helpful Links
Rake::Attack Documentation ( Scroll down to "Throttling" header )
Rake::Attack file in this Codebase
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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