dreamhunter2333 / cloudflare_temp_email

CloudFlare free temp domain email 免费收发 临时域名邮箱 支持附件 IMAP SMTP TelegramBot
https://mail.awsl.uk
MIT License
2.15k stars 801 forks source link

feat: add ADDRESS_CHECK_REGEX #415

Closed dreamhunter2333 closed 1 month ago

dreamhunter2333 commented 1 month ago

User description

414


PR Type

Enhancement, Documentation


Description


Changes walkthrough 📝

Relevant files
Enhancement
6 files
index.ts
Refactor `newAddress` function call to use object parameters

worker/src/admin_api/index.ts
  • Updated newAddress function call to use an object for parameters.
  • Added enableCheckNameRegex parameter with a default value of false.
  • +7/-1     
    common.ts
    Add name validation using `ADDRESS_CHECK_REGEX`                   

    worker/src/common.ts
  • Added checkNameRegex function to validate name against
    ADDRESS_CHECK_REGEX.
  • Updated newAddress function to include enableCheckNameRegex parameter.

  • +36/-5   
    index.ts
    Refactor `newAddress` function call to use object parameters

    worker/src/mails_api/index.ts
  • Updated newAddress function call to use an object for parameters.
  • +6/-1     
    common.ts
    Refactor `newAddress` function call to use object parameters

    worker/src/telegram_api/common.ts
  • Updated newAddress function call to use an object for parameters.
  • +5/-4     
    types.d.ts
    Add `ADDRESS_CHECK_REGEX` to `Bindings` type                         

    worker/src/types.d.ts - Added `ADDRESS_CHECK_REGEX` to `Bindings` type.
    +1/-0     
    worker.ts
    Add `/user_api/oauth2` to middleware bypass paths               

    worker/src/worker.ts
  • Added /user_api/oauth2 to the list of paths that bypass middleware.
  • +1/-0     
    Documentation
    4 files
    CHANGELOG.md
    Update CHANGELOG for `ADDRESS_CHECK_REGEX` feature             

    CHANGELOG.md
  • Documented the addition of ADDRESS_CHECK_REGEX for address name
    validation.
  • +5/-1     
    cli.md
    Document `ADDRESS_CHECK_REGEX` in CLI guide                           

    vitepress-docs/docs/en/cli.md - Added documentation for `ADDRESS_CHECK_REGEX`.
    +3/-1     
    worker.md
    Document `ADDRESS_CHECK_REGEX` in CLI guide (Chinese)       

    vitepress-docs/docs/zh/guide/cli/worker.md - Added documentation for `ADDRESS_CHECK_REGEX`.
    +3/-1     
    wrangler.toml.template
    Add `ADDRESS_CHECK_REGEX` configuration example                   

    worker/wrangler.toml.template - Added `ADDRESS_CHECK_REGEX` configuration example.
    +3/-1     

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

    github-actions[bot] commented 1 month ago

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🔒 No security concerns identified
    ⚡ Key issues to review

    Possible Bug
    The `checkNameRegex` function does not return any value if the regex string is not found. This could lead to unexpected behavior. Consider returning a boolean or throwing an error to handle this case explicitly. Code Smell
    The `checkNameRegex` function logs an error but does not propagate it. This could make debugging difficult. Consider rethrowing the error or handling it in a way that the caller is aware of the failure.