Skip to content

feat: add fastify rate limiting - #6

Open
Damola-Sodiq wants to merge 1 commit into
Cowrie-Labs:mainfrom
Damola-Sodiq:feat/rate-limiting
Open

feat: add fastify rate limiting#6
Damola-Sodiq wants to merge 1 commit into
Cowrie-Labs:mainfrom
Damola-Sodiq:feat/rate-limiting

Conversation

@Damola-Sodiq

Copy link
Copy Markdown

This PR adds request throttling to the Fastify API to protect public endpoints from abuse, spam, and excessive polling.

What Changed
Installed and configured @fastify/rate-limit
Applied a global rate limit of 100 requests per minute per IP
Added a stricter rate limit of 20 requests per minute for the sensitive /api/transactions endpoint
Standardized rate-limit responses to return 429 Too Many Requests with a descriptive error message
Verification
Verified the app builds successfully with npm run build
Verified the behavior with automated tests using npm test -- --runInBand

closes #3

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement API Rate Limiting to Prevent Abuse

1 participant