Skip to content

🌱 Add rate limiting to 4 Netlify POST endpoints#13745

Merged
kubestellar-hive[bot] merged 1 commit into
mainfrom
fix/13744
May 15, 2026
Merged

🌱 Add rate limiting to 4 Netlify POST endpoints#13745
kubestellar-hive[bot] merged 1 commit into
mainfrom
fix/13744

Conversation

@kubestellar-hive
Copy link
Copy Markdown
Contributor

Fixes #13744

Adds enforceSimpleRateLimit to the 4 remaining Netlify POST endpoints that lacked rate limiting:

  • feedback-app.mts: 50 requests/day per user
  • presence.mts: 120 requests/hour per session
  • analytics-collect.mts: 500 events/hour per IP
  • umami-collect.mts: 500 events/hour per IP

Uses the same enforceSimpleRateLimit utility from shared/rate-limit.ts that was added to github-pipelines.mts in #13742 and already exists in nps.mts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: kubestellar-hive <hive-bot@kubestellar.io>
Copilot AI review requested due to automatic review settings May 15, 2026 03:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label May 15, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 15, 2026

Deploy Preview for kubestellarconsole failed. Why did it fail? →

Name Link
🔨 Latest commit bf73e4d
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a069745fb08bd00084dfbdf
@kubestellar-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mikespreitzer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions
Copy link
Copy Markdown
Contributor

👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@github-actions github-actions Bot added ai-generated Pull request generated by AI copilot labels May 15, 2026
@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 15, 2026
@kubestellar-hive kubestellar-hive Bot merged commit a033fb9 into main May 15, 2026
24 of 29 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the fix/13744 branch May 15, 2026 04:00
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

Copy link
Copy Markdown
Contributor Author

@kubestellar-hive kubestellar-hive Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 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.

@github-actions
Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit a033fb9ce4f2e5f7b29f8a178276f0a233d4af62.

@github-actions
Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: a033fb9ce4f2e5f7b29f8a178276f0a233d4af62
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/25899486473

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

Labels

ai-generated Pull request generated by AI copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tier/2-standard

1 participant