[PR #755] [MERGED] feat: add ASN organization blacklist for IP filtering #744

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/755
Author: @dreamhunter2333
Created: 11/3/2025
Status: Merged
Merged: 11/3/2025
Merged by: @dreamhunter2333

Base: mainHead: feature/email


📝 Commits (1)

  • 3bb88ce feat: add ASN organization blacklist for IP filtering

📊 Changes

3 files changed (+90 additions, -30 deletions)

View changed files

📝 frontend/src/views/admin/IpBlacklistSettings.vue (+31 -0)
📝 worker/src/admin_api/ip_blacklist_settings.ts (+21 -1)
📝 worker/src/ip_blacklist.ts (+38 -29)

📄 Description

User description

  • Add asnBlacklist field to IpBlacklistSettings (optional)
  • Create shared isBlacklisted() function for IP and ASN matching
  • Add isAsnBlacklisted() function with case-insensitive matching
  • Extend checkIpBlacklist() to also check ASN organizations
  • Update admin API to validate and save ASN blacklist
  • Add ASN blacklist input to admin UI (below IP blacklist)
  • Support text matching and regex for ASN organization names
  • ASN data from request.cf.asOrganization (Cloudflare)

🤖 Generated with Claude Code


PR Type

Enhancement


Description

  • Added ASN organization blacklist support for IP filtering.

  • Enhanced admin UI to manage ASN blacklist settings.

  • Introduced shared utility for blacklist matching (IP and ASN).

  • Updated backend logic to validate and enforce ASN blacklist.


Changes walkthrough 📝

Relevant files
Enhancement
IpBlacklistSettings.vue
Add ASN blacklist management to admin UI                                 

frontend/src/views/admin/IpBlacklistSettings.vue

  • Added UI elements for ASN organization blacklist management.
  • Included placeholders and tooltips for ASN blacklist input.
  • Updated data fetching and saving logic to handle ASN blacklist.
  • +31/-0   
    ip_blacklist_settings.ts
    Validate and sanitize ASN blacklist in admin API                 

    worker/src/admin_api/ip_blacklist_settings.ts

  • Added validation and sanitization for ASN blacklist input.
  • Enforced maximum size constraint for ASN blacklist.
  • Updated settings structure to include ASN blacklist.
  • +21/-1   
    ip_blacklist.ts
    Add ASN blacklist logic and utility functions                       

    worker/src/ip_blacklist.ts

  • Introduced isBlacklisted utility for generic blacklist matching.
  • Added isAsnBlacklisted function for ASN-specific checks.
  • Updated IP blacklist logic to include ASN organization checks.
  • +82/-27 

    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/755 **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 (1) - [`3bb88ce`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/3bb88ce51e27115770f7ee29c151f61124e8c96c) feat: add ASN organization blacklist for IP filtering ### 📊 Changes **3 files changed** (+90 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/views/admin/IpBlacklistSettings.vue` (+31 -0) 📝 `worker/src/admin_api/ip_blacklist_settings.ts` (+21 -1) 📝 `worker/src/ip_blacklist.ts` (+38 -29) </details> ### 📄 Description ### **User description** - Add asnBlacklist field to IpBlacklistSettings (optional) - Create shared isBlacklisted() function for IP and ASN matching - Add isAsnBlacklisted() function with case-insensitive matching - Extend checkIpBlacklist() to also check ASN organizations - Update admin API to validate and save ASN blacklist - Add ASN blacklist input to admin UI (below IP blacklist) - Support text matching and regex for ASN organization names - ASN data from request.cf.asOrganization (Cloudflare) 🤖 Generated with [Claude Code](https://claude.ai/code) ___ ### **PR Type** Enhancement ___ ### **Description** - Added ASN organization blacklist support for IP filtering. - Enhanced admin UI to manage ASN blacklist settings. - Introduced shared utility for blacklist matching (IP and ASN). - Updated backend logic to validate and enforce ASN blacklist. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>IpBlacklistSettings.vue</strong><dd><code>Add ASN blacklist management to admin UI</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> frontend/src/views/admin/IpBlacklistSettings.vue <li>Added UI elements for ASN organization blacklist management.<br> <li> Included placeholders and tooltips for ASN blacklist input.<br> <li> Updated data fetching and saving logic to handle ASN blacklist. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/755/files#diff-cca0634d6dfde28a1cdd006e7bca58a2b2978ac0f3547e4f25ee2850c9c2afec">+31/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>ip_blacklist_settings.ts</strong><dd><code>Validate and sanitize ASN blacklist in admin API</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/admin_api/ip_blacklist_settings.ts <li>Added validation and sanitization for ASN blacklist input.<br> <li> Enforced maximum size constraint for ASN blacklist.<br> <li> Updated settings structure to include ASN blacklist. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/755/files#diff-02112f0b34b5d82117c3eebefb434860a3dba70dfd02f607796a0ba2a56c120f">+21/-1</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>ip_blacklist.ts</strong><dd><code>Add ASN blacklist logic and utility functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/ip_blacklist.ts <li>Introduced <code>isBlacklisted</code> utility for generic blacklist matching.<br> <li> Added <code>isAsnBlacklisted</code> function for ASN-specific checks.<br> <li> Updated IP blacklist logic to include ASN organization checks. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/755/files#diff-af35186f7408e3585e885c1c86e762daa73ae8ec4b99d6a263c7f330da975e5e">+82/-27</a>&nbsp; </td> </tr> </table></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#744
    No description provided.