[PR #401] [MERGED] feat: add ADDRESS_REGEX #561

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

📋 Pull Request Information

Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401
Author: @dreamhunter2333
Created: 8/12/2024
Status: Merged
Merged: 8/13/2024
Merged by: @dreamhunter2333

Base: mainHead: feature/dev


📝 Commits (1)

📊 Changes

9 files changed (+43 additions, -5 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 frontend/src/store/index.js (+1 -0)
📝 frontend/src/views/common/Login.vue (+16 -4)
📝 vitepress-docs/docs/en/cli.md (+2 -0)
📝 vitepress-docs/docs/zh/guide/cli/worker.md (+2 -0)
📝 worker/src/commom_api.ts (+1 -0)
📝 worker/src/common.ts (+17 -1)
📝 worker/src/types.d.ts (+1 -0)
📝 worker/wrangler.toml.template (+2 -0)

📄 Description

PR Type

Enhancement, Documentation


Description

  • Added dynamic email validation using a configurable regex pattern in both frontend and backend.
  • Updated various components and API responses to include and utilize the new ADDRESS_REGEX configuration.
  • Enhanced documentation to reflect the new ADDRESS_REGEX configuration option.

Changes walkthrough 📝

Relevant files
Enhancement
5 files
Login.vue
Add dynamic email validation using regex                                 

frontend/src/views/common/Login.vue

  • Added addressRegex computed property to handle dynamic regex for email
    validation.
  • Updated email validation logic to use addressRegex.
  • Modified UI text to display allowed characters dynamically.
  • +16/-4   
    commom_api.ts
    Include address regex in settings API response                     

    worker/src/commom_api.ts

    • Added addressRegex to the settings API response.
    +1/-0     
    common.ts
    Add dynamic regex fetching for email name sanitization     

    worker/src/common.ts

  • Added DEFAULT_NAME_REGEX constant.
  • Created getNameRegex function to fetch and compile regex from
    environment.
  • Updated email name sanitization to use getNameRegex.
  • +17/-1   
    types.d.ts
    Update Bindings type with ADDRESS_REGEX                                   

    worker/src/types.d.ts

    • Added ADDRESS_REGEX to Bindings type.
    +1/-0     
    index.js
    Add addressRegex to openSettings state                                     

    frontend/src/store/index.js

    • Added addressRegex to openSettings state.
    +1/-0     
    Documentation
    4 files
    CHANGELOG.md
    Update CHANGELOG for ADDRESS_REGEX configuration                 

    CHANGELOG.md

    • Documented the addition of ADDRESS_REGEX configuration.
    +1/-0     
    cli.md
    Document ADDRESS_REGEX configuration in English CLI guide

    vitepress-docs/docs/en/cli.md

    • Added documentation for ADDRESS_REGEX configuration.
    +2/-0     
    worker.md
    Document ADDRESS_REGEX configuration in Chinese CLI guide

    vitepress-docs/docs/zh/guide/cli/worker.md

    • Added documentation for ADDRESS_REGEX configuration.
    +2/-0     
    wrangler.toml.template
    Add ADDRESS_REGEX configuration example in template           

    worker/wrangler.toml.template

    • Added ADDRESS_REGEX configuration example.
    +2/-0     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions


    🔄 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/401 **Author:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Created:** 8/12/2024 **Status:** ✅ Merged **Merged:** 8/13/2024 **Merged by:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Base:** `main` ← **Head:** `feature/dev` --- ### 📝 Commits (1) - [`d6d888e`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/d6d888e24b7311c6ac3d7885e3d83373535ad83e) feat: add ADDRESS_REGEX ### 📊 Changes **9 files changed** (+43 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `frontend/src/store/index.js` (+1 -0) 📝 `frontend/src/views/common/Login.vue` (+16 -4) 📝 `vitepress-docs/docs/en/cli.md` (+2 -0) 📝 `vitepress-docs/docs/zh/guide/cli/worker.md` (+2 -0) 📝 `worker/src/commom_api.ts` (+1 -0) 📝 `worker/src/common.ts` (+17 -1) 📝 `worker/src/types.d.ts` (+1 -0) 📝 `worker/wrangler.toml.template` (+2 -0) </details> ### 📄 Description ### **PR Type** Enhancement, Documentation ___ ### **Description** - Added dynamic email validation using a configurable regex pattern in both frontend and backend. - Updated various components and API responses to include and utilize the new `ADDRESS_REGEX` configuration. - Enhanced documentation to reflect the new `ADDRESS_REGEX` configuration option. ___ ### **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>5 files</summary><table> <tr> <td> <details> <summary><strong>Login.vue</strong><dd><code>Add dynamic email validation using regex</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> frontend/src/views/common/Login.vue <li>Added <code>addressRegex</code> computed property to handle dynamic regex for email <br>validation.<br> <li> Updated email validation logic to use <code>addressRegex</code>.<br> <li> Modified UI text to display allowed characters dynamically.<br> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-0ee87c9358b6449242c09bd98ae1ad3a88fb9948c0fcc64c4db3d43e5ec83b4e">+16/-4</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>commom_api.ts</strong><dd><code>Include address regex in settings API response</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/commom_api.ts - Added `addressRegex` to the settings API response. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-fe2dec25bee7d722fe8aa25b616c21bd12b8123e26469f5cac11c9164be783c3">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>common.ts</strong><dd><code>Add dynamic regex fetching for email name sanitization</code>&nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/common.ts <li>Added <code>DEFAULT_NAME_REGEX</code> constant.<br> <li> Created <code>getNameRegex</code> function to fetch and compile regex from <br>environment.<br> <li> Updated email name sanitization to use <code>getNameRegex</code>.<br> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-fcc08fd5aa3c190d0d45c7e3dd208e5ee831d360b272fdd5869607cf472c5eb1">+17/-1</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>types.d.ts</strong><dd><code>Update Bindings type with ADDRESS_REGEX</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/types.d.ts - Added `ADDRESS_REGEX` to `Bindings` type. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-583fb024d5c9d1efac71bbea788d8379e5e8fc2f0bb1696a9863c6f6cac54bee">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>index.js</strong><dd><code>Add addressRegex to openSettings state</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> frontend/src/store/index.js - Added `addressRegex` to `openSettings` state. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-0c36ce15651c51795b411359e8caaf5af7960c82674b4f2015b8dd5f480fde2c">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>4 files</summary><table> <tr> <td> <details> <summary><strong>CHANGELOG.md</strong><dd><code>Update CHANGELOG for ADDRESS_REGEX configuration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> CHANGELOG.md - Documented the addition of `ADDRESS_REGEX` configuration. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>cli.md</strong><dd><code>Document ADDRESS_REGEX configuration in English CLI guide</code></dd></summary> <hr> vitepress-docs/docs/en/cli.md - Added documentation for `ADDRESS_REGEX` configuration. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-3f8f72a691fa19c8581621e91cf67ad28855af7a57e58513f6563cf4c8886e5f">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>worker.md</strong><dd><code>Document ADDRESS_REGEX configuration in Chinese CLI guide</code></dd></summary> <hr> vitepress-docs/docs/zh/guide/cli/worker.md - Added documentation for `ADDRESS_REGEX` configuration. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-f760a2ec5dad4b6bda0bd4a9325274567778add8cb984e73650dbaaf680c9178">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>wrangler.toml.template</strong><dd><code>Add ADDRESS_REGEX configuration example in template</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/wrangler.toml.template - Added `ADDRESS_REGEX` configuration example. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/401/files#diff-743273da72481b71fbeb1dddfd294be9249554eef65691dfc9bcfa9f0fd971fb">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
    kerem 2026-02-26 21:31:48 +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#561
    No description provided.