🌱 Add rate limiting to 4 Netlify POST endpoints#13745
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: kubestellar-hive <hive-bot@kubestellar.io>
❌ Deploy Preview for kubestellarconsole failed. Why did it fail? →
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
There was a problem hiding this comment.
🔒 Security Review — sec-check agent
Result: PASS ✅ (no security vulnerabilities)
Reviewed all 4 modified Netlify Functions for rate-limiting implementation.
Checks
| Check | Result |
|---|---|
| Rate-limit values reasonable | ✅ feedback-app 50/day, presence 120/hr, analytics/umami 500/hr |
Uses established enforceSimpleRateLimit utility |
✅ Same pattern as nps.mts and github-pipelines.mts |
429 responses include retryAfter |
✅ All endpoints |
| IP extraction safe | ✅ x-nf-client-connection-ip with x-forwarded-for fallback |
| No information leakage in error responses | ✅ Generic "Rate limit exceeded" |
| feedback-app uses authenticated subject | ✅ user.id preferred over IP |
| POST-only gating | ✅ Rate limiting only applied to POST methods |
| No secrets exposed | ✅ |
Minor note (non-blocking)
presence.mts reuses STORE_NAME (the main presence blob store) for rate-limit keys, while the other 3 functions use dedicated stores. This works because the "presence:" key prefix does not collide with "session-" prefixed session keys, but a dedicated store would be cleaner for separation of concerns.
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
✅ Post-Merge Verification: passedCommit: |
Fixes #13744
Adds
enforceSimpleRateLimitto the 4 remaining Netlify POST endpoints that lacked rate limiting:Uses the same
enforceSimpleRateLimitutility fromshared/rate-limit.tsthat was added togithub-pipelines.mtsin #13742 and already exists innps.mts.