feat(api): add send payload limits and per-tenant rate limiting - #91
Open
patoperpetua wants to merge 1 commit into
Open
feat(api): add send payload limits and per-tenant rate limiting#91patoperpetua wants to merge 1 commit into
patoperpetua wants to merge 1 commit into
Conversation
Protect POST /emails/send from oversized bodies and abusive traffic by rejecting payloads before template load, throttling per authenticated tenant, and documenting the in-memory limiter limitation. Closes #38 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Comment |
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
POST /emails/sendbodies andvariablesbefore template load with stablePAYLOAD_TOO_LARGEerrors and configurable byte limits.{tenantId}:{environment}, returning429withRetry-AfterandRATE_LIMITED.SlidingWindowRateLimiterfor send traffic; document the best-effort / scale-out limitation and new env defaults in.env.example.Test plan
pnpm testinapps/api(send-limits unit tests, send handler size/rate-limit tests, security boundary updates)429response includesRetry-AfterandRATE_LIMITEDcodeCloses #38
Made with Cursor