[PR #753] [MERGED] feat: add IP blacklist feature for rate-limited APIs #742

Closed
opened 2026-02-26 21:32:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753
Author: @dreamhunter2333
Created: 11/3/2025
Status: Merged
Merged: 11/3/2025
Merged by: @dreamhunter2333

Base: mainHead: feature/email


📝 Commits (2)

  • fad04ac feat: add IP blacklist feature for rate-limited APIs
  • 3545b56 fix: add try-catch wrapper to checkIpBlacklist for error safety

📊 Changes

7 files changed (+361 additions, -0 deletions)

View changed files

📝 frontend/src/views/Admin.vue (+6 -0)
frontend/src/views/admin/IpBlacklistSettings.vue (+126 -0)
📝 worker/src/admin_api/index.ts (+5 -0)
worker/src/admin_api/ip_blacklist_settings.ts (+68 -0)
📝 worker/src/constants.ts (+1 -0)
worker/src/ip_blacklist.ts (+148 -0)
📝 worker/src/worker.ts (+7 -0)

📄 Description

User description

  • Add IP blacklist settings management with database storage
  • Support both regex patterns and plain text (substring) matching
  • Auto-detect pattern type using regex metacharacter heuristics
  • Add admin API endpoints for settings CRUD operations
  • Create Vue.js admin UI with bilingual support (EN/ZH)
  • Apply early rejection to 5 rate-limited endpoints
  • Add data validation and sanitization (max 1000 entries)
  • Remove affected APIs display from frontend per user feedback

🤖 Generated with Claude Code


PR Type

Enhancement, Tests


Description

  • Introduced IP blacklist feature for rate-limited APIs.

  • Added Vue.js admin UI for managing blacklist settings.

  • Implemented backend API endpoints for CRUD operations.

  • Integrated IP blacklist checks into rate-limited endpoints.


Changes walkthrough 📝

Relevant files
Enhancement
6 files
Admin.vue
Added IP blacklist settings to admin panel UI.                     
+6/-0     
IpBlacklistSettings.vue
Created Vue.js component for IP blacklist settings management.
+126/-0 
index.ts
Registered API routes for IP blacklist settings.                 
+5/-0     
ip_blacklist_settings.ts
Implemented backend logic for IP blacklist CRUD operations.
+68/-0   
ip_blacklist.ts
Added utility functions for IP blacklist validation and middleware.
+142/-0 
worker.ts
Integrated IP blacklist checks into rate-limited API endpoints.
+7/-0     
Configuration changes
1 files
constants.ts
Added constant for IP blacklist settings key.                       
+1/-0     

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.

  • 🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

    ## 📋 Pull Request Information **Original PR:** https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753 **Author:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Created:** 11/3/2025 **Status:** ✅ Merged **Merged:** 11/3/2025 **Merged by:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Base:** `main` ← **Head:** `feature/email` --- ### 📝 Commits (2) - [`fad04ac`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/fad04ace86006d4177f143e24499b4be03c2653c) feat: add IP blacklist feature for rate-limited APIs - [`3545b56`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/3545b564226f1a91d6c3e50c0b140e155eeb0130) fix: add try-catch wrapper to checkIpBlacklist for error safety ### 📊 Changes **7 files changed** (+361 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/views/Admin.vue` (+6 -0) ➕ `frontend/src/views/admin/IpBlacklistSettings.vue` (+126 -0) 📝 `worker/src/admin_api/index.ts` (+5 -0) ➕ `worker/src/admin_api/ip_blacklist_settings.ts` (+68 -0) 📝 `worker/src/constants.ts` (+1 -0) ➕ `worker/src/ip_blacklist.ts` (+148 -0) 📝 `worker/src/worker.ts` (+7 -0) </details> ### 📄 Description ### **User description** - Add IP blacklist settings management with database storage - Support both regex patterns and plain text (substring) matching - Auto-detect pattern type using regex metacharacter heuristics - Add admin API endpoints for settings CRUD operations - Create Vue.js admin UI with bilingual support (EN/ZH) - Apply early rejection to 5 rate-limited endpoints - Add data validation and sanitization (max 1000 entries) - Remove affected APIs display from frontend per user feedback 🤖 Generated with [Claude Code](https://claude.com/claude-code) ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Introduced IP blacklist feature for rate-limited APIs. - Added Vue.js admin UI for managing blacklist settings. - Implemented backend API endpoints for CRUD operations. - Integrated IP blacklist checks into rate-limited endpoints. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>6 files</summary><table> <tr> <td><strong>Admin.vue</strong><dd><code>Added IP blacklist settings to admin panel UI.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753/files#diff-78137b072a7fa52c6d503efb9a3d32c07da5073dd5ca32ac48b1402ac2481a55">+6/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>IpBlacklistSettings.vue</strong><dd><code>Created Vue.js component for IP blacklist settings management.</code></dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753/files#diff-cca0634d6dfde28a1cdd006e7bca58a2b2978ac0f3547e4f25ee2850c9c2afec">+126/-0</a>&nbsp; </td> </tr> <tr> <td><strong>index.ts</strong><dd><code>Registered API routes for IP blacklist settings.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753/files#diff-b470c4c47ce4a700cd8aac644d07d8a747d439bb6d69e9392a198b3a931fe2e7">+5/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>ip_blacklist_settings.ts</strong><dd><code>Implemented backend logic for IP blacklist CRUD operations.</code></dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753/files#diff-02112f0b34b5d82117c3eebefb434860a3dba70dfd02f607796a0ba2a56c120f">+68/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>ip_blacklist.ts</strong><dd><code>Added utility functions for IP blacklist validation and middleware.</code></dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753/files#diff-af35186f7408e3585e885c1c86e762daa73ae8ec4b99d6a263c7f330da975e5e">+142/-0</a>&nbsp; </td> </tr> <tr> <td><strong>worker.ts</strong><dd><code>Integrated IP blacklist checks into rate-limited API endpoints.</code></dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753/files#diff-c007030a206d7e4e2a4879ba673551e7633ad914b67cfac204096edced3f80a2">+7/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Configuration changes</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>constants.ts</strong><dd><code>Added constant for IP blacklist settings key.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/753/files#diff-cab08ba19c1499ed426fc4918a5613e22eb95c3427c7467ce330f5ee0d69d01e">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
    kerem 2026-02-26 21:32:46 +03:00
    Sign in to join this conversation.
    No milestone
    No project
    No assignees
    1 participant
    Notifications
    Due date
    The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

    No due date set.

    Dependencies

    No dependencies set.

    Reference
    starred/cloudflare_temp_email#742
    No description provided.