Open
Conversation
- Add rate limiting (10/hr per user) to SMS send endpoint to prevent Twilio abuse - Add Redis timeout config (connect: 2s, read/write: 1s) to prevent hung requests - Widen rescue to catch LoadError in rate_limit.rb and active_storage.rb initializer - Validate OAuth auto-create role against known roles with fallback and logging - Add HEALTHCHECK to Dockerfile using /up health endpoint Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Author
|
bugbot run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RateLimit.call(10 req/hr per user) toSubmittersSendSmsControllerto prevent Twilio credit abuseconnect_timeout: 2,read_timeout: 1,write_timeout: 1,reconnect_attempts: 1toRedisCacheStoreto prevent hung requests on Redis outagerescue StandardErrorto also catchLoadErrorinrate_limit.rbandactive_storage.rbinitializer (prevents crashes from missing gems, same class of bug as the redis gem issue)GOOGLE_AUTO_CREATE_ROLEenv var againstUser::ROLES, falls back to admin with warning log if invalid; adds info log on user creationHEALTHCHECKusing the existing/upendpoint for container orchestrationAssessed and skipped
Access-Control-Allow-Origin: *authenticated :user, ->(u) { u.sidekiq? }(admin only)Test plan
REDIS_URLsetGOOGLE_AUTO_CREATE_ROLEbundle exec rspec— no regressions🤖 Generated with Claude Code
Note
Medium Risk
Moderate risk because it changes request-path behavior (SMS sending now rate-limited) and alters caching/initializer error handling/timeouts, which could affect runtime behavior under load or during outages.
Overview
Adds per-user rate limiting to the SMS invitation endpoint (
SubmittersSendSmsController) and returns a friendly error when the limit is exceeded.Hardens
RateLimitby configuring Redis cache timeouts/reconnect attempts and by falling back to in-memory storage when Redis/gems fail to load; similarly broadens ActiveStorage initializer rescue to includeLoadError.Validates
GOOGLE_AUTO_CREATE_ROLEagainstUser::ROLES(with warning + fallback) and adds an info log on OAuth auto-created users, and adds a DockerHEALTHCHECKagainst/upfor orchestration readiness.Written by Cursor Bugbot for commit 41ccd3b. Configure here.